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
Posted: Mon Aug 01, 2005 6:38 am
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
Posted: Mon Aug 01, 2005 7:03 am
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.
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