Go Down

Topic: Is the target clock used during programming ? (Read 589 times) previous topic - next topic

DuaneB

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 -

http://arduino.cc/en/Tutorial/ArduinoISP

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


johnwasser

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"
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

DuaneB

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

Udo Klein

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.
Check out my experiments http://blog.blinkenlight.net

DuaneB

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


Go Up