Arduino Sync Error: Very Frustrated

HI, I've spent hours and hours on this problem and cannot seem to figure it out. Help would be GREATLY appreciated. THANK YOU in advance for any suggestions. I'll try to supply as much info as I can:

1) The specific error is pasted at the end of this post. Its the Verbose mode readout so I decided to post it at the end.

The basic error is: Binary sketch size: 1978 bytes (of a 32256 byte maximum) avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I've recently built my own arduino using the ARduino Uno (Atmel328 chip) from sparkfun. SInce I have built it myself, the sync error is certainly possibly a hardware problem since I am new to electronics and may have constructed it wrong. but I have done a Loopback test and serial communication works when I remove the chip from my construction. I am using the FT232RL for serial communication.

LOOPBACK TEST: Completed with no problem

MY first question is if the loopback serial test suggests that my arduino build is ok? If not is there any way to test if I constructed arduino incorrectly?

COM PORT: since serial connection works with the loopback test, I believe this suggests that I am using the correct COM port. I have also checked that the com port is the same in the arduino software as in my Device Manager. In other words, I think that selecting the correct COM port is not the issue.

OPERATING SYSTEM: I have tried this with 3 computers. One uses XP, one uses Vista, and one uses windows 7. They all have the exact same problem.

WHEN I GET THE ERROR: I get the error when I try to upload the beginner sketches like the blinking LED. Sketches were never able to upload so its not as if this suddenly happened.

BOARD: When selecting the board in the arduino software, I wasn't entirely sure which one to choose. But my Arduino is built with the following chip: ATmega328 with Arduino Optiboot(Uno). This led me to believe I should be selecting ARduino Uno as the board. I have tried other 328 board selections as well, but none work.

THOUGHTS: I think that somehow my FT232RL is not appropriated communicating with ARduino. I don't believe that this is a problem with drivers or the connection between my computer and the FT232RL. SO you know, if I remove the ATmel328 chip, I get the exact same error. This error seems to be a common problem, but I've read a number of threads and nothing I've found helps me solve the issue.

The error in verbose mode is :

Binary sketch size: 1978 bytes (of a 32256 byte maximum) C:\Documents and Settings\Owner.JULIA-696997994\My Documents\Downloads\arduino-0022\arduino-0022\hardware/tools/avr/bin/avrdude -CC:\Documents and Settings\Owner.JULIA-696997994\My Documents\Downloads\arduino-0022\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P\.\COM4 -b115200 -D -Uflash:w:C:\DOCUME~1\OWNER~1.JUL\LOCALS~1\Temp\build7004216714782504894.tmp\AnalogReadSerial.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32 Copyright (c) 2000-2005 Brian Dean,

System wide configuration file is "C:\Documents and Settings\Owner.JULIA-696997994\My Documents\Downloads\arduino-0022\arduino-0022\hardware/tools/avr/etc/avrdude.conf"

Using Port : \.\COM4 Using Programmer : stk500v1 Overriding Baud Rate : 115200 avrdude: ser_open(): setting dtr avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Recv: avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: Send: Q [51] [20] avrdude: Recv: avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done. Thank you.

What pins of the FTDI did you wire to the ATmega328's RESET?

Sorry I'm not sure what the FTDI is. However, my reset only connects to the switch at this point.

The part you bought has bootloader on it?

As you do not appear to have the FTRL's DTR pin connected to a 100nF cap to your board's reset pin to allow for software controlled reset, you need to perform a reset manually to allow sketch downloading. (see the Promini as an example )

Press & hold the reset button on your board. Start the download in the IDE. When it shows "Binary sketch size: 1978 bytes (of a 32256 byte maximum)" release the reset button. That should put the chip in the right state to be listening for the sketch downloade sequence.

Thanks for the reply. The chip i purchased supposedly came with the optiboot pleloaded. i have tried a manual reset, but was not sure when to run it, so maybe I didn't click it at the right time. I'll give it a try.


Unfortunately, trying to reset as you suggested didn't seem to work.

Most bootloaders will make D13 flash an LED in some kind of sequence/pattern. If you connect LED anode to D13, cathode to 470 ohm resistor, to Gnd, does it flash at all after a reset?

Thanks for the reply. I have D13 connected to an LED with a 220ohm resistor and there is no flash. I have a 220 ohm resistor since that was what was prescribed by the online tutorial. However, I discovered a problem with my board which is probably the entire source of the problem. I have some capacitors next to the crystal on pins 9 and 10 of the atmega. There is a typo on the instructions and instead of 22pF capacitors, I have something much larger. I noticed that when I remove those capacitors, the lights flash for a few seconds. I will try to buy the right capacitors tomorrow and see if that's the issue. I really appreciate your help so far. I can't believe I may have wasted like 15 hours on a typo.

There is a typo on the instructions and instead of 22pF capacitors, I have something much larger.

What instructions? It might be helpful to know, in case someone else uses them in the future and has a similar problem.

On this page: where it gives instructions for adding the capacitors to the crystal, it says to use a .22 pF. I understood this to mean a 0.22pF capacitor but they really mean a 22pF capacitor since that is what it states elsewhere. So either I misunderstood it or it was a typo.

The error reads as follows: Add power and GND jumpers to pin 7(VCC) and pin 8 (GND). Add the 16MHz clock crystal to pin 9 and 10 and then the two .22pF capacitors from pins 9 and 10 to GND. (See note below for alternative method).

Thanks for all the help. I'll post tomorrow if it isn't resolved or provide an update for others if it is.

So I finally got the right capacitors and the Arduino upload is having the same problem. I have noticed a difference though, when I push the button to reset my homemade arduino, the LED connected to digital pin 13 now flickers at an accelerated rate until it holds, and then the light goes out. This makes me believe that the reset is going through, but I still get the sync error.

That sounds like a properly bootloaded part now.

Hold the reset button down, start the download process. When the IDE says "downloading xxx bytes of 32xxxx" something like that, release the reset button. That should get the bootloader listending for the new download at the right time.

Hot Dog! I got it to work. I'm not precisely sure what did it but I rebuilt my arduino from scratch and it worked. For anyone encountering a similar problem. If your chip is bootloaded, and if a loopback test works, and if you have selected the right com port from arduino software, then more likely you have a problem with your board. I am 90% my problem was with my crystal and making sure that the capacitors are the right ones.

Thanks so much for all those that offered some advice!