avrdude: stk500_getsync(): not in sync: resp=0x00

Hello I am totaly new to Arduino, and I was trying to upload the code I have written.

I am not really experienced at this stuff and I had this problem.

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

The code is as follow :

int output[] = {13,12,11,10,9};
int input = 7;
int button;
int n=5;
int pre = LOW;
int state = HIGH;
int z = 0;
int x = 0;
int y =1;

void setup(){
  for(int i=0;i<n;i++)
    pinMode(output[i],OUTPUT);
  pinMode(input,INPUT);
}

void loop(){
  button = digitalRead(input);
  if(button == HIGH && pre == LOW){
    if(state == HIGH){
      state == LOW;
      x = n - 1;
      y = -1;
    }

    else
    {
      x = 0;
      y = 1;
        state == HIGH;
    }
  }
  while(1){
        digitalWrite(output[x],HIGH);
        delay(100);
        digitalWrite(output[x],LOW);
        x += y;
        z++;
        if(z == n){
           z = 0;
           break;
        }
  }
  pre = button;
}

Can anyone give me any advise on where I have gone wrong, what I should do to improve it, and if what I am doing can damage my board.

Thank you very much.

These are the picture of set up

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

This error is what happens when your computer isn’t communicating with the Arduino. It has nothing to do with whether your code is right or wrong.

The most common cause of this error (IMO) used to be people choosing the Duemilanove 128 when they had the newer Duemilanove 328. Click on → and make sure you have the right board chosen, and try again.

You can also check to see if your using the correct COM port →

Obviously, make sure your USB cable is plugged in, both to the computer and the Arduino.

Download the current drivers.

If it works, great. If it doesn’t, post again and let us know which Arduino and what OS you’re using.

Good luck!

I have checked the version of Arduino It says (Arduino Duemilanove) on the front and S 1681 on the back

So I believe it is TMega 168

Well I have tried the other one anyway

Also I checked the port from device manager, which is com 4 (I have set it to com4.

And I am using Vista-32.

It worked fine before..

but it is not working anymore...

At first it worked great then it started getting this problem.

Can anyone help me please

I got that same error code you did. What worked for me was pressing the reset button on the arduino just before I clicked to upload my code onto it.

If that doesn't work, try doing a forum search for parts of that error message. I believe I've seen other threads that talk about that too.

Hope this helps! Cheers! :)

I sorted the problem.

Just for those who still have the same problem I will post how I did it.

Well first off you have to disconnect all cables and pins.

Then close the programming progam and run it again (with cables connected)

If that does not work

Try changing your board. (when you do this you have to disconnect and re-run)

or check what port is adruino connected to.

if non of them works try compiling your program code

or press reset button as B_Free said.

Hi ! I have the same problem. I'm using :

  • Arduino diecimila
  • Windows XP

I suddenly got the "avrdude : stk500_getsync():not in sync: resp=0x00 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51"while programming with an accelerometer, and some sound variations on PWM. Now I can't upload anything to my board, even after turning everything off, and disconnecting. The led on pin 13 blinks when reset, and blinks all the time if I try to upload something. I also checked the serial port on the computer, which name is under 10 (COM4), and works correctly. I tried on several computers, and it still the same.

Could you help me ? Thank you !

It used to work and now doesn't? May be a bootloader problem. I don't know much about it, but if you search the boards you find a bit of info.

Yes, it used to work. Now, I burned the bootloader and I got

"avrdude: verification error, first mismatch at byte 0x3800

0x0c != 0xff

avrdude: verification error; content mismatch"
I couldn’t reburn, I got things like “avrdude: AVR device not responding
avrdude: initialization failed, rc=-1”, so I supposed the chip had died. Then I replaced the ATMega 168 by an AtMega8, and I got again the same message. Then I put a second AtMega8 and it worked.

