External ceramic resonator and ATMega8 Problem

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

Hi all,

I connected a 16Mhz external ceramic resonator to my ATMega8 between the Xtal1 and Xtal2 pins with 30pF caps between either leg and ground, then I tried to set SUT_CKSEL to one of the "Ext. Crystal/Resonator High Freq." options in AVRStudio. Now I'm locked out, and can't erase the uC nor program it via ISP. I can only read the target voltage.

I've tried removing the resonator and caps and setting it back to how its was originally to no avail.

Any solutions to this problem?

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

The reason you can no longer talk to the uC is because its not oscilating. You will need to connect an external clock source to the XTAL input (I think its XTAL1 but double check).

As you can read the target voltage, I suspect you have an STK500 or similar. This being the case, its a simple task to enable the onboard software clock and jumper it through to the XTAL pin.

Good luck.

Steve

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

Hi Steve, thanks for the quick response, I'm actually just using an ATMega8-16pu (DIP28) on a breadboard with only ISP. Could I use a function generator instead? Set it to 1Mhz, and select one of the 1Mhz options from the SUT_CKSEL menu?

Do you know why the Mega8 didn't like my external resonator? I'm sure I selected one of the appropriate external high frequency resonator options.

Cheers

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

maz123,

an external resonator as you describe is basically a crystal. You should set the fuses for a crystal and not an external oscillator.

You can use a function generator to recove, but then be sure to decrease the programming frequency otherwise you still get an error message.

regards

btw I have read alot of posts about killed CPU's with wrong fuse settings perhaps search for a few and try the there mentioned options.

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

KISS - Keep It Simple Stupid!

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

I tried applying a 2Mhz signal using a function generator (it only goes up to 2Mhz and not 4Mhz as suggested) to the Xtal1 pin and lowering the programming frequency from 125kHz down to 50kHz or even lower but I'm still locked out. Even setting SUT_CKSEL to any of the external clock options doesn't work.

Any ideas?

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

Not that its going to matter but i would set function to 1MHz and leave the isp at 125kHz.

Given this hasnt allowed you to talk to the m8 again, im not sure whether you could set up a EXT R or RC oscilator in case the fuses were programmed to used this mode. I thought that the external clock source would still work in this mode.

Is it at all possible that you have disabled the ISP capability fuse bit? I didnt think this can happen using ISP. Maybe an error occured.

Ohter fuse bits that may cause problem are the RSTDBL. If this is the case you will need to use HV programming.

Steve

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

I just put a brand new m8 into the circuit, and removed the resonator and caps from the xtal pins, but same thing. The old "Entering Programming Mode.. FAILED!" keeps coming up, reminds me of when I first had trouble interfacing the ISP to the uC.

What could it mean if a new chip acts the same way as I've described above?

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

I would suggest you have other problems and that it may have nothing to do with the clock source. So...
Check:
1. Supply connections and voltages levels (All VCC & GND pins as well as AVCC)
2. ISP Connections
3. RESET line with pull-up R and C to GND?
4. Decoupling Caps?

Make sure all these are intact, the right way round, and not shorted to one-another.

Also - A brand new m8 should have INTRC set for 1MHz so make sure your ISP is set to a suitable speed. (ie, <250kHz)

Good luck.

[Edit]
Another idea... is there anything connected to the ISP lines other than the ISP?

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

It ended up being a faulty cap on the ISP RESET line that was not letting me access the new m8.

With that problem resolved, when I tried adding the resonator(http://au.farnell.com/7948001/passives/product.us0?sku=ABRACON-HWZT-16.00MD&_requestid=242936) and caps(30pF) to the xtal pins, it looked like the m8 went into 16Mhz operation since I had jibberish being displayed on my LCD (because the delays for the LCD were set for a 8Mhz clock). But as soon as I tried to erase the m8 and upload new code, it locked me out again.

-I did have an external ADC also connected to the MISO and SCK pins which are used by the ISP but I disconnected the ADC.

-All Vcc and Gnd connections to the m8 have been checked.

-Programming frequency is set to 125kHz.

Any thoughts?

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

Did you program the CKOPT fuse? This needs to be programmed for 16Mhz operation.

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

yes, I tried programming the CKOPT fuse, but no luck. I've rendered the uC useless as it is now expecting an external clock signal for some reason and using a function generator at 1Mhz connected to the Xtal1 pin doesn't bring it back to life.

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

i think the only thing that helps is to reprogram it with high voltage programming