Crystal Load Capacitance Calculator & Solved Example

Share:
Electronic Components
Crystal Load Capacitance Calculation: How to Choose the Two Load Capacitors for a Quartz Crystal

A quartz crystal only hits its printed frequency when the circuit around it shows the exact load it was calibrated for. Here we size the two capacitors, estimate stray capacitance and check what a wrong value costs in ppm.

Pierce oscillator C1 = C2 formula Stray capacitance ppm pulling Bench tuning

Every crystal datasheet gives a load capacitance, and the two small capacitors on the board must recreate it. Below you get the formula, a 12 pF worked example, a calculator and field checks for a clock that runs fast, slow or not at all.

Hello everyone, today we are going to learn how to calculate crystal load capacitance and pick the right pair of capacitors for a microcontroller clock.
crystal load capacitance
Quick Answer

How do you calculate crystal load capacitance for a Pierce oscillator?

Crystal load capacitance is the total capacitance the crystal sees across its two pins: CL = (C1 × C2) ÷ (C1 + C2) + Cstray. With equal capacitors this gives C1 = C2 = 2 × (CL minus Cstray). For a 12 pF crystal on a board with about 4 pF of stray capacitance, each capacitor is 2 × (12 minus 4) = 16 pF, so two 16 pF C0G parts are fitted.

  1. Read CL from the crystal datasheet, for example 12 pF.
  2. Estimate stray capacitance from pins and traces, usually 3 to 5 pF.
  3. Work out C1 = C2 = 2 × (CL minus Cstray).
  4. Fit the nearest C0G value and measure the frequency on a buffered output.

What Is Crystal Load Capacitance?

Crystal load capacitance (CL) is the capacitance the oscillator circuit must present across the crystal pins so that it runs at the frequency stamped on it. The maker trims every crystal while it sits in a test fixture with exactly this load, so your circuit has to copy that fixture.

Key Facts
  • Pierce formula: CL = (C1 × C2) ÷ (C1 + C2) + Cstray.
  • Equal capacitors: C1 = C2 = 2 × (CL minus Cstray).
  • Typical stray capacitance on a small board: 3 to 5 pF.
  • Too much load makes the clock slow, too little makes it fast.

If you are new to quartz, first read how a crystal oscillator works, because the load capacitors are part of the resonant loop. The crystal behaves like a very sharp series LC resonant circuit, and any capacitance hanging on its pins moves that resonance a little.

Advertisement

How Does the Pierce Oscillator Load the Crystal?

In a Pierce oscillator the two load capacitors sit from each crystal pin to ground, so the crystal sees them in series plus whatever stray capacitance the pins and copper add. Almost every microcontroller clock input uses this circuit with an inverting amplifier inside the chip.

The inverter gives 180 degrees of phase shift and the crystal with C1 and C2 gives the other 180 degrees. A large feedback resistor Rf biases the inverter in its linear region, and an optional series resistor Rs on XOUT limits the drive power into the crystal.

crystal load capacitance in a Pierce oscillator with C1 C2 and stray capacitance
Diagram by Instrumentation Blog showing a Pierce oscillator with a 12 MHz crystal, two 16 pF load capacitors, about 4 pF stray capacitance and the resulting 12 pF load.

C1 and C2 are in series as seen from the crystal, which is why each one is about twice the load figure. If you need a refresher, see how capacitors combine in series and parallel; two equal capacitors in series give half of one value.

Do You Know?

The crystal does not run at its pure series resonance in a Pierce circuit. It runs slightly above it, in the narrow region where it looks inductive, and the load capacitance decides exactly where in that region the frequency settles.

Crystal Load Capacitance Formula and How to Calculate C1 and C2

The crystal load capacitance formula adds the series value of C1 and C2 to the stray capacitance, and you solve it backwards for the capacitor value. With equal capacitors the answer is simply twice the load minus twice the stray.

CL = (C1 × C2) ÷ (C1 + C2) + Cstray
If C1 = C2 = C:
CL = C ÷ 2 + Cstray
C1 = C2 = 2 × (CL minus Cstray)
1
Read CL
Take the load figure from the crystal datasheet or part number, not from the microcontroller datasheet.
2
Estimate Cstray
Add the pin capacitance of the oscillator pins and the trace capacitance. Use 3 to 5 pF as a first guess.
3
Solve for C
Subtract the stray value from CL and double the result. This gives each capacitor value.
4
Round and verify
Pick the nearest standard C0G value, build the board and measure the real frequency.

The capacitor values come out small, usually between 10 and 33 pF for MHz crystals and between 6 and 22 pF for 32.768 kHz watch crystals. If your sum gives a value close to zero or negative, the stray capacitance already meets or exceeds the load and you should pick a crystal with a higher CL.

Quick Tip

Some microcontrollers have programmable internal load capacitors on the oscillator pins. Count that internal value as part of C1 and C2, or switch it off, before you add external parts.

How Much Stray Capacitance Should You Assume?

