Author Topic: Choosing Capacitors for a Crystal; Do I Have It Right?  (Read 5471 times)

0 Members and 1 Guest are viewing this topic.

Offline RJDogTopic starter

  • Contributor
  • Posts: 27
  • Country: ca
Choosing Capacitors for a Crystal; Do I Have It Right?
« on: February 19, 2017, 01:50:16 pm »
So under the assumption that just choosing a 22pF capacitor to go along with a 12MHz crystal as shown in so many Arduino examples might not be the most ideal choice, I started looking into what the right value might be.  What tipped me off was the fact that there seemed to be quite a number of variances in "Load Capacitance" for the same frequency.

The best information I have found seems to be  C = 2*CL - 2*Cstray.  So for this crystal http://www.digikey.ca/product-detail/en/ecs-inc/ECS-120-20-46X/XC1753-ND/2676583 the Load Capacitance is listed at 20pF... this seems to be a pretty common value.  But my question pertains really to Cstray... all of the examples use 5pF for that value but other resources say it could be anywhere from 3 to 5pF.  How do I know, calculate or even guess what Cstray should be?  Is the higher value of 5pF the "safe" choice?

Using what appears to be the "standard" value of 5pF, this gives C = 2*20 - 2*5 = 30pF, which is quite a bit higher than 22pF so I can only assume that if I were to have used a pair of 22pF caps that the accuracy of the 12Mhz crystal would have been off a bit.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12852
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #1 on: February 19, 2017, 03:03:16 pm »
Cstray is highly dependent on the physical circuit layout and the active device used.  5pF is at best a guesstimate.  Its quite difficult to measure as one has to remove the crystal, disable the active device that's providing the gain so it tristates its output, and keep its terminals biassed at 1/2 Vcc so that any internal protection diodes don't interfere with the reading.

The two capacitors in a Pierce oscillator circuit don't have to be equal, but a gross imbalance causes problems.  The formula is Cload=C1*C2/(C1+C2), but Cstray must be treated as part of C1 and C2 (hopefully its similar for both, unless you have a pathologically bad board layout).  Use the simpler formula to get the desired C for two identical caps, then see what comes closest to the correct Cload, next preferred value (alowing for Cstray) up or down or one of each.

Its possible to use a trimmer either to replace or in series with one of the caps, but that may not be good for long-term stability.  Another factor to consider is the temperature coefficient of the caps, and also of the crystal. 

Nowadays, for digital applications, its always worth investigating if its possible to compensate for frequency errors in the software rather than trying to trim it spot-on. 
« Last Edit: February 19, 2017, 03:04:54 pm by Ian.M »
 

Offline RJDogTopic starter

  • Contributor
  • Posts: 27
  • Country: ca
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #2 on: February 19, 2017, 05:51:10 pm »
So, I should have asked this in my original post, but when we're talking about Cstray, we're talking about the miniscule amount of capacitance that is present just between the traces and nearby ground traces and planes?  Also known as parasitic capacitance?

The traces on my board for the crystal and capacitors are mirrored exactly, so I'm quite confident that choosing the same capacitor value is the correct choice.  Is there a way to estimate the stray capacitance?

I suppose a better question is, what is the consequence of selecting not the exactly right capacitor value?
 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #3 on: February 19, 2017, 10:51:34 pm »
So, I should have asked this in my original post, but when we're talking about Cstray, we're talking about the miniscule amount of capacitance that is present just between the traces and nearby ground traces and planes?  Also known as parasitic capacitance?

More or less. Also the pads and crystal package itself.

Is there a way to estimate the stray capacitance?

I suspect no one bothers trying to estimate Cstray for a crystal oscillator; if frequency is really that critical then use an OCXO (Oven Controlled Xtal Oscillator). Cstray is usually low enough that you can just use the recommended load capacitance* for the crystal, or the next closest standard value down. If the crystal doesn't oscillate when the first board is built then you can tweak the load capacitor values, but that is rarely a problem.

I suppose a better question is, what is the consequence of selecting not the exactly right capacitor value?

Generally speaking, increasing the loading capacitance pulls the frequency down (NB - "pulling" is commonly used jargon for adjusting a crystal's frequency, usually by varying the load capacitance), until a point is reached which causes the crystal to either stop oscillating, or results in damage (fracture of the crystal). Decreasing the load capacitance pulls the frequency up, until a point is reached where the crystal stops oscillating. So clearly the consequences of too much loading capacitance are more severe than too little, but the range of "acceptable" capacitance can be surprisingly wide, particularly for crystals below, oh, 25MHz or so.

Which reminds me, crystals above 25MHz might use an overtone, rather than the fundamental, and these can be much more picky about the load capacitance. They also tend to be much less "pullable" as a result.

* - or twice the load capacitance for each capacitor, if there are capacitors to ground on either side of the crystal.
« Last Edit: February 20, 2017, 11:17:59 am by MagicSmoker »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21657
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #4 on: February 20, 2017, 07:03:45 am »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline shteii01

  • Frequent Contributor
  • **
  • Posts: 266
  • Country: us
 

Offline RJDogTopic starter

  • Contributor
  • Posts: 27
  • Country: ca
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #6 on: February 20, 2017, 01:56:56 pm »
So clearly the consequences of too much loading capacitance are more severe than too little, but the range of "acceptable" capacitance can be surprisingly wide, particularly for crystals below, oh, 25MHz or so.
So, if I iterperet correctly, estimating a "higher" value for Cstray (e.g. 5pF) is safer than a low or 0 value for Cstray, as that would cause one to come up with a lower value for the accompanying caps?

E.g. for the crystal I linked with 20pF CL, 2 * CL = 40pF for the caps, but estimating Cstray at 5pF leads to cap value of 30pF, which should be a "safe" choice being below the default value of 40pF?
 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #7 on: February 20, 2017, 02:12:21 pm »
...
E.g. for the crystal I linked with 20pF CL, 2 * CL = 40pF for the caps, but estimating Cstray at 5pF leads to cap value of 30pF, which should be a "safe" choice being below the default value of 40pF?

Yes, if you want to be really precise about something that cannot be estimated precisely... Personally, I'd use 33pF for each load capacitor because it is a more common value, but you will likely find that anything from 22pF to 47pF will work as well, with just a few tenths of a percent change in frequency. But don't take my word for it; try a few different capacitor values yourself, and for each value hit the crystal with freeze spray, as a marginal oscillator will often stop when cooled down below 0C.

 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7942
  • Country: us
  • Retired, now restoring antique test equipment
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #8 on: February 20, 2017, 02:14:14 pm »
You can always use a screwdriver-adjust trimmer capacitor as part of the total load capacitance and adjust it to get the correct frequency with a counter.
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Choosing Capacitors for a Crystal; Do I Have It Right?
« Reply #9 on: February 20, 2017, 07:57:39 pm »
Isn't the biggest problem, after accuracy (which isn't likely to be great on a cheap microprocessor crystal anyway) reliability of starting?

Better to choose a lower value by calculating for max and min then picking mid range perhaps

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf