CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Code won't fit

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
colin382



Joined: 03 Jun 2020
Posts: 37
Location: UK

View user's profile Send private message

Code won't fit
PostPosted: Sat Sep 04, 2021 4:30 am     Reply with quote

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: 9101
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Sep 04, 2021 4:45 am     Reply with quote

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: 122
Location: Bombay, India

View user's profile Send private message Visit poster's website

PostPosted: Sat Sep 04, 2021 5:24 am     Reply with quote

perhaps the #separate directive for functions might help you some way.
colin382



Joined: 03 Jun 2020
Posts: 37
Location: UK

View user's profile Send private message

PostPosted: Sat Sep 04, 2021 5:38 am     Reply with quote

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

View user's profile Send private message

Code wont fit SOLVED
PostPosted: Sat Sep 04, 2021 6:46 am     Reply with quote

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!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group