Assume 3 to 5 pF of stray capacitance for a compact layout with the crystal placed within a centimetre of the chip. Long traces, sockets and thick boards push it higher.

Source of stray capacitanceTypical valueHow to reduce it
Oscillator pin capacitance of the IC1 to 5 pFRead the pin value in the chip datasheet
PCB trace to ground planeAbout 0.5 to 1 pF per inchKeep XIN and XOUT traces short
Total for a tidy layout3 to 5 pFUse as a starting estimate

Good PCB design rules help here: place the crystal next to the chip, keep both traces equal and short, and run no fast signals under them. A solid ground plane under the oscillator gives a stable, repeatable stray value from board to board.

Solved Example: 12 pF Crystal on a Microcontroller

A 12 MHz crystal rated for 12 pF on a board with about 4 pF stray capacitance needs two 16 pF capacitors. The working below also shows what happens if you fit the nearest E12 value of 15 pF instead.

Given: CL = 12 pF, Cstray = 4 pF
C = 2 × (12 minus 4) = 16 pF each
Check: 16 ÷ 2 + 4 = 12 pF
With 15 pF fitted: 15 ÷ 2 + 4 = 11.5 pF
Δf/f = (C1m ÷ 2) × [1 ÷ (C0 + 11.5) minus 1 ÷ (C0 + 12)]
C1m = 7 fF, C0 = 3 pF: 8.0 ppm high = 96.6 Hz

Here C1m is the motional capacitance and C0 is the shunt capacitance of the crystal, both printed in a good datasheet. A 12 MHz crystal running 8.0 ppm fast still sits well inside a typical 20 or 30 ppm tolerance, so 15 pF is acceptable for most clocks.

Crystal Load Capacitance Calculator
Ideal capacitors and frequency error
Ideal C1 = C2 = 16.0 pF. With 15 pF fitted, CL = 11.50 pF and the crystal runs 8.0 ppm high (96.6 Hz).
frequency offset in ppm versus load capacitance for a 12 pF crystal
Diagram by Instrumentation Blog plotting frequency offset in ppm against effective load capacitance for the 12 pF solved example, with 15, 16, 22 and 24 pF capacitor points.

The curve shows why errors are not symmetric. Each picofarad below the rated crystal load capacitance pulls the frequency up more than a picofarad above it pulls it down, and at 12 pF the slope is about 15.6 ppm per pF for this crystal.

Advertisement

What Happens If Load Capacitors Are Wrong?

Wrong load capacitors shift the frequency by tens of ppm and, if far too large, can stop the oscillator from starting. Too much capacitance makes the clock slow, too little makes it fast.

The most common mistake is to fit two 24 pF parts because the crystal says 12 pF, forgetting the stray term. Then CL becomes 16 pF and our example crystal runs 49.1 ppm slow, about 589.5 Hz low at 12 MHz, which is outside a 30 ppm part.

SymptomLikely causeField fix
Clock slow, RTC loses timeLoad too high, stray ignoredReduce both capacitors one step
Clock fast, RTC gains timeLoad too low or caps missingIncrease both capacitors one step
No start at cold or low voltageLarge caps, high ESR, low gain marginSmaller caps or lower ESR crystal
UART framing errors at high baudClock error adds to baud errorBring clock within tolerance
Works on bench, fails in fieldX7R or Y5V caps drifting with heatReplace with C0G parts
Myth: C1 and C2 should each equal the CL printed on the crystal.
Fact: The two capacitors are in series, so each one is roughly twice CL minus twice the stray value.
Myth: Bigger load capacitors make the oscillator more stable.
Fact: Bigger capacitors raise the critical gain the inverter must supply and can stop a weak oscillator from starting.
Myth: Any 22 pF capacitor will do for every crystal.
Fact: The value depends on the crystal CL and your board stray, and only C0G parts hold it over temperature.
Good practice
  • Calculate from the crystal CL and a real stray estimate
  • Use C0G or NP0 ceramic capacitors with 5 percent or better tolerance
  • Measure on a buffered clock output with a frequency counter
  • Check gain margin when you raise the capacitor value
Common mistakes
  • Copying 22 pF from an old schematic
  • Using X7R parts that drift with temperature and voltage
  • Probing the crystal pins with a 10 pF scope probe
  • Ignoring internal load capacitors already in the chip

How to Measure and Tune the Crystal Frequency on the Bench

Measure the frequency on a buffered clock output pin or a timer output with a frequency counter, then adjust both capacitors together until the error is within the crystal tolerance. Never measure directly on the crystal pins.

Most microcontrollers can route the main clock, or a divided copy of it, to a spare pin. A counter with a stable timebase reads it without loading the crystal, while a scope probe on XIN or XOUT adds its own capacitance.

flowchart to choose and tune crystal load capacitors on a new board
Diagram by Instrumentation Blog showing the flowchart to choose crystal load capacitors, check start up, measure the frequency error and adjust the capacitor values.
  • Let the board warm up for a few minutes before you read the counter
  • Record frequency in Hz and convert to ppm: (measured minus nominal) ÷ nominal × 106
  • If fast, step both capacitors up; if slow, step both down
  • Repeat at minimum supply voltage and at a cold start
