CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Purpose of Caps on Xstal

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

Purpose of Caps on Xstal
PostPosted: Mon Oct 29, 2007 12:23 am     Reply with quote

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







PostPosted: Mon Oct 29, 2007 5:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 29, 2007 7:34 am     Reply with quote

Hi Ttelmah

Thank you!

a.
Guest








PostPosted: Mon Oct 29, 2007 10:22 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 29, 2007 10:31 am     Reply with quote

Here's an appnote from Microchip. Read the sections on capacitors C1
and C2 on page 2:
http://ww1.microchip.com/downloads/en/AppNotes/FACT001.PDF


This is probably the Intel appnote that you were referring to:
ftp://download.intel.com/design/mcs51/applnots/23065901.pdf
Ttelmah
Guest







PostPosted: Mon Oct 29, 2007 10:39 am     Reply with quote

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








PostPosted: Mon Oct 29, 2007 8:29 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Oct 30, 2007 2:12 am     Reply with quote

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 Smile
Guest








PostPosted: Tue Oct 30, 2007 8:37 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group