How can I fix an AVRdude not-in-sync error when programming Arduino via USB-to-serial cable?

I'm trying to build this Ambient lighting for PC. This worked flawlessly on my Arduino Uno. My next step was to make it using "Arduino on a breadboard". So I bought a blank ATmega328 chip and burned the Arduino bootloader (for the board "Arduino Duemilanove w/ ATmega328") onto it using the Arduino IDE and USBasp; and I know this has been loaded properly as this ATmega chip works fine on the Uno.

Then I made the USB-to-serial converter using FT232RL ; but its drivers didn't install on my PC (Windows 7 x64). I suspect I overheated the surface-mount FTDI chip and killed it while hand-soldering it.

So, I've kept it aside, and got this USB-to-serial converter bridge: (Sorry for the crappy pics) I used an additional ST232CN on my breadboard, to convert the voltage levels from RS232 to TTL, as shown in this page. And this works fine, as I verified from a loopback test. And I've connected pin 9 of ST232 to pin 2 of ATmega, and pin 10 to pin 3.

When I tried to upload a blink example from Arduino IDE, I get this error:

Binary sketch size: 1026 bytes (of a 30720 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00


When I do the verbose upload (Shift+Upload), I get this error/message:

avrdude: usbdev_open(): did not find any USB device "usb"


Also, I tried adding 1k pull-up resistors at pins 2 and 3 of ATmega, but didn't help. So I guess the problem now is in the serial communication from the ST232 to ATmega? And is there any special connection to the Reset pin of ATmega? I've pulled it up to 5V with a 10k resistor.

• A schematic and or picture of your breadboard setup would help. May 1 '12 at 6:24
• Did you reset the chip just before, at the same time as, or just after commanding the upload? Whenever I've gotten the 'not in sync' error, it was related to that relative timing. For my breadboard, and Eclipse/AVRDude, ungrounding the reset pin just before or just as I click the upload command is the right timing. But also check that your PC really does see the adapter when you plug it in. May 1 '12 at 17:42
• @potato_in_my_ear - The proper format for posting a solution is not an edit but an answer. Look below, and you'll see a box titled "Your answer" in which to enter it. After entering, people will vote on your answer, and you can 'accept' it by pressing the check mark to the left of the answer. May 1 '12 at 21:14
• @potato_in_my_ear: I'm glad that helped. You're a gentleman and a scholar - I'll make my comment an answer. May 2 '12 at 15:58
• The solution is for people to stop providing answers in comments! May 2 '12 at 16:55

Whenever I've gotten the 'not in sync' error, it was related to my just missing the reset timing (or forgetting the reset entirely!). For my breadboard, and Eclipse/AVRDude, un-grounding the reset pin just before or at the same time as I click the upload button is the right timing. But also check that your PC really does see the adapter when you plug it in.

Later arduino boards are built to reset whenever a serial connection gets made, and programmatically by the bootloader. This blog article describes how it works, and even more interestingly, how to hack it onto earlier boards. It shouldn't be too hard to put it on a breadboard if you wanted to. The chip needs to have a compatible bootloader, of course (which you've already put into yours). For breadboards, I just do the reset-button / mouse-click dance.

• I found some one saying that you can get the avr tool chain to do the reset itself by editing avrdude.conf; here (in comments). But I'm not sure how to do that. Can you help. I hate pressing reset all the time.. Nov 22 '12 at 4:47
• This will require hardware support on the Arduino board or breadboard that later Aduino's have built-in; code alone can't do it. It's based on a capacitor from the serial DTR to the reset and a reset pull-up. If you have a older one or a breadboard, you'll need to add it. This EE StackEx question and the blog article I quoted should point you in the right direction. Nov 28 '12 at 2:18

As @JRobert said in the comments, the right timing of grounding and ungrounding the reset pin on ATmega did the trick. Keep grounding the reset pin of the ATmega when you click "Upload", and just as it shows "Uploading", unground it.

• Just got an arduino mini and I knew that I needed to press the reset button to upload code, but I couldn't find out when!!! This worked for me. Thanks. Aug 16 '12 at 16:50

I had the same errors I have seen posted on several sites RE: Arduino message "avrdude: stk500_getsync(): not in sync: resp=0x00" or similar.

I found that if I remove whatever is patched into D0 ([D0]DIGITAL pin Zero, farthest away from USB and Power jacks, also reads "RX").

I tried two different computers and got same errors and found out that if: 1- I remove the wire from or open the circuit to [D0] 2- Upload to Arduino 3- re-patch the removed wire or close the open circuit to [D0]

I have only encountered that error when I upload and this is my solution. for now.

Hope it helps.

Feels good to finally give some useful info back to a community!

• Response is a bit unclear: The sentence beginning "I found that if I..." is incomplete, not sure what you are trying to say there. Please edit, thanks. Nov 1 '12 at 5:22
• This answer refers to having conflicting circuitry connected to the atmega hardware serial pins. Jul 5 '13 at 22:57

This fixed my problem, go to Drivers and Setup, replace Boards.txt in arduino IDE...

I have arduino MEGA 2560 R3 and i had the same problem

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