Pages: [1]   Go Down
Author Topic: Arduino Mega Suddenly Not Programmable Anymore on Win7 But Still Works with Mac  (Read 1389 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 strange problem with my Mega 2560. It used to work fine with my Win7 set-up for weeks of programing and testing. Then one day, I changed one code line in my sketch, and after that I was not able to upload it anymore. The Mega still shows up as a device on the computer. I re-installed the driver but to no avail. It compiles and then gets stuck indefinitely while 'uploading'.

Now the strange part: I connected a spare (i.e. different) Mega 2560 to my Win7 machine (showing up on a different com port, on 6 instead of 5) and everything worked fine. My sketch uploaded as usual. Then I connected the initial (problematic) board to my MacBook. The Mac was able to upload my sketch w/o trouble!! This probably means the Mega is o.k..

I am at a loss right now what to do, since both the Win7 machine and the problematic Mega board seem to be o.k individually, but when connecting the two, it does not work. What else can one check on the computer? The driver seems to work etc...
Any input would be greatly appreciated! Thanks much in advance!
Logged

Offline Offline
Edison Member
*
Karma: 49
Posts: 1672
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I changed one code line in my sketch
What was it and what did you change it to?

Quote
It compiles and then gets stuck indefinitely while 'uploading'
I had a weird problem like that quite a while ago. It turned out that I had a very long comment at the end of the sketch which contained all sorts of notes to myself and code fragments that I was keeping for reference. When I removed that comment the sketch uploaded with no problem.

Another shot from the hip is, do you have a lot of string constants in your code? E.g. like this:
Code:
Serial.print("Lots and lots of these?");
If so, you might have run out of SRAM and need to change statements like that to:
Code:
Serial.print(F("Lots and lots of these?"));
which puts the string in flash ram.

Pete



Logged

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

Thanks much for your quick reply. All I did was to uncomment a command that I had commented out for trouble shooting. In other words I reverted the code to a state that previously uploaded w/o trouble. Also, consider that the troubled board worked fine with my Mac and the same code, suggesting that the board and the code are actually o.k....I have a bunch of Serial.prints in there, but I did not add any before the phenomenon started. Thanks!
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a bunch of Serial.prints in there, but I did not add any before the phenomenon started. Thanks!

OSX and Win7 implement their USB stacks very differently.  It could be that you're flooding some buffer on win7.  Try programming a simple "blink" sketch to the board from the Mac, and then see if win7 works.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

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

I do not think this is the issue, since it worked with a second Mega on Win7...also the identical code worked on the troubled Mega before commenting out and in my command. Thanks for your consideration!
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are right. The best idea is to not try.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are the Mega's the same revision and same version of bootloader?
Logged

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

Point taken, James C4S smiley-wink. Blink does not work either. The two Megas are identical. Purchased at the same time from Newark. In the meantime, I was able to fix my sketch via the Mac, and then run it on the troubled Mega. The sketch involves talking to LabVIEW on my Win7 machine via USB. This works perfectly, no issues at all...It seems everybody is happy with this Mega, except the Windows Arduino 1.0 IDE. I probably should have never 'upgraded'...only headache since leaving 0022 behind!!
Logged

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

See this earlier post about changes to avrdude in 1.0:
http://arduino.cc/forum/index.php/topic,98691.msg740621.html#msg740621
Logged

Pages: [1]   Go Up
Jump to: