PDA

View Full Version : large preload includes



longpole001
- 26th January 2020, 05:23
HI guys

had an need to preload a pic with an include , that has a lot of preset serial strings and other data that the pic processes and then places the data into external flash chip in the areas and format needed

the problem is the include is now bigger than the pic can handle and exceed the complie size for the pic(128k)

simple answer is just devide the include into smaller parts , and then load /compile smaller includes files
how ever management of the include when i need to add/ change things is a bit of pain as well when having to deal with multi files of the same base large include

but would be nice to keep the large include as 1 file and allow the compiler to take selected sections of it to the max compile size and then generate multi hex files

is that at all possible

cheers

Sheldon

richard
- 26th January 2020, 05:48
get one of these

http://www.autoelectric.cn/en/tl866_main.html

and put a header on your board for the programmer to access the flash chip

or

add a routine to read in the flash data from an external source.

my tft stuff included a flash routine to load images serially@38kbaud to a windbond 32meg chip, tested to do 100k files no problem

pedja089
- 26th January 2020, 18:24
It can be done with #IF ....
Look manual for conditional compile in manual.
I would suggest to you that you download data using serial port, or similar. So you don't have need to load multiple hex into pic.

longpole001
- 26th January 2020, 22:42
ok cheers guys ,

i have spi port on the flash chip for programming , so dont have to load multi hex files to pic after the end hex file is made for the flash, just copy it to the other flash chips as needed

i have seperate compiles for the code as it was best to manage them that way from the start
but now the includes on the 1 of them is grown and i rather not separate that to another install

a structured #if would be good for those sections that could be loaded first , with a separation of the flash blocks done

the pic install also install some information that is generated from flash info into the external EE chip sets after the external flash has loaded , so some consideration is required if the separating the install of the flash data

fun stuff

longpole001
- 29th January 2020, 11:16
yep the #if works well enough

just need to make sure the #define is placed prior to the includes , which makes sense

saving the file a dif name for when the define is 0 and again when it 1 is fine

the files now under 80k which gives the include a bit more space to grow