Serial Problem with Atmega8 on bread board

I have a known working Atmega8 and I put it on a bread board and it work fine. I have a 16MHZ crystal and I wired in a LED to the digital out 13 pin and that works fine. Then I wired in a USB to serial adapter from SparkFun, ran TX to Rx and Rx to TX and put a .1uf reset cap from pin 1 of the reset line (pin 1) to the DTR of the USB to serial device.

Now, Windows recognizes the USB Com port as Com8 as does the Arduino IDE. I select Com8 and the correct board which is Arduino NG with Atmega8, load the blink command and change the digital out pin from 13 to 12 and then upload it.

I get this error:

Binary sketch size: 318 bytes (of a 7168 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

It works fine in the Arduino board itself, but not on the bread board. I thought maybe it was the serial device so I set it up for a loopback test and enter data in the serial port monitor and hit send and recieved back exactly what I sent it.

I am at a loss as to why I am unable to upload anything. I even tried changing baud rates both in the boards.txt file and in device manager, but get the same error.

I even just tried uploading the basic file and still no luck. The led on digital out 13 flashes rapidly for a second maybe and the TX led on the usb to serial device flashes for a bit and then stops. The RX led never does anything.

Anyone have any ideas? Is there any kind of serial protocol anaylyzer I can use with a usb to serial device to see what information is being sent and what is received back while the Arduino IDE is uploading?

Okay, now I am really confused. I put the chip back into my Arduino NG and get the same failure. So, I put my Atmega328 in and guess what, the same failure. The Atmega328 used to work just a few days ago. I don't know what is going on. Maybe I need to reinstall the software or the USB drivers though it is weird that in a loopback condition the USB to RS232 device seems to work fine. I guess I might have to go to an external programmer like I do with PICs. This is really frustrating.

Yahoo! I finally got my problem resolved. Somehow the bootloader got messed up I guess. Anyway I tried using USBTinyISP to upload the hex file. I never could get it to upload using avrdude in command line as I would get an invalid file format for some reason.

But it did erase the chip as part of the process so I went back to the Arduino IDE and reloaded the bootloader and what do you know, it works now both in the Arduino and on the breadboard.

:slight_smile: