View previous topic :: View next topic |
Author |
Message |
colin382
Joined: 03 Jun 2020 Posts: 37 Location: UK
|
Code won't fit |
Posted: Sat Sep 04, 2021 4:30 am |
|
|
I have a program originally written for an 18LF25K22 which uses 73 bytes RAM and 6964 bytes ROM. Most of the ROM used is a font pixel table for a display.
I would like to transfer the program to a 16LF15325. The datasheet says it has 1K RAM and 8KW (14KB) ROM, so it should fit.
But the code doesn't fit. Why not, and is there some way of making it fit?
Using compiler version 5.105.12.10 with PicKit4 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Sat Sep 04, 2021 4:45 am |
|
|
why,... probably a chunk of it won't fit into a 'bank' of ROM.
the 'fix' Sometimes rearranging the order that functions are written, allows he compiler to 'fit it in'. The FAQ section of the manual explains,also search this forum...it's a common 'problem'.
I haven't looked at the datasheets, but you might have to 'split' the 'font table into say 2 or 3 smaller sections. Say it's 1500 bytes long and banks of ROM are 1000. The whole table won't fit into 1 bank, but rework the table into 2 sections(say 750+- each) and it'll fit into 2 banks of ROM.
A logical 'break' for font tables could be upper case letters, lower case letters.
I'm sure others will reply with suggestions. |
|
|
Jerson
Joined: 31 Jul 2009 Posts: 125 Location: Bombay, India
|
|
Posted: Sat Sep 04, 2021 5:24 am |
|
|
perhaps the #separate directive for functions might help you some way. |
|
|
colin382
Joined: 03 Jun 2020 Posts: 37 Location: UK
|
|
Posted: Sat Sep 04, 2021 5:38 am |
|
|
Thanks both, the code bank thing fits with the compiler error messages I see, so I will try that first.
The font map is already reduced to just the characters I need, but it can be divided into four roughly equal chunks, so hopefully it can be set into separate banks. |
|
|
colin382
Joined: 03 Jun 2020 Posts: 37 Location: UK
|
Code wont fit SOLVED |
Posted: Sat Sep 04, 2021 6:46 am |
|
|
Actually all I needed to do was to split the font map from two variables to three, with each smaller than the bank size implied in the error messages (0x800 in this case), the compiler handled the rest. The CCS compiler continues to impress! |
|
|
|