PDA

View Full Version : Bootloader and EEPROM



milestag
- 10th November 2005, 04:12
In my PBP program, I am using the EEPROM command to pre-load about 32 EEPROM locations with data. Works great programming the hex file direct from MeLabs' Serial Programmer.

But when I use a bootloader to load the hex file, the EEPROM is not written to (or not loaded correctly). Is it even possible to write to EEPROM using a bootloader? Otherwise it looks like the program is loading and running fine. I'm probably missing something simple.

(I am using the freeware TinyBld bootloader).

Any help appreciated.

regards,
Jim

mytekcontrols
- 10th November 2005, 04:41
If you are talking about the "Tiny Bootloader" at 100 bytes in size, then no you will not be able to automatically have the EEprom loaded with the DATA statement. If I remember correctly, you can still manually enter it.

milestag
- 10th November 2005, 05:10
Okay, thanks. Yes, I think you are right the more I am reading on this. And manually entering each value from the log screen would get too tedious.

Looks like I'll have to try embedding the EEPROM data into the bootloader's asm file.

milestag
- 10th November 2005, 20:52
For those who might be interested, other than having to manually deal with writing to the EEPROM Data memory (maybe this is the case for ALL bootloaders?), this turns out to be a very nice little bootloader app. And best of all it's FREE.

http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm

It was very easy to set up and (surprisingly to me) worked on the first try with a PIC18F2525. I simply had to add the Loader Define in my PBP source file:

#DEFINE LOADER_USED 1

I used the same MAX232 circuit shown on Mechanique's site. I had already built that circuit intending to buy the MCS bootloader (until I found the free one). I did not include the optional Reset portion of the circuit since I was already using the MCLR pin. All works fine without it. Even the USART TX/RX pins are pulling double duty as normal I/O pins when the PIC's main program is running. And leaving the MAX232 connected does not affect anything. So I now have in-circuit programming capability without giving up any I/O lines or having to use any jumpers. VERY SLICK. I guess I am a "bootloader convert" now.

Thank you to those who answered my bootloader questions earlier.

mytekcontrols
- 10th November 2005, 22:57
I also have used this bootloader and find it to be very reliable, and flexible. It also has a very nice built-in terminal window for entering or monitoring data through the same USART lines that it uses for programming.