avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-chat] Crystals (was ATmega32 @ 16MHz : fuse bits ??)


From: Graham Davies
Subject: [avr-chat] Crystals (was ATmega32 @ 16MHz : fuse bits ??)
Date: Fri, 11 Nov 2005 10:46:01 -0500

David Kelly wrote:

> There is some magic to making crystals oscillate.
> ... Atmel is sloppy [about spec'ing crystals].

To be fair, crystals sold as "microprocessor crystals" (as opposed to RF
crystals) aren't particularly magic and tend to be pretty similar.  I have
never had one fail to oscillate.  Atmel don't tell you exactly what to get
because they give you a whole raft of options with the fuses.

> Wrote to Atmel ... I wanted to know, "Series,
> parallel, A/T cut, drive level, capacitance, etc?"

The oscillator circuit with the two capacitors to ground is for parallel
resonant crystals only.  A series resonant crystal will oscillate, but at a
slightly off frequency.  AT-cut, well, of course; they all are at this
frequency range.  Also fundamental mode - another question you could ask
that has a well-known answer.  As for capacitance, it is your job to figure
this from the calibration load capacitance of your crystal and the known and
stray capacitances in your circuit.  For example, 20pF is a common
calibration capacitance.  For this, you need 40pF from each end of the
crystal to ground (these capacitances appear in series across the crystal).
If you choose 22pF capacitors, you're allowing 18pF at each end for the pin
capacitance of the MCU plus stray capacitance.  If frequency accuracy is
really important, you'll measure this, otherwise, you'll just guess.  The
only thing Atmel are really remiss in not telling us is the drive level.
Presumably, this depends on the fuse settings, but they should still give us
some data.  HC-49/U-S crystals are usually happy with 1mW, maybe only 500uW,
but it's unlikely that an MCU will exceed this.  Teeny tubular crystals,
which take only 100uW, might get you into trouble if you program the CKOPT
fuse to get a rail-to-rail swing.

I hope this helps.  I don't think most people will have to worry much about
crystals.  I doubt that Vincent's problem was crystal selection or the wrong
load capacitors.  I've mentioned this before, but if you just pin-out the
JTAG port and use a JTAG programmer you can mess with fuses to your heart's
content because the JTAG port has its own clock and works fine when the main
clock is screwed up.  *And* you get on-chip debug, which might help Vincent
with some of his problems.

Graham.
http://www.ecrostech.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]