[Error] Classic protocol error, PARTLY SOLVED !!!

Hi all,

I'm having problems with my Duemilanove. It just won't respond. Let me explain as thorough as i can.

The Duemilanove is not even a week old and i have uploaded a few sketches, mostly simpel 'Knight Rider' stuff. Nothing hard, difficult or weird. About 2 days ago i tried to upload an edited version (changed the delay time) of the code that had worked perfectly untill then, and the sketch already had worked with the same changes before. It went tits up during that upload. The L-led started to blink realy fast and stayed that way ever since. I received an upload error. Every time, when i connect the board to the computer the L-led starts to blink imediately and doesnt stop. When i supply the board with an external powersource the L-led starts to blink imediately and doesnt stop. The power led is on. The board does not execute any sketch, not even the last uploaded one.

Now, i have spent 2 days roaming the internet in search of a solution or a cause of the error. Nothing, i mean absolutely nothing has come out or has worked.

Here is what i have tried so far: ? Checked COM port in IDE ? Checked board-settings in IDE ? Checked USB drivers ? Re-installed every driver, multiple times ? Changed baud-rates ? RTS on close ? Resetting the board, multiple times before, during and after upload ? Plug & unplug in several different ways ? Burn new bootloader ? Tried on other computers, windows aswel as Linux ? Tried with and without stuff connected to the board ? Hell, i even started talking to the board...

Absolutely nothing worked. I have found topics like this that were years old, topics that were recently posted and they all have one thing in common: none of the provided solutions worked for me.

Here is the error:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Here is the sketch:

void setup(){
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}

void loop(){
digitalWrite(3, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
}

Here is a video of the sketch working: http://www.youtube.com/watch?v=-kGlvQEQqac

Here is the scheme:

Here is my IDE and OS: Windows XP Professional SP3 Its a stand-alone PC with no connections to external machines. There is only Windows + SP's installed. All hardware and software is properly installed

Arduino 0017 Latest FTDI software/drivers directly from their website. FTDI drivers that came with the Arduino IDE.

Here is y Arduino: Arduino Duemilanove w/ATmega328(p)

So, i have tried to be as thorought as possible, but if there still is information you would like to know, just ask. Is there anyone alive who can help me to get my board working properly again ?

One final option remains, in my opinion: Buying a pre-loaded ATmega328 and replacing the one on the Duemilanove, because it seems that the bootloader is looping/hanging...

Tried on other computers, windows aswel as Linux

Absolutely nothing worked

So it will not work on another computer?
And different USB lead.

Have you tried pressing the reset button when the application says “Uploading to board” ?
It could be your automatic reset circuit is not working.

So it will not work on another computer? And different USB lead.

I've tried it on 3 different machines and all USB cables i have around. No succes.

Have you tried pressing the reset button when the application says "Uploading to board" ?

I've tried pressing the reset button, before, during and after the 'upload message'. Even tried at different intervals, different sequences of pressing, different timings, pressing hard and softly (lol). No succes.

It could be your automatic reset circuit is not working.

How would i know if it is ? Or how would i fix it ?

It seems that, no matter how i connect the board, once the board has a power supply it goes into this 'loop' and will not come out of it.

1) op: Good job on the homework! Did you say you had re-burned the bootloader?

2) 'mike: wasn't there something like this wgere someone had overwritten an interrupt vector?

1) op: Good job on the homework! Did you say you had re-burned the bootloader?

Thanks for the compliment. And no, i never succeeded in burning a new bootloader. The board doesnt respond at all via USB and i do not have a parallel programmer.

wasn't there something like this wgere someone had overwritten an interrupt vector?

I think that was a case of setting the watchdog timer too fast for the bootloader to down load a new sketch.

If the automatic reset circuit is not working you would know as the manual hitting of the reset would have worked.

It looks like something has screwed the bootloader, that would be the next thing to try. It is probably easier to get new chip with it burned in already.

I think that is the most logical solution to my problem. There are no dutch webshops that sell preloaded ATmega328's, as far as i could find...(yes, im from The Netherlands)

Do you know of any webshops that sell' em and will ship them abroad, at decent prices ? (can i just buy any ATmega328, or is here something to keep in mind?)

UPDATE

Finally i managed to get the much wanted "Done uploading" message !!!

