imtrying to upload a bootloader to a atmega328p-pu

im trying to upload a bootloader to a atmega 328p-pu using a uno the bootloader is from this webpage http://arduino.cc/en/Tutorial/ArduinoToBreadboard its the one that uses the internal 8mhz clock

the atmega328 allready has a bootloader on it which is why i think im having a problem because the bootloader uses a external 16mhz clock and there is not one connected to the 328 im trying to upload to but im not sure if it needs one just to upload the bootloader not unless as soon as it gets power it locks up because it has no external clock

the atmega328 is wired as so pin 1 to d10, 17 to d11, 18 to d12, 19 to d13, I’ve tryed it with and with out the reset of the uno connected to a 10uf capacitor how ever pin 4 on the atmega328 is connected to a led so i can upload the blenk sketch to the atmega328 so i know its working correctly

it gives this error within a second of clicking “burn bootloader”

problem.jpg

(deleted)

I thought if you upload something with the SPI interface it would be irrelevant what software may already be on the target chip?

Or is the problem that the fuses on the target chip are already set for 16Mhz?

I don't have an answer but I would like to learn.

...R

well i ordered 2x 16mhz crystals and 4x blank chips they come in on Monday

Robin2:
I thought if you upload something with the SPI interface it would be irrelevant what software may already be on the target chip?

Or is the problem that the fuses on the target chip are already set for 16Mhz?

I don't have an answer but I would like to learn.

...R

that is what im thinking but i just wonted to make sure i was not being stupid because of how new i am to this i will let you know how the new chips and crystal works out i would like to know the answer to that as well if anyone ells has any input fill free to chime in

If the chip already has the bootloader installed, chances are that it also has the fuses set for an external crystal. So you need to either add the crystal and caps, or feed a clock signal into the XTAL1 pin. There are variants of the ArduinoISP sketch that output a clock signal for this purpose.

dc42:
If the chip already has the bootloader installed, chances are that it also has the fuses set for an external crystal. So you need to either add the crystal and caps, or feed a clock signal into the XTAL1 pin. There are variants of the ArduinoISP sketch that output a clock signal for this purpose.

so are you saying that i can reset the fuses to use the internal 8mhz clock if i use a Arduino ISP sketch that output a clock signal
im new to this but i thought fuses could not be change ones set

imjeffd:
so are you saying that i can reset the fuses to use the internal 8mhz clock if i use a Arduino ISP sketch that output a clock signal

No, I am saying that even when the chip fuses are set to use a crystal oscillator, you can make the chip work by supplying an external clock to the XTAL1 pin instead of attaching a crystal. But if you want to set the fuses back to using the internal oscillator, you can do that too.

imjeffd:
im new to this but i thought fuses could not be change ones set

Yes, fuses can be changed both ways. Except that if you clear SPIEN (or also if you set RSTDISBL I think), then you can no longer program the chip via SPI, which means you can't change the fuses back unless you have the other sort of programmer (a "high voltage programmer").

dc42:

imjeffd:
so are you saying that i can reset the fuses to use the internal 8mhz clock if i use a Arduino ISP sketch that output a clock signal

No, I am saying that even when the chip fuses are set to use a crystal oscillator, you can make the chip work by supplying an external clock to the XTAL1 pin instead of attaching a crystal. But if you want to set the fuses back to using the internal oscillator, you can do that too.

imjeffd:
im new to this but i thought fuses could not be change ones set

Yes, fuses can be changed both ways. Except that if you clear SPIEN (or also if you set RSTDISBL I think), then you can no longer program the chip via SPI, which means you can't change the fuses back unless you have the other sort of programmer (a "high voltage programmer").

thanks i will look into how to change the fuses to use the internal oscillator
i found this tutorial http://www.digitalstateone.net/2012/07/program-atmega328-standalone-with.html
that may help me
what i dont get is that when i go to burn the bootloader it dose not set the fuses for me doesn't need to do that anyway if im burning a blank chip

thanks that is a really helpful tutorial i will give it a try in the morning

it worked thanks it was because the fuses were set to the external clock