Pages: [1]   Go Down
Author Topic: Mega 2560 Maxium Sketch Size?  (Read 810 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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"
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26632
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A useful shortcut to avoiding explicit PROGMEM handling is to use the F() macro wherever possible - see here
Logged

"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.

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Typo maybe??  I found the F() macro explained at http://arduino.cc/en/Main/ReleaseNotes
Logged

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26632
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Typo maybe??
Where?
Logged

"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.

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In the link
Logged

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26632
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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”))
Logged

"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.

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You're right, I missed it.
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!!!
Logged

Pages: [1]   Go Up
Jump to: