Fuses for ATmega 168 for external crystal

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

Hi guys

 

I've been trying to set the fuses in an ATmega 168-20PU so that it uses a 20MHz external crystal (with 18pF caps).

 

So far I've managed to tank one of my '168s :D. Will get that back with HVPP, but I wanted to run my fuse settings past you fellows:

 

I'll list all settings just in case:

 

SPIEN  - checked

WDTON - not checked

EESAVE - not checked

BODLEVEL - disabled

CKDIV8 - not checked

CKOUT - not checked

SUT_CKSEL - EXTXOSC_8MHZ_XX_16KCK_14CK_65MS

 

Fuses:

 

EXTENDED - 0xF9

HIGH - 0xDF

LOW - 0xFF

 

I did try the http://www.engbedded.com/fusecalc/ but that gives a duff answer (well, more likely my not understanding it may have :p).

 

Any advice much welcome!

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

The fuses are set correctly for an external crystal, so check you hardware again like the caps being wrong, dry joints or short circuits.

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

banedon wrote:
Will get that back with HVPP

No need for that, unless you fussed with RSTDISBL fuse.  See Tutorials forum article...I think there is "bricked" or "locked" in the title.

https://www.avrfreaks.net/forum/t...

 

Re your clock situation --

banedon wrote:
I did try the http://www.engbedded.com/fusecalc/ but that gives a duff answer (well, more likely my not understanding it may have :p).

That is well-respected, so perhaps show a screenshot from there, and tell what is duff.

 

 

 

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Go to the link for engbedded and select your micro i.e. M168,

then in the first pull down where you select clock source, choose the last item!

 

At the bottom of the page you will find the correct fuse settings.

 

Jim

 

I get H:df L:7f E:f9  using an external xtal >8MHz

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

Remember 20MHz requires 5V, not 3.3V supply (though I'd think it would 80% likely run anyway at 3.3v).  You could try 10Mhz xtal & see what happens.    Also how do you know it is not actually running your code (or you simply can't get back into programming?)

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Hi guys

 

Thanks for the replies. My apologies for the delay in getting back to you.

 

I pulled apart the circuit and rebuilt it and also reflashed the '168. It now seems to be working with 20mA being pulled from my PSU. I also enabled CKOUT on PB0 and that gives me the correct crystal frequency.

It's possible that the circuit was at fault, but I did reseat everything originally, checked voltages etc, but 0v was being drawn. The circuit was the simplest: power to VCC & AVCC, ground to both GND pins. Crystal across XTAL1 and XTAL2 with 18pF caps connecting those pins to ground. That's it.

 

Thanks for the link about reflashing without using HVPP - didn't think of just supplying the clk externally (doh!). However, I'm using HVPP now as I need to use the pins used by SPI so all good.

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

I'm using HVPP now as I need to use the pins used by SPI

Using an SPI peripheral (or even the pins used by SPI) does not preclude the use of serial programming.  No need for HVPP unless you've programmed RSTDISBL in order to get that one extra (weak) I/O pin.  Which, don't.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]