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.
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.
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.
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 !
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 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.
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. :-?
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........
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.