shooter Guest
|
Bootloader adaption from 8k to 4k flash device |
Posted: Sun Mar 02, 2008 11:48 am |
|
|
Hello everybody,
i need a bootloader for the 16F88. My problem is that i can't find any in the web for the 16F88, so i tried to change some code fragments of the delivered example bootloader (EX_BOOTLOADER.C) and also tried this with the Codeloader (w*w.thebytefactory.com/dl_codeloader.asp)
Both are written for the 16F877, which have an 8k flash. If I compile them i'll get always an "Out of ROM" error. So i have to change something by the #org instructions, but don't know to which value they have to be set.
Here are the code fragment which reserves the rom so the bootloader has to be write at the end, i hope some of you can tell me the right values. Here you see the Codeloader.
Code: | // The loader will protect itself from firmware being downloaded on top of it
// The MAX_LOADABLE values below are set loosely so that a wide variety of compiler versions will
// compile this source code without "Out of ROM" errors. To maximize the available program space for
// user applications, MAX_LOADABLE should be adjusted to as large as your compiler version will allow.
#if getenv("FUSE_SET:WDT")==TRUE
#define MAX_LOADABLE 0x1B00 // The watch-dog is enabled and will be reported to (requires more program memory)
#else
#define MAX_LOADABLE 0x1B20 // The watch-dog is disabled allowing for smaller loader size
#endif
#org 0x0004, 0x07FF {} // Consume program memory to force the loader to reside in the highest space
#org 0x0800, 0x0FFF {}
#org 0x1000, 0x17FF {}
#org 0x1800, MAX_LOADABLE {} // CodeLoader will reside from MAX_LOADABLE + 1 to the end of program memory |
Im not sure where the code is hid that is responsible by the CCS example bootloader.
Sorry if i spoke a little bit confused because my english is not perfect but i think you can understand it and if not just tell me. Thanks ahead.
Greetings!
Benny |
|