Go Down

Topic: Mega 2560 Maxium Sketch Size? (Read 864 times) previous topic - next topic

mharris_ny

I have a Mega R3, using IDE 1.0.3 with windows.  If I upload a sketch that is 40,118 bytes of 258,048, it loads and runs.  If I upload a sketch (with no errors) that is 41,544 bytes or more, I don't get any errors but the program does not run on the board.  Any help/solutions would be greatly appreciated!  I really only need a little more memory for my application.  Thanks!

westfw

Programs that upload OK but don't run properly, upon passing some particular program size, seem to usually be due to using up all the RAM (data) memory on your chip, rather than the program memory.  Strings, for instance, consume data memory even though you might think that they don't.  See other threads on mentioning "progmem"

AWOL

A useful shortcut to avoiding explicit PROGMEM handling is to use the F() macro wherever possible - see here
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

draythomp

Typo maybe??  I found the F() macro explained at http://arduino.cc/en/Main/ReleaseNotes
Trying to keep my house under control http://www.desert-home.com/

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

draythomp

Trying to keep my house under control http://www.desert-home.com/

AWOL

It points to the "print" method, where the third paragraph says
Quote
You can pass flash-memory based strings to Serial.print() by wrapping them with F(). For example :
Serial.print(F("Hello World"))
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

draythomp

Trying to keep my house under control http://www.desert-home.com/

mharris_ny

The F() Fixed It!!! I had a whole bunch of client.print("....") statements.  I changed them to client.print(F(".....")and the program uploaded and works.  Thank you very much for all your help!!!

Go Up