Go Down

Topic: ExtraPutty screen freezes (Read 4375 times) previous topic - next topic


sorry, when I post it in quotes, the publisher thinks im tryting to enter lists in my 2D arrays...


Sep 20, 2012, 04:44 pm Last Edit: Sep 20, 2012, 04:45 pm by jdforlife Reason: 1
cant be the SRAM ner...? cuz its got 8KBs of SRAM... I mean, I am hardly using 4kbs for my variables...


There's a code sample in the playground that shows you how to measure the free memory. I suggest you call it and see whether you're anywhere near the limit.


Hi PeterH... I tried this method to see how much of free RAM I have from playground ->

Another method that seems to be even simpler is the following:
Declare this function:
int freeRam () {
  extern int __heap_start, *__brkval;
  int v;
  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);

and call it anywhere in your program like that: Serial.println(freeRam());

And it always reads, 5173 from the start. I guess it means I have 5173bytes of RAM left in my Mega 2560...

Btw, when the serial output gets stuck, the RX TX lights light up and stay lit, sometimes both, sometimes either and today none... It is really irritating now...  :~

Go Up