Still working on my Auto Humidistat project and it looks like I am running out of memory.
This is what I get at the end of the compiler:
RAM available:384 bytes, used:164 bytes (42.8%), free:220 bytes (57.2%),
Heap size:220 bytes, Heap max single alloc:79 bytes
ROM available:4096 words, used:4062 words (99.2%), free:34 words (0.8%)
What can i do to reduce things a bit?
Less variables?
I do have a spot where I could use the same variables just change the calculation a bit.
I still need to add about 10 decision trees to things.
Bob
Running out of Memory
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Running out of Memory
Hello Bob,
It looks like your variable usage (RAM) is fine. The problem is your program code (ROM).
To try and reduce the ROM usage look for sections of code that are repeated and see if you can move any of the repeated code into a macro to save a bit of space. If you don't have much repeated code then is there a logical way to remove the complexity of your programs by restructuring etc?
If you post up your program to the forums then we can probably offer some pointers of where to start.
It looks like your variable usage (RAM) is fine. The problem is your program code (ROM).
To try and reduce the ROM usage look for sections of code that are repeated and see if you can move any of the repeated code into a macro to save a bit of space. If you don't have much repeated code then is there a logical way to remove the complexity of your programs by restructuring etc?
If you post up your program to the forums then we can probably offer some pointers of where to start.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Running out of Memory
I have not removed any thing yet.
I was going to display both temp in C and in F, only use degrees F here in the USA.
Will remove the temp in C or use the same string variables with a different calculation. Have to toy around with that one.
I can loose the do nothing loop where I display x o X . Had that in there so I could just see the program was running.
I could also loose the interrupt and just check the switch state like I had originally planned on, have to move the pins from RA2 and RA3 to RB6 and RB7 to use the interrupt, poor planning on my part.
I have all my formulas working well, just have to smooth things out. I could also loose the start up display at the beginning of the program, no one is going to see that part anyway except once on start up.
As a side note: Chinese LCD displays use a strange ASCII set, I always thought ASCII 167 was a degree symbol, on this display it is 223.
I was going to display both temp in C and in F, only use degrees F here in the USA.
Will remove the temp in C or use the same string variables with a different calculation. Have to toy around with that one.
I can loose the do nothing loop where I display x o X . Had that in there so I could just see the program was running.
I could also loose the interrupt and just check the switch state like I had originally planned on, have to move the pins from RA2 and RA3 to RB6 and RB7 to use the interrupt, poor planning on my part.
I have all my formulas working well, just have to smooth things out. I could also loose the start up display at the beginning of the program, no one is going to see that part anyway except once on start up.
As a side note: Chinese LCD displays use a strange ASCII set, I always thought ASCII 167 was a degree symbol, on this display it is 223.
- Attachments
-
- newhum101.fcf
- (24.48 KiB) Downloaded 306 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Running out of Memory
I noticed a couple of floating point values in the program and wondered if these could be causing the code bloat.
e.g. 102.4
e.g. 102.4
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Running out of Memory
Darn,
Missed that one.
changed it to 102
Amazing how much a float value will eat up.
RAM available:384 bytes, used:120 bytes (31.3%), free:264 bytes (68.7%),
Heap size:264 bytes, Heap max single alloc:79 bytes
ROM available:4096 words, used:1849 words (45.2%), free:2247 words (54.8%)
Thanks Ben.........
Missed that one.
changed it to 102
Amazing how much a float value will eat up.
RAM available:384 bytes, used:120 bytes (31.3%), free:264 bytes (68.7%),
Heap size:264 bytes, Heap max single alloc:79 bytes
ROM available:4096 words, used:1849 words (45.2%), free:2247 words (54.8%)
Thanks Ben.........
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Running out of Memory
Guess I am just going to have to bite the bullet and upgrade to The Pro Version, If I can find my License key for the 5.0 Student.
Bob
Bob
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Running out of Memory
Hi Bob,
If you can't find it then send me a PM with your details: username, email etc and I will see if I can dig out the key for you.
If you can't find it then send me a PM with your details: username, email etc and I will see if I can dig out the key for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Running out of Memory
Had to do away with a few things.
Talk about cutting it close.
RAM available:384 bytes, used:118 bytes (30.8%), free:266 bytes (69.2%),
Heap size:266 bytes, Heap max single alloc:79 bytes
ROM available:4096 words, used:4051 words (99.0%), free:45 words (1.0%)
Bob
Talk about cutting it close.
RAM available:384 bytes, used:118 bytes (30.8%), free:266 bytes (69.2%),
Heap size:266 bytes, Heap max single alloc:79 bytes
ROM available:4096 words, used:4051 words (99.0%), free:45 words (1.0%)
Bob