Oscillator Capacitors Calculator
- 12 Sep, 2020
Introduction
If you're only here to use the calculator and run (no shame), its right below, you're welcome! Although if this is your first time here and you want to learn about load and stray capacitance's, how to choose the right capacitors for your specific oscillator and why it's so important, then keep reading.
Calculator
Why is it important?
When designing electronic circuits or PCB's its important to choose the correct components and the correct type of components for the specific application. Granted, this is not always uber important such as in the case of a micro-controllers pull up resistor, a 9kΩ or 10kΩ pull-up resistor will get the job done regardless.
In the case of crystals, choosing the correct capacitors to pair with your specific crystal is fairly important and will ensure that you get the most performance out of them.
You might be thinking right now "The single line diagram i have suggests 2 x 22pF capacitors for the 16MHz crystal, so i can just use the same right?". Well.. unfortunately not always. See, there is massive variation between crystals even when comparing those with the same frequency or from the same manufacturer and the capacitors you choose have to be matched to the requirements of the specific crystal you purchased.
Luckily choosing the right capacitor value is actually quite easy and once you've learnt some of the theory behind it (Or at least figure out where to get the correct input parameters), we've made a super simple calculator that will help you get your designs off the ground fast!
Equation
C1 and C2 are the two capacitors between the crystal and ground and they should both be the same value
As you can see, the equation is fairly simple, no need pull out Wolfram Alpha or remember back to calculus 101, Phew! But what is CL and Cstray and where do you find them?
Load and Stray Capacitance
Load Capacitance (CL)
Lets start with the easy one. Load capacitance is the capacitance required to make the crystal oscillate and effectively creates an LC tank circuit with the crystals internal inductance (See our crystals guide for more). Luckily for us, the load capacitance is always listed in the crystals datasheet. If we take this NDK 12MHz Crystal as an example, we can see that the listed load capacitance is 8pF
Stray Capacitance (Cstray)
Stray capacitance is slightly more complicated to come up with although we have a pretty good rule of thumb you can use. Everything in and around your PCB including the traces and component leads have some amount of stray capacitance. The combined total of these we represent by Cstray.
To find Cstray you should prototype your PCB with all the final components, buy expensive high precision capacitance measurement equipment and go to work measuring all the stray capacitance on your board. Orrr... your could just guess!
Typically, Cstray is going to be in the realm of 2-5pF as long as you are following good PCB design principals. Keep the crystal as close as practical to the applicable pins on the micro-controller, keep track lengths to a minimum and avoid via's on the way. I've always split the difference and take Cstray as 3pF and its always worked for me (Famous last words)
Example
So we have the equation and we know where to find our input parameters, lets do a quick example. For this we'll take the NDK 12MHz crystal again and its listed 8pF as our load capacitance. We'll assume 3pF for the stray capacitance
Learn More
- Ko-bee's Resonator and crystal Learning Tutorial
- ST Microcontrollers - AN2867 Oscillator Design Guide
Hey there! Thanks for stopping by
We hope you found what you were looking for and were able to step away knowing just that little bit more
Founded by a group of electrical engineers, Kobee's main goal is to simplify electronics design and home automation and making it accesible to everyone, not just the engineering community. In many of our own personal maker journeys we were able to benefit from the amazing open source and community driven content generated by savvy makers all over the world. Though, the issue we always found is that although the content was readily available, the documentation and explanation was sometimes barebones and better suited to the experts that designed it in the first place. We're looking to change that! To explain it as simply and as clearly as we can and to pay it forward to the open source community that we all love
So what can you expect from us? Its unlikely you'll find an in depth explanation of laplace transform here and we're probably not going to delve into the world of imaginary numbers (Sorry). But, if you're looking for straight forward, to the point and simple to understands tutorials, explanations and project examples; we think we just might have you covered.
Our community is at the heart of what we do, so if you have any comments or questions leave them in the comments down below or use the Contact Us Form to get in touch. We'll do our best to help each and every one of you
Hi,
I am using crystal HCM497372800ABJT having CL 18pF. It comes to use C1=C2 = 30pF capacitors.
Regards,
Marceli
Comment Test