Here is what i did. After pressing the reset-button in every thinkable way, sequence, timing and form..hell i even tried it standing upside down...this is what did the trick:

I unplugged the board from the power source (USB only). On the unplugged board i pressed the reset-button and kept pressing it. Plug the board back in again (USB only) I compiled the sketch and hit CTRL-U, while still holding down the reset-button. Once the RX-led blinks once (very fast) i let go of the reset-button, resulting in a completed and succesful upload. The sketch is performed without problems...

I am a bit concerned about uploading a new sketch though...ill give a heads up in this topic once i tried that...

UPDATE

Yes, it does accept new sketches (uploads) without the need of repeating the press-and-hold-the-reset-button-action...

it works like a charm again...

I unplugged the board from the power source (USB only). On the unplugged board i pressed the reset-button and kept pressing it. I compiled the sketch and hit CTRL-U, while still holding down the reset-button. Once the RX-led blinks once (very fast) i let go of the reset-button, resulting in a completed and succesful upload. The sketch is performed without problems...

How does an LED flash on an unpowered board?

How does an LED flash on an unpowered board?

Oops.. :-[..i missed a ' step' i updated the post above with 'pluggin the board back in again'...

Thanks for the notice..

has anyone else besides the original poster been able to get this to work? i'm having a hell of a time uploading a sketch to a Arduino Nano from a Macbook Pro running Snow Leopard. Getting the same error...

when i attempt your method I do not get any different results, although you mention letting go of the reset button when seeing one quick blink, where I get three blinks, never just one...

when seeing one quick blink, where I get three blinks, never just one...

Yup, there are three in a row, but right after the first you should let go the button...or at least try to...

Were your TX, RX led' blinking dim? mine doesn't blink led (pin 13) it is just frozen state. i realized the blinking occurs when baud rate is 56k.

I unplugged the board from the power source (USB only).
On the unplugged board i pressed the reset-button and kept pressing it.
Plug the board back in again (USB only)
I compiled the sketch and hit CTRL-U, while still holding down the reset-button.
Once the RX-led blinks once (very fast) i let go of the reset-button, resulting in a completed and succesful upload. The sketch is performed without problems…

This suggestion worked perfectly for me. Oddly enough, I was also doing a ‘Knight Rider’ type sketch, which involved a couple short delays (200ms) and I ran into the same problem (L LED blinking very quickly, and nonstop.) I came across your suggestion and sure enough it worked.

But then it happened again. And again. So it looks like as long as I don’t try the sketch I was using that initially caused the problem, then everything is fine. I’ll post the sketch if anyone wants to see it, it’s based in part on the included barGraph sketch that came with the software. I’m new to this so it’s dead simple, but I don’t understand what part of it could cause this to happen. Any further insight would be greatly appreciated.

const int ledCount = 5; 
int ledPins[] = { 2, 3, 4, 5, 6, };   
void setup() {
  // loop over the pin array and set them all to output:
  for (int thisLed = 0; thisLed < ledCount; thisLed++) {
    pinMode(ledPins[thisLed], OUTPUT); 
  }
}
void loop() {
  for(int thisLED=0;thisLED<ledCount;thisLED++)
  {
      digitalWrite(ledPins[thisLED], HIGH);    
      digitalWrite(ledPins[(thisLED+1)], LOW); 
      digitalWrite(ledPins[(thisLED-1)], LOW);
      delay(200); 
   }   
   for(int thisLED=ledCount;thisLED>=0;thisLED--)
  {
    digitalWrite(ledPins[thisLED], HIGH);
    digitalWrite(ledPins[(thisLED+1)], LOW); 
    digitalWrite(ledPins[(thisLED-1)], LOW);
    delay(200); 
    digitalWrite(ledPins[thisLED], LOW);    
  }     
}
      digitalWrite(ledPins[(thisLED+1)], LOW);
      digitalWrite(ledPins[(thisLED-1)], LOW);

The variable thisLED ranges from 0 to 4. thisLED+1 then ranges from 1 to 5, and thisLED-1 ranges from -1 to 3. -1 and 5 are not valid indices. Hard to say what happens when you call digitalWrite with an invalid pin number.

I just kind of threw this together and did not even notice that. Thanks so much for pointing that out, I’ll have to give it another try with this corrected.