Arduino Duemilanove - big code don´t run well

I´m developing a code and when the compliled code (binary sketch code) is greather than 19510 bytes (of a 30720 byte maximum) it run OK.

But when I add code and the binery grows from 19510 to 19540 bytes the code don´t run well.

I´m using Arduino Duemilanove with a Ethernet Shield V01.

I joined NTP, Web Server, SNMP reading digital temperature/humidity, voltage, current and calc power consumption of a datacenter.

May anybody help me?

What do you mean by “the code don´t run well”?

is it slow? is it unreliable?

What code did you add exactly?

Without more detail about what you changed in the program, I’m afraid it will be difficult to determine the cause of any problem you are encountering.

Paul

It’s probably a symptom of running out of RAM as opposed to the flash storage space. If you can cut out stuff like Serial.prints used for debugging (if you have any), does that make a difference?

pbender:
What do you mean by “the code don´t run well”?

is it slow? is it unreliable?

What code did you add exactly?

Without more detail about what you changed in the program, I’m afraid it will be difficult to determine the cause of any problem you are encountering.

Paul

Simply the code don´t run well. The SETUP function is

Server server(80);

void setup()

{

Ical = 1 / 13.05;

Vcal = 1 / 1.36;

Ethernet.begin(mac, ipSensor, gateway, mask);

Udp.begin(localPort);

}

When the program run well (code size 19502 bytes) my PC pings the Arduino after reset or turn on. But when I uncomment some lines in source code, from lines 1490 to 1526 and recompile the binary size grows 19582 or more the code don´t function well and I can´t ping sucessful.

The code was attached.

trialex:
It’s probably a symptom of running out of RAM as opposed to the flash storage space. If you can cut out stuff like Serial.prints used for debugging (if you have any), does that make a difference?

The code doesn´t contains Serial.print(). Peharps the use of lots of function use great amount of “extra” memory.

I was using Serial.print as an example of code that you could possibly remove to see if it made a difference. As you hadn’t posted any code nobody could tell you exactly what to try…

I still say it’s a RAM issue.

trialex:
I was using Serial.print as an example of code that you could possibly remove to see if it made a difference. As you hadn’t posted any code nobody could tell you exactly what to try…

I still say it’s a RAM issue.

Another possibility is inefficient code, probably triggered in the loop function.

Until I see all the code, I am not sure what the exact cause is however.

Paul

Hawk:
When the program run well (code size 19502 bytes) my PC pings the Arduino after reset or turn on. But when I uncomment some lines in source code, from lines 1490 to 1526 and recompile the binary size grows 19582 or more the code don´t function well and I can´t ping

What code is between lines 1490 and 1526?

The code was attached.

Where?

Paul

on little 8 bit micros, try your best to structure your math to not use floating point.

Scale up values so that there’s an implied decimal point. Use longs (32 bits) if needed, instead of floats.

Another one saying the same, you are running out of RAM, I have already suggest to add the output from the gcc compiler in the arduino IDE so people can see the used RAM, the code size is already there, adding ram should be more 2 or 3 lines of code, but no-one cares about that.

pbender:
What do you mean by “the code don´t run well”?

is it slow? is it unreliable?

What code did you add exactly?

Without more detail about what you changed in the program, I’m afraid it will be difficult to determine the cause of any problem you are encountering.

Paul

The program starts, sometimes I can send pings from a PC and Ethernet board replies but syslog or smnp traps are not received and html page is not showed.

pbender:

Hawk:
When the program run well (code size 19502 bytes) my PC pings the Arduino after reset or turn on. But when I uncomment some lines in source code, from lines 1490 to 1526 and recompile the binary size grows 19582 or more the code don´t function well and I can´t ping

What code is between lines 1490 and 1526?

The code was attached.

Where?

Paul