Do You Know?

A 32.768 kHz watch crystal that runs 20 ppm off gains or loses about 1.7 seconds per day, which adds up to almost a minute each month on a real time clock.

For a new design, also confirm the oscillator has enough gain. The critical transconductance is gm crit = 4 × ESR × (2πf)2 × (C0 + CL)2, and a gain margin of at least 5 against the inverter gm is a common target for MHz crystals.

Quick Tip

Start up trouble is easier to see than frequency error. Power the board from a slowly rising supply in a cold room; if the clock fails there, reduce the capacitors or pick a crystal with lower ESR before you chase ppm.

PDF
Oscillator design guide for STM8 and STM32 microcontrollers (AN2867)
Free PDF app note: Pierce oscillator, load capacitance, gain margin, drive level and PCB layout
Advertisement

Which Capacitors and Layout Work Best for Crystal Load Capacitors?

Use C0G (NP0) ceramic capacitors, 5 percent or better, placed right next to the crystal with short ground returns. Unlike the class 2 parts in our guide to capacitor types, their value hardly changes with temperature or voltage, so the crystal load capacitance stays where you set it.

Keep the oscillator away from switching nodes and noisy buses. The same noise reduction techniques for digital ICs apply: a guard ring of ground copper around the crystal and no fast traces crossing under it.

If you check the clock against a reference, our calibration error calculator helps you express the reading in percent or ppm against your tolerance.

The video walks through the crystal model and the Pierce circuit, which makes the crystal load capacitance formula above easier to picture.

Crystal Load Capacitance FAQ

What is crystal load capacitance and why does the datasheet specify it?

Crystal load capacitance is the capacitance across the crystal pins at which the maker calibrated its frequency, typically 6 to 20 pF.

Your circuit must recreate that load with two capacitors plus stray capacitance. If it does not, the crystal runs a few to many ppm away from the value printed on it.

How to calculate load capacitor values for a 12 pF crystal step by step?

Estimate stray capacitance, say 4 pF, and subtract it from 12 pF to get 8 pF. Double it, because C1 and C2 are in series, so each capacitor is 16 pF. Check: 16 ÷ 2 + 4 = 12 pF.

What is the difference between crystal load capacitance and shunt capacitance C0?

C0 is the fixed capacitance of the crystal electrodes and holder, typically 1 to 7 pF, and it is part of the crystal itself.

Crystal load capacitance is what the external circuit adds across the pins. You set it with C1, C2 and the stray capacitance of the pins and traces.

What happens if crystal load capacitors are too large or too small?

Too large and the clock runs slow and may fail to start, because the inverter needs more gain. Too small and the clock runs fast.

In our example, two 24 pF parts on a 12 pF crystal give a 16 pF load. The 12 MHz clock then runs 49.1 ppm slow, about 589.5 Hz low.

Which capacitor type is best for crystal oscillator load capacitors?

Use C0G or NP0 ceramic capacitors with 5 percent tolerance or better, in values from about 6 to 33 pF.

Their value stays almost constant with temperature and DC voltage. X7R and Y5V parts drift with heat and bias, so the crystal load capacitance moves and the oscillator frequency moves with it.

How to measure crystal frequency without disturbing the oscillator circuit on a board?

Route the clock, or a divided copy, to a buffered output pin and read it with a frequency counter.

A scope probe on the crystal pins adds several pF and pulls the frequency, so the number you see is not the real one. Let the board warm up before you take the reading.

Advertisement

Related Articles

External References

What We Learn Today

  • Crystal load capacitance is the load the maker calibrated the crystal at, and the circuit must copy it to get the printed frequency.
  • In a Pierce oscillator each capacitor equals two times the crystal CL minus the stray capacitance, so a 12 pF crystal with 4 pF stray needs 16 pF.
  • Too much load makes the clock slow and can stop start up, too little makes it fast, so measure on a buffered output and adjust.
Advertisement
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!
Sunayana Gadepatil, author at Instrumentation Blog
Author · instrumentationblog.in
Ms. Sunayana Gadepatil is an instrumentation professional, technical writer, and the author behind Instrumentation Blog. With a strong interest in industrial instrumentation, process measurement, and automation, she specializes in simplifying complex technical concepts into clear, practical, and easy to understand insights. Through her articles, Ms. Sunayana shares valuable knowledge on flow, pressure, level, temperature, control systems, and industrial automation for engineers, students, technicians, and industry professionals.
Technically reviewed on

Leave a Reply

Your email address will not be published. Required fields are marked *

Support free learning

Help keep every guide, calculator and tool 100% free

Hosting, software and hours of research go into every article. Even a small contribution helps us publish more in-depth guides for students, technicians and engineers.

  • No paywalls
  • No sign up
  • Free for everyone