[SOLVED] NewSoftSerial - how to get 512 bytes buffer without SRAM overflow?

OK, now that you know what it is, this is how you handle a string out the serial port.

char Dbuf[100];

  strcpy_P(Dbuf,PSTR("********************long string that takes up space..********************"));
  Serial.println(Dbuf);
// and then
  strcpy_P(Dbuf,PSTR("********************yet another long string that takes up space..********************"));
  Serial.println(Dbuf);

Notice how the same 100 bytes of Dbuf can be used over and over again? If you want to put variables in it, use two buffers:

char Dbuf[100];
char Dbuf2[100];

  strcpy_P(Dbuf2,PSTR("******************** variable 1 = %d, variable2 = %d********************"));
  sprintf(Dbuf,Dbuf2, variable1,variable2);
  Serial.println(Dbuf);

And then use the two buffers over and over again. I've never been clear on exactly how the strings are allocated and where, etc. However, they really do seem to use twice as much space as they should unless you use PROGMEM to handle them. It really does appear that they are held in sram until runtime and then copied into ram. I can't think of another explanation why they use twice as much as one would think. However, that's another discussion. Just use the easy examples above and you can cut memory usage waaaay down and get on with your project.

edit: Oh, and notice that it's not strcpy(), it's strcpy_P. There's corresponding '_P' routines for most of the c string routines.