Changing clock source in AVR?

Apr 10, 2006 11 Replies

First reply

Meindert Sprang

it It IS the case. the only way to get the AVR talking to the programmer is to apply a clock from an external source to the AVR. Meindert

Read the full reply

I have a Olimex devboard AVR-P28B with a ATMEGA8 on it. I programmed and used it just fine when it was running on the internal RC oscillator. But I wanted to try to get it working on the 4Mhz crystal so I set the fuse bits and wrote those. Problem is, now it doesn't work anymore and I can't get it to respond and change the fuse bits.



How can I program the fuse bits in this situation? I assumed that the programming interface always runs off the RC-clock otherwise a wrong write could render the device useless but I think that's not the case.



LV


*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from
formatting link
***

it

It IS the case. the only way to get the AVR talking to the programmer is to apply a clock from an external source to the AVR.

Meindert

external clock means a HCMOS signal, not a crystal. The fuses are written as zeroes, not as ones.

Rene

Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net

High Voltage Parallel Programming with an STK500 always works.

Mit freundlichen Grüßen

Frank-Christian Krügel

I

bits

it

write

I'm using STK200. Does that mean I'm fried or should that work too?

*** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account from
formatting link
***

I

bits

write

to

Weird. Any ideas why it isn't working then? I'm using YAAP and an Olimex parallel port programmer. I also tried programming it using AVRDUDE but that didn't work either.

*** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account from
formatting link
***

The ATMEGA8 reset pin can be programmed to be a normal I/O pin. Once you have done that, I do not think there is any way to program it again. (Ponyprog used to have a bug where if one read the ATMEGA8 fuses, and wrote the same values back, the reset pin was set to I/O. I lost a couple of devices before realising it)

Regards Anton Erasmus

I

bits

it

write

I just messed around with the fuses. I'm pretty sure I didn't set the reset pin to a I/O.

BTW I can see data going over the MOSI and MISO lines on my scope yet the programming software (YAAP en AVRDUDE) says there's no device at the other end!

*** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account from
formatting link
***

You're fried. Only the STK500 can do HVPP. This doesn't work through SPI, but through the regular port pins, which change functions when pulling /RST to +12V. The STK500 has sockets for this.

Mit freundlichen Grüßen

Frank-Christian Krügel

/RST

On the Olimex forum I read that I need to apply a clock (or square wave) to the XTAL1 input to get the thing going. Otherwise I'll need a HVPP programmer (such as Atmel's STK500 Starter Kit) to program the device.

However, I also remember that setting the 'Startup time' to 'fast' and I wonder if that could be the problem since I can't understand that me setting the oscillator to external crystal will hang the device that's not logical.

Why didn't Atmel just let the ISP interface *always* run off the internal oscillilator, thereby elliminating these problems?

*** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account from
formatting link
***

you set the wrong fuse. You will need a external function generator or something like that to run the pins directly.

Because this wouldn't rule out other user errors. Example: Some devices allow to switch /reset to a normale port pin, disabling ISP programming. There is even a fuse for disabling ISP completely, which cannot be set by ISP itself, but through user software.

It's not Atmel's fault if users buy unsuitable tools just for saving some $$$/¤¤¤/¥¥¥/£££. Remember: HVPP always work no matter how the fuses are set.

Mit freundlichen Grüßen

Frank-Christian Krügel

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required