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 CCS Technical Support

Out of RAM error; more possible solutions

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



Joined: 28 Jul 2005
Posts: 23

View user's profile Send private message

Out of RAM error; more possible solutions
PostPosted: Mon Aug 01, 2005 6:03 am     Reply with quote

hi all,

Ive had those good ol' "out of RAM" and "out of ROM" errors that i resolved by adding the #device thingi and splitting into functions( # separate didnt work) but im still lacking ROM. Anybody having ideas to free some more ROM; Plz share !!
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Aug 01, 2005 6:38 am     Reply with quote

1. Use a chip that has more ROM space
2. Try to combine like routines into a single function
3. If using write_eeprom() in multiple places, place this function in a wrapper function. CCS puts this function inline so the code is repeated on each call.
4. Remove an printf's that aren't really needed.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Aug 01, 2005 7:03 am     Reply with quote

And in addition:
5) Don't use float variables (replace them by integer arithmetic).
6) Check the list file (*.lst) for large functions and think of ways to make them smaller.
7) Check the symbol file (*.sym) for variable sizes.
8) Check the call tree file (*.tre) for RAM used in every function (call).


For example I discovered the CCS supplied atoi() function to be huge, taking over 800 bytes of ROM because it is capable of converting every counting system in the universe to binary. I only need to convert HEX to bin and wrote my own function in about 50 bytes.
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