PDA

View Full Version : PIC18F452 bootloader from MMC-card



Felch
- 7th November 2006, 22:00
Hi!
I needed such code for one project but..net was full of "usual" serial bootloaders. So i was forced to write it. Hope, this example will help somebody!
Code (source in assembly and .hex file) here: http://parsek.yf.ttu.ee/~felc/PIC/bootloader.zip

Since all comments in source are presently in my native tongue (will translate, if thread looks useful), some explanation could be useful.
Code is located form adr 0x7000 upwards. There are 2 ways to access it:
- by jumping to label "errorloader" - first file with name "codexxxx.hex" found on the MMC is flashed to PIC.
- by calling to label "bootloader". In this case file parameters (all 32 bytes read from catalog entry) must be saved to buffer "File_Name".
In both cases flashing will be attempted again and again in case of read errors and/or power failures (bootloader will write a "goto errorloader" command to the reset vector. User code will be written there only in case of successful flashing.
Code reads standard Intel .hex files.Any data mentioned to be written above 0x7000 will be ignored.
PIC's internal EEPROM and conf. bits will be written in accordance to source file.

Actually...I am aware that this is not very close to PICBasic. Moderators, please forgive me....

2solar
- 19th January 2007, 21:57
Hello, i just found this post. It sounds very interesting. Please correct your link, because i can't download your code.

Felch
- 20th January 2007, 12:26
Hi!
Checked, link works OK. could be some server problem,so i uploaded the code to forum directly. Have fun!
/Felch