I am new to the Arduino world but I have some practice with the Atmega outside Arduino.

I am running Windows XP and Arduino 0022.

Lately, I bought an Atmega328 on eBay with Duemilanove bootloader already flashed.

I put it on a breadboard with a 16 MHz crystal and its two capacitors, a reset button to GND (with 10k pull-up resistor), a led on digital pin 13 and a "USB to TTL converter" bought for less than $5 on eBay.

The TTL converter gives me the Rx and Tx signals for digital pins 0 and 1, as well as +5V and GND from USB.

On powering the system, the led 13 was already flashing, showing that the blink sketch was already loaded.

I tried to change the timing of the delay within the program and load it to the atmega. I new that I had to push the reset button before uploading the program. The first try was a success and the led started flashing at a different rate.

But for the next few tries, I got an error : avrdude: stk500_getsync(): not in sync: resp=0x00

As the uploading worked fine at the first try, I was sure the wiring of the breadboard was correct, so I started reading the "Troubleshooting page" and the forum threads commenting that error. I realized it is not rare, even with official boards with auto-reset feature.

I finally found what was the origin of the failure : the timing of the Reset (which is not clearly explained in the Troubleshooting Page).

The reset button has to be pressed before clicking on the upload button and released as soon as the "Binary sketch size: ....." message appears.

Unfortunately, the method I explained 3 days ago didn't last very long.

Since yesterday, I am unable to upload the program through the USB_to_TTL adapter, although I'm not conscious having changed anything to the breadboard or to the parameters of the IDE. The last program (blinking led) keeps running.

Of course, I press the reset button BEFORE uploading and I release it AS SOON AS the message appears. The led stops blinking when reset is pressed and starts again as soon as I release the button (showing that the button is OK). The following message comes about 20 seconds after having released the button:

As your serial adapter doesn't provide the reset signal, you might want to use a different bootloader. I think the optiboot times out rather quickly, so pressing reset and so on can be very tricky!

I think the "old" bootloaders can be adjusted with MAX_TIME_COUNT (see the makefile) to wait longer for incoming data.

• Upload doesn't work? Do a loop-back test.• There's absolutely NO excuse for not having an ISP!• Your AVR needs a brain surgery? Use the online FUSE calculator.• My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...• Microsoft is not the answer. It is the question, and the answer is NO!

Perhaps it has something to do with the fact that Studio 4 is installed with the Jungo USB driver. WinAVR User Manual says that LibUSB-Win32 (which is linked to avrdude) and Jungo (which is installed with Studio 4) are incompatible.

Should I de-install Jungo and replace it by LinUSB-Win32 ? A bit annoying to de-install and re-install the driver.

The best advice I can give is: get a real programming adapter (usbtiny, or similar). Especially if you're building custom boards yourself. The bootloader is a nice thing, if it works. More than often this mechanism doesn't work for various reasons. Sometimes it is a missing/bad capacitor, an unsuitable usb adapter, OS strangeness... A programmer will be worth the 20-30 bucks it costs, it will be your parachute when the 'airplane' goes down.

• Upload doesn't work? Do a loop-back test.• There's absolutely NO excuse for not having an ISP!• Your AVR needs a brain surgery? Use the online FUSE calculator.• My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...• Microsoft is not the answer. It is the question, and the answer is NO!

avrdude: Expected signature for ATMEGA328P is 1E 95 0F Double check chip, or use -F to override this check.

This comes from the fact that avrdude only knows atmega328P and that the signature of atmega328 is 1E 95 14.

Hopefully, I found a very interesting post in the forum :http://arduino.cc/forum/index.php/topic,58670.0.htmlexplaining how to solve this problem by temporarily changing the signature within the avrdude configuration file.

I found the avrdude.con file here : [arduino]\hardware\tools\avr\etc\So I replaced the signature with that of atmega328.

New try to burn the bootloader. This time, the led13 was flickering but the process ended with a new error:

I ignore the real signification of this message but I think I read somewhere in the forum not to pay attention to it.

So I put the avrdude.con back in its original state and … marvellous ! I could again upload a sketch by using the USB to USART converter and the bootloader, exactly as I explained in the first post of this thread.

I then re-installed Studio 4 + the SP3 update and the Jungo driver was there again. I was thus able to verify the signature, the fuses and the lockbits : exactly as they where when I received the atmega.

So, I think the problem was that, for some unknown reason, the bootloader was corrupted and unable to upload the code into the flash memory. The solution was here to re-burn the same bootloader. I think I could have done it from Studio though avrisp mkII by manipulating myself the fuses, burning the bootloader, then resetting the fuses. That will be for the next wreckage !

To Grumps : don't be desperate, let it to "some" house wifes (sorry for the bad joke. I really don't have anything against the house wifes) . Microcontrollers , AVR and Arduinos are a fantastic world, but not as easy as it is told. Higher the challenge, higher the satisfaction. I don't know if that expression exists in English (I speak French) but if it doesn't, it ought to be invented.

To Madworm : I agree with you. A good programmer is quite useful, if not absolutely necessary. I have no complain about my avrisp mkII , even if I soldered it myself from a cheap kit.

I ignore the real signification of this message but I think I read somewhere in the forum not to pay attention to it.

From Studio 4 through the avrisp mkII programmer, I made a verification of the bootloader (ATmegaBOOT_168_atmega328.hex). There was no error at all. So I suppose the error after flashing the bootloader was not real but had something to do with the trick of the signature.