Go Down

Topic: Stuck in Uploading to I/O Board with Mega 2560 (Read 9 times) previous topic - next topic


Ok. So no difference in OS (I am using Windows 7, 64bit also). I renamed all the variables and did a search on the site for any matches to those names (no hits for exact matches). Still failing.

I think if someone has a Mega 2560 to check this on it might be useful. I would not think it is a flaw with the bootloader... BUT I was in software QA and I still have that wonderful computer aura of what can go wrong around me at times.

Here is the latest "failing" code. Note: Problem is not commented at this time. If someone DOES have a Mega and has the problem, comment out the if statement for the IncrementingInteger == AlarmTriggerInteger and see if it still fails.
Code: [Select]
int IncrementingInteger = 1345;
int AlarmTriggerInteger = 1355;
boolean BooleanAlarmTriggered = false;

void setup() {
 Serial.begin( 9600 );

void loop() {
 delay( 5000 );
 IncrementingInteger = IncrementingInteger + 1;
 Serial.print( "Incrementing integer: " );
 Serial.println( IncrementingInteger );
 Serial.print( "Alarm trigger integer:" );
 Serial.println( AlarmTriggerInteger );
 if ( BooleanAlarmTriggered == false ) {
   if ( IncrementingInteger == AlarmTriggerInteger ) {
     BooleanAlarmTriggered = true;
     Serial.println( "Alarm has gone off!!!" );


Hi, I've tried your code on my 2560 and I get a 'avrdude: stk500_2_ReceiveMessage(): timeout' error. This is on OSX with version 22 of the arduino IDE.

If I delete one of the exclamation marks it works. Seems that the compiler doesn't like strings containing more than 2 exclamation marks in a row!!!

Hope that helps.


That was it?! I just tried it and sure enough it works just fine. I would say this is a definite bug for the 2560. Might be something in the bootloader. Fairly minor problem overall but who would think of it? I will check the problem lists to see if there is anything about this yet. If not I will submit it. Thanks very much for the help.



I had a similar problem and found this thread. After removing the exclamation marks in my code uploading works again.

I also tried your code. With the exclamation marks it won't finish uploading. Always displaying the following:
avrdude: stk500_2_ReceiveMessage(): timeout

Without the exclamation marks uploading works.

I'm using an Mega 2560 with an EthernetShield. And Ubuntu 10.04 with Arduino 0021 64bit.


I meant to say IDE instead of compiler, but the same error on three different systems points to a bug specifically with the Mega. As you say, definatly a wierd one!

Go Up