I cannot seem to upload sketches to my Duemilanov.
On Ubuntu, the arduino terminal displays: avrdud: stk500_recv(): programmer is not responding
On Windows: avrdude: avrdude: stk500_getsync(): not in sync: resp=0x00
Tried reburning the bootloader:
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc
.
When I attempt to upload a new sketch, the Arduino RX/TX lights do not do anything. The "L" LED blinks once and that is all. While the IDE is "uploading" the new sketch, the Arduino begins running the previously loaded sketch as if completely ignoring the new data.
Sometimes the IDE will get stuck "uploading" and the TX light on the board will blink indefinitely.
When I first plug the board in to my PC, the "L" LED blinks 7 times after TX/RX blink a few times.
The most strange thing I have figured out is that if I completely unplug all of the data lines that are connected to the board it works fine. I am able to upload without a problem so long as nothing is plugged into the board (not even a 5V, GND, or digital pin).
I tried this and it works fine: http://forum.arduino.cc/index.php?topic=73748.0
Any suggestions? I was literally just using it without a problem 24 hours ago.
Arduino 1.0.5
Duemilanov
Best Answer
You mention that you are running the the AVR 5v and GND line to the breadboard, if your circuit is drawing more than a little bit of current (powering amplifiers and other active elements) you should use a separate regulator, dips in Vcc, especially at power up, when the bootloader is trying to write the flash, can prevent the read/write operation from completing fully with the application section getting corrupt (not properly written sketch) or the avr loading/executing the wrong instruction from the bootloader (preventing application write). If your data lines are being used to source significant current (multiple LED's) you should also reconsider your circuit layout for the same reason. Since the bootloader is working properly when disconnected from the breadboard, and you've already excluded other problems like the tx/rx line being interfered with by outside devices (by connecting something to pin0) and random resets.
In the atmega datasheet (page 278) there is a buried section that states
In the worst case this can result in the bootloader flash section getting corrupt.