I am working on a large project, and SRAM memory is getting very tight. I am monitoring the available memory at several points in the program (using below code, from Adafruit website), but my question is, at what level have you generally found low memory to get critical and likely to cause unexpected crashes? 100 bytes? 200? 500?
int freeRam ()
{
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
Can always "upgrade" the processor for more SRAM too: Atmega1284P, 16K SRAM, twice that of the Mega2560.
I offer kits/assembled boards in a couple of form factors, more info at: http://www.crossroadsfencing.com/BobuinoRev17/
HazardMinds, the code is probably too long to post, but I have used the F() macro for all strings (and there aren't many). I am using the smallest possible data types for all variables and minimizing the use of global variables. I do however need a fair number of libraries to work with connected devices.