Hi at all,
is there someone that know a system to measure, at runtime or compiler time, real avaiable memory.
I ask this because I have a problem when make a Sketch over 8KB (with Arduino UNO and IDE version 0022), after many tests I find that my upper static variable are located, into ram address 1858, and my dynamical variable (a byte inside my function, therefore located in the upper positions of the stack) have a ram address of 2275. Do you remember that Stacks, tipically, work decrementing the ram location pointer from the upper of the avaiable memory (2303). If I calculate difference 2275-1858 I have 417 free ram address before to have a collision of the stack with static variable, but in thi condition if I add a function (extend stack for call the function), or add two "int" inside an existing function, I have a abnormal response at runtime.
To comprove this phenomena, I have ottimizated the code remoning local variable inside variuos existing function, and with this optimization I have extended the Sketch code until 10KB without runtime problems. At this point I have 420 bytes free, too; but now I need to add a small piece of code, calling a new function, and Now it appeare impossible. Note that I have 20KB free of rom but in the reality it is impossible to use.
There is someone that can help me, please? Thanks