View previous topic :: View next topic |
Author |
Message |
ye
Joined: 11 May 2005 Posts: 57 Location: london
|
running out of RAM?! |
Posted: Wed Sep 28, 2005 4:40 am |
|
|
Hi everybody,
I am using 18f8722 but due to the massive size of the code, I am running out of RAM....
ROM used: 50186 bytes (38%)
Largest free fragment is 65536
RAM used: 2834 (74%) at main() level
3104 (81%) worst case
Stack: 8 worst case (7 in main + 1 for interrupts)
Can anybody give any indications what else could cause a huge RAM usage besides too many variables?
Whether or not by looking at the LIST file, is there any way to find out which part of the code is eatting significant amount of RAM? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Sep 28, 2005 6:26 am |
|
|
Code doesn't really use up RAM. The compiler does use temporary variables but they are not going to account for a "huge" amount. Strings, arrays, static and global variables are your most likely canidates. |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Sep 28, 2005 7:35 am |
|
|
Try to avoid using large data types such as floats. I find most floats could be scaled integers instead. People assume they need floats if they are using trig etc. but with a little though it is not so. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Wed Sep 28, 2005 10:52 am |
|
|
Have you looked at the memory map to see what is using all the memory? |
|
|
|