Is the target clock used during programming ?

Hi,
I have a few unanswered posts in the past 24 hours regarding programming an ATMega8 from a UNO using optiLoader. I am continuing to investigate the issue I am having and this may be one possibility -

Does the target chip require a clock (internal or external) in order to be programmed successfully ? My intuition is no it doesn't as the SPI interface is clocking the data in, but this suggests I am wrong -

Refer to the final section and the comments attached to the breadboard layout.

If anyone can confirm which is correct I would very much appreciate

Duane B

rcarduino.blogspot.com

Read the section of the datasheet on Serial Downloading.

"If the device is clocked by the internal Oscillator, it is no need to connect a clock source to the XTAL1 pin."

"Depending on CKSEL Fuses, a valid clock must be present. The minimum low and high periods for the serial clock (SCK) input are defined as follows:
Low: > 2 CPU clock cycles for fck < 12 MHz, 3 CPU clock cycles for fck >= 12 MHz
High: > 2 CPU clock cycles for fck < 12 MHz, 3 CPU clock cycles for fck >= 12 MHz"

Hi,

Thanks for the reply. From what I can see, the ATMega8 ships configured for an internal clock, I assume no external hardware is required to drive this, but just incase I have managed to upset the fuses in previous attempts I have tried generating a 250Khz Square wave from Timer1 on the master and using this to clock XTAL1 on the target. Still not getting anywhere though.

I will put this on hold for now and try again when I have access to a second UNO board with a clock installed to host the target.

Thanks again for the reply and if you have any suggestions that I can try with my current set up - UNO with optiLoader - to program a target ATMega8 I would be more than happy to try them.

Duane B

rcarduino.blogspot.com

ISP frequency must be at most 1/4 of the processors clock. So if you have set it up for external clock + ckdiv8, your programmer must be slower than 250kHz / 32 --> less than 8kHz.

Hi,
I have finally managed to get the boot loader onto 3 out of 6 ATMega8's using optiloader running on a UNO - with a clock supplied by a 16Mhz crystal that I bought today.

Not sure why only 3 out of 4 worked, but happy enough for now and will have another go at the other three soon.

Thanks
Duane B

DuaneB:
Not sure why only 3 out of 6 worked, but happy enough for now and will have another go at the other three soon.

I'm not sure about the ATmega8 but in the 168 and 328 models there is a fuse in the Fuse High Byte that can be set to disable serial (ISP) programming. To get around that you would need a High Voltage Parallel Programmer (like the HV Rescue Shield).

Another possibility is that some really strange clock option has been set. Perhaps someone selected "External Clock". Or possibly the 128 KHz RC oscillator. That would require an ISP speed of 64 kHz or slower but on a 16 MHz Arduino the hardware SPI speed only goes down to 125 kHz. :frowning:

Hi,
I think I probably locked myself out in a previous attempt. I know that at least once I had no common ground and on another occasion my pins were off by one. Live and learn.

Duane B

rcarduino.blogspot.com