Go Down

Topic: Choosing capacitor for crystal (Read 2175 times) previous topic - next topic

GoingForGold

Hi there!

I'm on my first standalone pcb with a "plain" atmega. I found much about how to hook up the crystal to the AVR.

But two questions remain:
In the datasheet of the atmega is stated that XTAL1 is "input" and XTAL2 is "output". But do I see this right, the crystal oscillator doesn't have something like an input and output, the pins are the same?

I found the formula for choosing the capacitors. It is C = 2CL - (CP+CI), and that I should assume that CP+CI equals 5. So with this calculation, I get 35pf for the capacitors. So in this application I'm not sure if I should choose 33pf oder 39pf. If they were resistors, it would be clear, always choose the greater value. But for the capacitors I have no idea. And last, can my capacitor be too high voltage? Or is this value just a maximum and that I should try not to have a too large piece?

Thank you!

oric_dan

I don't know the formulas, but 33-39 pF values sound a little too high.
From what I've seen, the usual values for 10-20 Mhz crystals are in
the 18-22 pF range.

MarkT


I don't know the formulas, but 33-39 pF values sound a little too high.
From what I've seen, the usual values for 10-20 Mhz crystals are in
the 18-22 pF range.



Entirely depends on the crystal's specification.  If the load cap should be 18pF  and the oscillator contributes 5pF, then 13pF is needed from the two caps (which act as in series), so 26pF caps are needed to get best frequency accuracy.  If the crystal wants 30pF then 50pF caps are wanted...  I always use 22pF caps since smaller is less likely to prevent oscillation and I don't care about pulling the frequency a few ppm normally.

The oscillator has an input and an output and uses the xtal as the feedback network.  This is the standard CMOS inverter-oscillator setup, except that most smart chips limit the oscillation amplitude to reduce power consumption and crystal-self-heating.

Capacitors can't be too high a voltage, nothing bad happens if you don't overload it!
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

GoingForGold

Thanks, so I'm going to have a look at the 22pf.

You say they do have input and output. So how do I find out which is which? :)

Docedison

As far as the crystal is concerned, it doesn't make any difference... It is happy either way, the oscillator pins are marked because it is possible to 'clock' the chip from another oscillator... or another processor 'clocked' from this one. Since you aren't doing that the actual pins used for the crystal are unmarked on the crystal and unimportant as to ...

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

GoingForGold

Thanks! This was great help!

So since I'm actually on this I thought I just may use this thread, probably someone with an idea stumbles upon this ;)

I'm designing the PCB in Eagle and added the capacitor. I drew the signal from the crystal to the capacitor and wanted to draw the signal (not the the wire yet!) from the capacitor to the ground pin (I mean a pad where I'm going to add 0.1" headers). Unfortunately Eagle does not allow me to do this. Whenever I take the signal-tool and click on the GND nothing will happen, but it wants me to continue the signal from the "first" capacitor pin. Of course not to the GND pad...

Go Up