Problem programming a standalone ATMega328

Hi!

Im trying to programm a standalone ATMega328 on a breadboard but I get this message:

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

Wiring:

  • swapped allready the TX/RX pins to TX/RX and RX/TX both not working same error
  • Chip purchased with bootloader
  • While reset the LED on pin 13 blinks so no power problem
  • Before upload I do a reset on the chip
  • In the IDE I choose the UNO as board
  • The USB board works because I tested it with an Arduino Mini

What Im doing wrong?

Thanks for help!

  1. What frequency crystal are you using, and was the mcu you purchased already configured to use the crystal as well as having the bootloader installed?

  2. I think the timing between doing the reset and the upload starting may be very critical - once the LED is blinking, the bootloader has timed out and the received data will be ignored. If you change the preferences file to display verbose output when uploading, you can see when the data starts to be sent.

  3. Shouldn't there be a ground wire between the USB board and the rest of the circuit?

try to power your atmega from the usb while your programming , or as dc42 said at least your atmega and usb adapter should have the same ground

also you selected the arduino uno in your boards but was the atmega burned with the optiboot bootloader ?

Thanks!
I connected GND to the USB Board and made the chip reset
in another timing. I pressed reset -before- I started the upload.
Now I press reset -after- starting the upload, when the
upload/Sketch size is displayed in the IDE.

The timeframe is very short where the bootloader excepts
new data, right?

Works now! Thanks!

To make the auto reset feature on while uploading make a connection between reset pin of atmega328 and DTR (number 4 at bottom on image) pin of FTDI board. Then you do not need to push reset button.

youll need to add a 100n cap between the DTR and the reset pin to get the auto reset to work