Bill
Joined: 19 Aug 2005 Posts: 2
|
Very large (>64k) constant data table in program memory |
Posted: Fri Aug 19, 2005 10:54 am |
|
|
I am trying to put a 54k pixel x 16 bit image into the PIC18F6722, (which has 128kb program memory).
I have attempted to do this using the #ORG and #ROM statement as follows:
Code: |
#ORG 0x0400, 0xFFFE {}
#ORG 0x10000, 01BFFE {}
#ROM 0x400={0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800}
#ROM 0x420={0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0xf800}
etc. |
but a compiler limit is reached. I'm using version 3.230.
I've also tried doing it in bytes using
Code: | #ROM int8 0x400={00, 00,
etc..
| which behaved differently, compiled, but missed out part of the image from the hex file.
I'm using #ROM rather than a c array, because the implementation of const c arrays is odd, and unsuitable for the purpose.
The code (thousands of lines), needless to say, is auto-generated. I could generate it as a hex file and add it to the hex file generated by the compiler, but I'd like the compiler to do some of the work!
Any ideas, anyone? |
|