View previous topic :: View next topic |
Author |
Message |
meereck
Joined: 09 Nov 2006 Posts: 173
|
Tinybootloader+PIC16F883 |
Posted: Tue Jan 18, 2011 9:50 am |
|
|
I have been using the following syntax for tiny bootloader definition:
Code: |
#define MAX_FLASH getenv("PROGRAM_MEMORY")
#define LOADER_SIZE 0xFF //tinybld size + a bit more (200 bytes is enough)
#build(reset=0x0000:0x0007)
#org MAX_FLASH-LOADER_SIZE , MAX_FLASH-1 {}//void boot_loader(void) {}
|
It has always worked well for all the PICs I have ever used.
But it does not compile for 16F883/6.
There is 1 error and weird compiler messages:
"#build(reset=0x0000:0x0007)" causes the following messages:
"Error: Invalid ORG directive"
" and also
Info 300....More info: Segment at 00000-00007 (0004 used) Priv.
"...and similar ones.
Is "#build(reset=0x0000:0x0007)" line essential for the bootloader to work?
Cheers
Meereck |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 18, 2011 3:20 pm |
|
|
Quote: | #build(reset=0x0000:0x0007)
|
I don't know anything about the Tiny Bootloader, but this line looks
suspicious. In the 18F PICs, the interrupt vector is at address 0x0008,
so it would seem that the line above is for an 18F PIC.
But you are now using a 16F PIC. In those PICs, the interrupt vector
is at address 0x0004, so an upper limit of 0x0003 would seem more
likely to be correct.
But, if that doesn't work, post a little test program which uses the lines
from your post, and about maybe 10 more lines (total).
And, post your compiler version so we can test it. |
|
|
meereck
Joined: 09 Nov 2006 Posts: 173
|
|
Posted: Tue Jan 18, 2011 3:52 pm |
|
|
oops, didnt realize that.
I have always been using 18F PICs, not 16F, so you got the point!
thanks
Meereck |
|
|
|