Crashed Upload

Hi there, this is my first Arduino board. I got the Arduino Duemilanove and just played round a bit. It all went fine until I made a small mistake: I made a typo and tried to access a pin with a negative number... sth like

int pin = -8; digitalWrite(pin, HIGH); delay(100); digitalWrite(pin, LOW); delay(100);

and well... since then my L 13 LED goes crazy. When I try to upload a new program I get this nice message:

avrdude: ser_open(): setting dtr avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Recv: avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: Send: Q [51] [20] avrdude: Recv: avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done. Thank you.

Yep, I googled this error, searched the forum, read all posts and articles on this which I could find. But well, it didn't help.

So now I ask you, is there any way I could reset the Arduino board to factory defaults? Or any other suggestions?

Thank you very much!


Let me first say that the sketch you wrote should not harm the Arduino in any way. It is something else you did.

Were you playing with programming the bootloader? The LED flashes whenever the Arduino is reset and the bootloader gets control for about 1 second.

You could try the procedure in this thread whereby you press the reset button to start the download.

Try picking your board in the options again, and verify serial port is still set right.

IIRC, a month or so ago, I noticed this error (I think) when I had an ATMega328 and the IDE was set for the ATMega168

i had a similar ussue, i disconnected everything from the board, nd it worked, i dont know if it was just luck or...


thank you for your answers.

I just tried the "Blink" example and modified it a bit. (Added more LEDs and so on) I didn't try to modify the bootloader in any way.

The correct Chip and COM-Port is selected. Even in the preferences.txt everything seems to be correct.

I tried the procedure from that other thread about 20times now - without success. At that moment when I release the reset button the LED starts blinking like hell for about a minute. Then it stops.

And I disconnected everything. Even tried to reboot Windows several times, tried different USB-Ports...

Is it possible that I damaged the bootloader somehow?? Maybe by uploading two sketches when the first upload was not ready or sth like that?

Is there any possibility to look in the chips RAM? (Without buying extra hardware?)

Thank you!! hex

I would contact the supplier of the Arduino and see if they can send you a replacement. Assuming you didn't do any permanent harm to the hardware and it is just a bootloader issue, then they should be fine with this.

I don't think reading the RAM is going to help you. You need to either read the flash or better yet, simply reflash the Arduino. There are some fairly cheap AVR programmers that you could build or you could buy one.

if you want reprogram the botloader, theres also the bitbang mode, you dont need any other programers, all you need is the arduino, a cable, and a software, google it, you'll find it!

Thanx again.

I thought about "reflashing" it but I guess I'll just buy a new flashed ATmega328 (it just costs ~ 4?) and flash the old one some time later...


If someone has other thoughts, I'm still open to any better idea...

regards, hex