HELP! ATMEGA8 Oscillator Problems

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay, here is whats happening.

We need to set the ATMEGA8 to 8MHz either using the internal RC oscillator or external oscillator.

To set the ATMEGA8 we have been setting the lfuse byte to 0xe4. This seems to work fine - and this can be confirmed by reading back the lfuse from the controller.

Thing is once we do this, the chip will want to work for a few flashes then it dies and we can no longer connect to the ATMEGA8 using the programming dongle.

The same problem occurs using both an unbuffered DT006 style dongle and a buffered stk200 dongle (as seen on the ponyprog website).

The same problem seems to be occuring using both Ponyprog and avrdude.

The project we are working on requires at least a 8MHz oscillator nso sticking to the 1MHz internal oscillator isn't an option.

Can anyone shed any light on what is going on?

Can anyone suggest a possible way to resurect the no longer working microcontrollers?

The problem only seems to happen after the fuse bits have been programmed and programming stability is fine when the microcontroller is operating at its stock 1MHz internal oscillator.

I look foward to some feedback.

Thanks,
oddbudman

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

It might be that the fuse bits get changed somehow, and the result is the mega8 is expecting an external oscillator. Try connecting a clock source up to it at the proper pin and see if that works.

To use the 8 MHz internal oscillator you also have to set the OSCCAL register as well in your code. This is the register that actually determines the frequency the AVR will run at.

Regards,

-Colin