I'm a little hazy on the memory usage in the Arduino software. I have a number of independent modules that will run in sequence. Since these are pretty independent, in a normal programming environment I'd conserve memory by utilizing the stack as much as possible, e. g. make each module a function with local variables on the stack.
So the question is, does this model work on the Arduino? Is there also a heap?
For the AVR processor that uses the Harvard architecture, variables and stack are both located in the same SRAM memory so in reality using global variables would decrease SRAM usage I would think.
Re: Using memory efficiently
Reply #1 - Today at 17:20:43
For the AVR processor that uses the Harvard architecture, variables and stack are both located in the same SRAM memory so in reality using global variables would decrease SRAM usage I would think.
Lefty
I agree. I was just wanted to be sure the stack exists and goes away at the end of a function. If I need 100 bytes of memory in 200 different functions, can I assume I'm going to get them, 100 at a time, like in conventional c environments? Or are they somehow always statically assigned?