Go Down

Topic: avrdude: stk500_getsync(): not in sync: resp=0x00 (Read 209 times) previous topic - next topic

Alex_Park

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 :
Code: [Select]

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.

Alex_Park

#1
Jul 25, 2009, 03:22 pm Last Edit: Jul 25, 2009, 03:23 pm by s2alexs2 Reason: 1
These are the picture of set up




Kitep

Quote
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 <Tools> -> <Board> 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 <Tools> -> <Serial 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!

Alex_Park

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

B_Free

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!  :)

Go Up