Crystals and added capacitors - looking for a lesson
Timothy D. Swieter
Posts: 1,613
Over the years I have seen microcontroller and crystal designs that have added capacitors on the crystal, usually in the pF range, and others that don't. I haven't ever understood why the design would need them or not. Furthermore I don't understand how you would calculate what size caps to use. I reviewed only a small handful of crystal data sheets and did some Googling but I still don't feel satisfied in my understanding.
So the questions:
1. Why do some crystal design have add capacitors, one on each side of the crystal going to ground, and others don't?
2. How do you calculate the size of the cap needed?
3. What about the design or crystal component dictates needing the added caps and when you don't?
4. Any good references you can point me to on this topic?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
www.tdswieter.com
So the questions:
1. Why do some crystal design have add capacitors, one on each side of the crystal going to ground, and others don't?
2. How do you calculate the size of the cap needed?
3. What about the design or crystal component dictates needing the added caps and when you don't?
4. Any good references you can point me to on this topic?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
www.tdswieter.com
Comments
Crystals come in two types - series and parallel. MCUs generally require parallel operation crystals, and they always have a specified load capacitance (usually 20pF), which is used when calculating the feedback capacitor values. The capacitors are effectively in series, so you need twice the load capacitance. Allowing for stray capacitance, something like 33 pF is generally about right. For manufacture the oscillator should be checked thoroughly as things like capacitor tolerances and board layout will have an affect on crystal operation.
Most crystal manufacturers have application notes on this stuff, and MCU manufacturers often have recommendations in the data sheet.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
One thing I haven't been clear on, does the propeller effectively have built in caps? If so which will be the proper crystal?
If things are wrong do they not work, or is it a frequency drift issue?
Hope you don't mind a few more questions Timothy as I have puzzled over these a little also.
The Propeller does have capacitors built-in. It needs a crystal with a specified load capacitance for an accurate frequency; it's in the data sheet somewhere. They are difficult to obtain, but ordinary 20 pF ones work OK for me.
They usually work, even if the capacitors are wrong. They often work without capacitors, as stray capacitance is sufficient for them to oscillate. Drift isn't usually a problem as it's very small, even with cheap crystals. If they don't work with a given MCU either the oscillator is initialized wrong, or there is a problem with the connections.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Post Edited (Leon) : 1/28/2009 6:11:04 PM GMT
I was reviewing this particular crystal: www.ndk.com/en/products/search/crystal/1187841_1494.html I am planning to use it on a non-parallax micro, but I don't see details in the micros data sheet for what the micro expects. I see the crystal has a Load Capacitance of 8pF. At the least I can add pads for adding additional capacitors and test the system without them first and add the caps later if needed.
On a side note, recently I did a Propeller based design with a 10MHz. SMD crystal from Fox Electronics. The crystal is a four pad package of which two pads are used in the opposite corners. I messed up the foot print on which two pads were the crystal leads, but I did not find this problem until I got deep into software. When I started writing software I was using 40MHz. Why? I don't know, that is what I started using. When I switched to 80MHz. the device started to behave oddly or not run at all. It wasn't until then that I realized that the crystal was wrong. I am amazed that it was running at 40MHz., well it was running and fast, but I guess I can't say it was right at 40MHz.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
www.tdswieter.com
Post Edited (Timothy D. Swieter) : 1/29/2009 1:09:23 PM GMT
Page 180 [noparse][[/noparse]_clkmode] of Propeller manual outlines the capacitance and resistance values for various xtal values
Examples:
Clk mode - Xtal1
X0 resistance 2k,
X1 X0Capacitance 36pF
external low speed xtal 4 Mhz to 16MHz
Clk mode - Xtal2
X0 resistance 1k,
X1 X0Capacitance 26pF
external med speed xtal 8 Mhz to 32MHz
I can only guess that if no cap value is required in a design, it's because there is enough capacitance in the circuit pads that it attaches to and the value required is very small . For example 6 or 8 pf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Aka: CosmicBob
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
www.tdswieter.com
Note 2 on that page in the Manual mentions that all necessary resistors/capacitors are included in the Propeller chip.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Anytime.
Part 2:
From my early Ham radio studies I learned that there are different types of Oscillator circuits such as Colpitts, Hartley , Pierce, CMOS Inverter etc...
First you have to understand what type of oscillator circuit that the Xtal is being used for. In our case with the Propeller chip it could be a Pierce oscillator which is common for Microcontroller circuits. If that's correct you can use the link below to see the formulas used to calculate the caps for it. according to another Google search I did a few months ago... Most microcontrollers use parallel resonant crystals.
http://en.wikipedia.org/wiki/Pierce_oscillator
Example formula - Calculating crystal’s load capacitance:
Cload = {[noparse][[/noparse]Cin+C1][noparse][[/noparse]C2+Cout]/[noparse][[/noparse]Cin+C1+C2+Cout]} + pcb strays (2~3pF)
Example: Let Cin = Cout = 5pF;
C1 = C2 = 20pF
Therefore, Cload = {[noparse][[/noparse]25][noparse][[/noparse]25]/[noparse][[/noparse]25+25]} + 3
= 12.5 + 3 = 15.5pF
Select Cload = 16pF
Example formula source:
www.crystekcrystals.com/crystal/appnotes/PierceGateLoadCap.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Aka: CosmicBob