The blog of a dedicated radio amateur and electronics enthusiast

"Having fun on the air and in the workshop - communicating and creating"

10 February 2011

Bootloader in action


After programming a boot-vector and boot-block into the PIC microcontroller's flash program memory, I used a bootloader to upload my application code to the PIC from the PC using its com port, the level converter, ( featured yesterday ), and the EUSART, ( enhanced universal synchronous asynchronous receiver transmitter ), connections on the PIC. The top picture shows all the project hardware, looking a bit untidy by now.
To check, I read back from the PIC to the bootloader the entire contents of program memory, ( actually also data eeprom and config ). The screen capture in the lower picture shows just the first portion of this, from address 0000hex to address 00DFhex. On looking at this I can see that the bootloader has highlighted the boot-vector code, at address 0000hex - 0003hex; the high priority interrupt vector and low priority interrupt vector are still at 0008hex - 000Bhex, and 0018hex - 001Bhex respectively. My PIC type, com port and speed are correctly declared in the bottom right corner. I notice that the time taken for the flash memory 'read' was 35 seconds. I'll configure com2 for a higher speed to reduce this, although I won't be reading memory very often. I recall that, earlier, 'writing' took only 4 seconds.(*)
It'll be interesting to use the bootloader for programming instead of the ICD2, which of course will still be essential for debugging.
All this has got me thinking about the download area on my eventual (?) website !
( My thanks to Microchip Technology Inc. for the freeware serial bootloader AN1310v1.04 )

* Update, 11 February : I subsequently changed the speed of com2 from 9600 to 115200 bits per second; now write and read times have been reduced to 0.942 and 2.975 seconds respectively.

No comments: