View previous topic :: View next topic |
Author |
Message |
arrow
Joined: 17 May 2005 Posts: 213
|
Purpose of Caps on Xstal |
Posted: Mon Oct 29, 2007 12:23 am |
|
|
Hi
Can someone please tell me what is the purpose of the caps on the Xstal connected to the PIC?
My board works with and without the caps. So I am confused.
Thank you
a. |
|
|
Ttelmah Guest
|
|
Posted: Mon Oct 29, 2007 5:14 am |
|
|
The frequency of the crystal, is specified into a particular load. Without the caps, you will find that the crystal runs noticeably 'off frequency'. Technically, to get the frequency 'spot on', requires calculating the real load (from the capacitors, and the capacitances of the tracks, and chip PINs), and selecting the capacitors to get the required value. It used to be common to have one of the capacitors variable, to allow the frequency to be trimmed for even better accuracy.
Best Wishes |
|
|
arrow
Joined: 17 May 2005 Posts: 213
|
|
Posted: Mon Oct 29, 2007 7:34 am |
|
|
Hi Ttelmah
Thank you!
a. |
|
|
Guest
|
|
Posted: Mon Oct 29, 2007 10:22 am |
|
|
The caps also provide the required 'phase shift' to get the oscillator running. In some cases the oscillator doesn't have enough stray capacitance on the board and you won't get good or reliable oscillation without them.
The Intel site used to have an excellent App Note on their uC's that went into this in detail.
HTH - Steve H. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah Guest
|
|
Posted: Mon Oct 29, 2007 10:39 am |
|
|
Yes.
However the parasitic capacitance present is normally enough to bring to meet this need, leaving the loading requirement as the main problem.
FYI, the crystal sees the two capacitors in series. The formula for the capacitance 'seen', is:
C=(Ca+Cp)/2
Where Cp is the parasitic capacitance, and Ca the added capacitor on one side. So if you have a crystal that is designed for 18pF, and typically parasitic capacitances around perhaps 7pF, then you get:
18=(Ca+7)/2
Which rearranges as:
(18*2)-7=Ca
Giving Ca as 29pF. Normally 27pF, or 30pF would be used.
The error is quite small for a couple of pF.
Best Wishes |
|
|
Guest
|
|
Posted: Mon Oct 29, 2007 8:29 pm |
|
|
Thanks PCM for finding that Intel app note - I was lazy and didn't search for it - I have it printed out in a 'offline binder' ;-)
I have seen people using MCU's with crystals that didn't get loaded with caps and since they never checked or cared about the frequency assumed that all was OK ----- but the production bug soon hits and as soon as a customer tries to use the product outside of a lab environment all sorts of strange stuff happens.
It is generally important to check the operation *and* startup of your oscillators at the temperature extremes (usually cold is worse due to decreased loop gain) before shipping your product.
This will also find all sorts of odd power supply problems too!
I am happy to report that I have never found a low temperature bug with any of my C programs however!
;-)
Steve H. |
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Tue Oct 30, 2007 2:12 am |
|
|
FYI:
There are so called resonators with two built-in capacitors (they have three pins) They are not made of crystals, but ceramics, so they are not that accurate in frequency.
And there are complete oscillators (they are usually larger and have four pins, requiring power supply) may also look as a crystal from above.
Looking on a board these all can be misidentified as a 'crystal' for a beginner. (with no capacitors of course |
|
|
Guest
|
|
Posted: Tue Oct 30, 2007 8:37 am |
|
|
That's a good point Ilbor - The ceramics are most commonly used. The accuracy is good for some things, but not for others.
Accuracies of 0.5 to 1% are easily obtainable with the ceramic resonators which makes them suitable for typical RS232 frequency setting.
0.5% is not suitable for a radio synthesizer - 0.5% of a 1.9 GHz cell phone frequency is 9.5 MHz! That is an unacceptable error... ;-)
These parts also can't be 'pulled' or changed in frequency like a crystal can be (for instance using a variable capacitor to get the frequency spot on).
In my experience I have had less problems from manufacturer to manufacturer in getting good MCU oscillator performance than with crystals. There is a lot to making a good crystal and not everyone can do it well or repeatably, it seems that all the manufacturers I have tried are much more consistent with the ceramic resonator.
A 'Canned' oscillator is the safest, but most expensive solution. It is safest because it is absolutely specified to work by the manufacturer and any amount of accuracy can be 'bought' if you have the money!
Thanks for the reminders....
:-)
Steve H. |
|
|
|