Now I can keep working, with the atMega8, but I would really like to understand what happened… Two dead microchips, it’s a little bit hard ! :’(

Hehe, I got that once by being stupid and feeding 12V into a digital pin. Surprisingly, I only fried the chip and not the entire board.

Hi Alex _Park

you are missing the current limiting resistors between the output pins of the Arduino and the LEDs. Without them you will always blow your ATMega!

Use a resistor value of 1000 Ohm to protect your ATMega.

MikeT

I get the same error when trying to upload, all of a sudden. Everything worked fine, no upgrades or updates done on the Arduino or software since last used. But I also get a different error message when trying to upload with my mac, “programmer not found”

I too have this same issue.

Arduino-0016 on Debian-Lenny(32bit) and windows xp.

Arduino Diecimila with the atmega-168

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

1

Figured it out. There's 2 options for the diecimila in 0016. One for atmega168 and one for the 328

Hey!! I had the same problem and I could fix it. ;)

I was testing a program with I2C and a 7 seg display, everything worked fine for a lot of times but sudenly the known problem "avrdude...." appeared when trying to upload an sketch. When I start up the arduino some blinks in the Comm. leds and then the Led in 13 began blinking very fast. After releasing the reset button the led-13 began blinking very fast inmediately. The last program loaded was not working.

Solution: Unplug the USB, press the Upload tool, just when the "Binary sketch size: xxx bytes (of ..." msg appears I connect the USB plug. The new program is loaded successfuly.

Good luck...

Thanx to those that posted previously. Im a newbie. I just set everything up for the first time and ran the example program "Blink".

Led flashed for 1/2 sec on about 3 secs off. Also got these error messages

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

tried suggestions in the previous posts and found that I had the wrong com port selected. Sorted that out, shut down 0017 and restarted it, uploaded to the chip and it now works as it should. Im using Windows XP, Haceduino Atmega168-20PU.

I just had the same error pop-up too, and the OP's solution worked for me.

For the sake of Google helping another newbie: I'm using a MacBook Pro MBP running Snow Leopard. I connected my ATMEGA 328 via USB.

I got the avrdude: stk500_getsync(): not in sync error while uploading a sketch to the Duemilanove.

The fix was to Quit the Arduino IDE; unplug everything from the Duemilanove (protoboard, usb, power, etc.); plug in the USB cable between the laptop and the Duemilanove; and re-upload the sketch.

I then unpowered the Duemilanove, re-patched my circuits/jumpers/what-not, and I'm running happily.

I need to go back to the troubleshooting and getting started material here and review the most optimal procedure for keep the Duemilanove safe while moving between sketched and hardware set-ups. Perhaps I got ahead of myself earlier, while I was experiencing the error.

I'm wondering it would have been sufficient to just shutdown the Ardunio IDE and re-plug the USB cable (at the laptop end) to give the USB machinery a chance to get straightened out. Hmmm. :-?

(Update: Corrected Duemilanove spelling)

I was having the same problem. In my case it turned out to be communication was going to the wrong port.

In the Arduino environment, go to Tools, then Serial Port and made sure the correct COM port is selected. It should match the port that the computer has assigned to the board (which you can find by control panel > system > hardware > device manager>ports) - it is USB Serial Port

few days ago i was testing my programing skills with arduino, windows xp 32, arduino s3v3 with armega328 and arduino IDE 0017.

i got the avrdude error.......... this happened after making a lot of successfull uploads.........

i searched, googled. looked everywhere, tried everything. nothing worked..... then i made myself a parallel programer (without the resistors, i was in a hurry) changed my computer, (my new one does not have parallel port), and burned the bootloader to the chip..... it worked very good, the same day ordered another s3v3 with an extra atmega328 chip........ and again burned the new chip with the bootloader........ cero problems.......

if you want, after making all the testing you see on the forums, if nothing works, do as i did........ also recomended to have a spare burned chip, just in case........

AHA!

I have worked my version of this problem a bit further and I have uncovered what seems to be the root-cause of my problem.

My sketch & hardware set-up uses digital pins 0-5 to connect a Jimmie P Rodger's Open Heart LED kit. http://www.jimmieprodgers.com/openheart

Whenever I attempt to upload a sketch while the kit is connected to my Duemilanove, I get some transmission problems. I believe this is due to the digital pin 0 & 1 being re-purposed as TX and RX pins during the upload process.

The fix: I adjusted things so that I am not using pin 0 & 1 any longer (I shifted things to use pins 2-7), and that was cured my communication problem.

I can now upload sketch adjustments over & over without any problems, unplugging, re-starts or otherwise.

The following thread mentions this problem. It mentions that use of the USB and soft serial facility precludes the use of pin 0 & 1: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238095159