trying to upload the bootloader to an ATMEGA328=P-PU

Hi!! I'm trying to burn the bootloader to an ATMEGA328 just like http://arduino.cc/en/Tutorial/ArduinoToBreadboard says it can be done on a breadboard.

I'm working on win XP and have tried with the Arduino software.

What I have done is to open the ARDUINOISP sketch, uploaded it to my duemilanove board also with an ATMEGA328, wired it just like the picture says to my bread board, added the crystal and capacitors, selected the propper com port and nothing... only appears the following error:

Error while uploading bootloader.

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

I have also tried with the second method which don`t use the crystal and the capacitors of 22pF adding the boards notepad to get the option to upload it with the internal oscillator. I added also the 3 LEDs that the code says and the heartbeat works fine, when I trie to upload the bootloader the Programming LED blinks and quickly pass to the error LED blinking. Any ideas???

I would appreciate very much some information and if you could say me if it's better to go to the Arduino UNO board instead of suffering trying to get more ATMEGA328 with bootloader installed.

When I did exactly what you are attempting to do, I had to add a 120 ohm resistor between +5 and the RESET pin on the Duemilenove in order to get it to work. I have seen others use a resistor of 100 ohms or 150 ohms. I used the xtal with 22pf caps.
Give it a try.

You should disable the auto-reset function existing Arduino put a 10uF capacitor between reset pin of Arduino duemilanove and ground. Be careful about polarity of capacitor (+) should be on reset pin (-) should be on ground.

You need to disable the auto reset using one of the methods given in the 2 previous replies (the 10uF capacitor solution worked for my Uno). If the device has never been programmed before, it will default to using the 8MHz internal oscillator prescaled to 1MHz, so you don’t need the crystal and caps at first. Once the bootloader is installed, you do need them, because installing the bootloader also sets up the fuse bytes to use a crystal.

Not working. Tried with resistors of 100 and 150 each time, the capacitor of 10uF. Even I tried changing the boards.txt to 20 MHz and 1 MHz to see if the oscillator was preconfigured to that speed.

Take a picture and put it on here. There may be something wrong with your setup.

Here is the picture.

The steps that I’m following are:

opened arduinoISP sketch example
selected PORT
selected board Duemilanove
upload sketch arduino ISP
wired just like the picture (tried with a res of 100 and 150 ohms from the reset pin of duemilanove to 5V and also tried with the cap of 10uF from reset to ground same to the duemilanove)
tools>burn bootloader>with arduino as ISP
and error =(

I've been having the exact same problem using the MEGA 2560. I've tried everything mentioned here as well as using the .pde found here:

http://code.google.com/p/mega-isp/

They suggest disabling the bootloader. This is not an option for me. The entire point of this was to not have to buy an AVR programmer. I don't want to get rid of the bootloader on my MEGA.

Please help!

Then "not in sync" message sounds to me that it is not a problem with your wiring, it is a mismatch between the baud rate that the Arduino ISP sketch is using and the baud rate that the PC is trying to use, or something similar.

You might need to press the reset button and then wait a few seconds before trying to burn the bootloader - I think I had to do that sometimes when using the ArduinoISP sketch.

OK I reset then waited a while. No luck. I've also edited the programmers.txt to match the baud rate in the boards.txt file. By that I mean I set them both to 19200 and then to 57600 with no luck.