Crystal load capacitors: pick values from CL, not habit

22 pF on both sides is a habit, not a design rule. The right value depends on the load capacitance your crystal was cut for and on the stray capacitance of your board.

What "load capacitance" means

A quartz crystal oscillates at its marked frequency only when it sees the capacitance it was specified with, called CL and printed in the crystal datasheet (typical values are 6 to 20 pF). In the Pierce oscillator used by microcontrollers, the crystal sees the two capacitors to ground, C1 and C2, in series, plus the stray capacitance of the pins and traces:

CL = (C1 × C2) / (C1 + C2) + Cstray

This is the formula in ST's AN2867 oscillator design guide and in Espressif's hardware design guidelines. With equal capacitors (the usual choice) it simplifies to CL = C/2 + Cstray, so:

C1 = C2 = 2 × (CL - Cstray)

Cstray covers the MCU's oscillator pins and the PCB traces. It is not in any datasheet for your board; a few picofarads is typical for a compact layout, and 2 to 5 pF is a common starting estimate. Measure the frequency on the first prototypes and adjust.

Load capacitor calculator

Enable JavaScript to use the calculator. Formula: C1 = C2 = 2 x (CL - Cstray).

Worked examples

8 MHz crystal, CL = 12 pF, 4 pF stray: C = 2 × (12 - 4) = 16 pF. The nearest common value is 15 pF, giving CL = 7.5 + 4 = 11.5 pF - close enough. The habitual 22 pF would give 15 pF of load: the crystal runs slightly low in frequency, which matters for USB, CAN and UART timing margins.

RP2040 reference design: Raspberry Pi's hardware design guide uses 15 pF on each side of its 12 MHz crystal and explains that, with the parasitic capacitance of the board, this reaches the crystal's 10 pF load.

ESP32 family: Espressif gives the same formula for C1 and C2 and recommends tuning the capacitors so the frequency offset is within ±10 ppm - the radio is less forgiving than a UART.

Why it matters

  • Missing capacitors can stop the oscillator from starting, or make it start on some boards and not others. The MCU then falls back to its internal RC oscillator - or hangs waiting for the crystal.
  • Wrong values "pull" the frequency, typically by some tens of ppm. Harmless for a blinking LED; a problem for USB full-speed, CAN, Ethernet and radios.
  • Too much capacitance also loads the oscillator driver. ST's AN2867 asks you to check the gain margin (the oscillator's transconductance against the critical value for your crystal) and wants it above 5 so the oscillator starts reliably across temperature and parts.

Common mistakes

  • Copying 22 pF from another design without checking CL.
  • Using the "total" CL for each capacitor, instead of twice the value minus stray.
  • Putting load capacitors on an active oscillator (a four-pin part with VDD, GND, OUT and enable). Oscillators drive a clean clock and need decoupling, not load capacitors.
  • Ignoring the 32.768 kHz crystal: low-power LSE drivers are weak, and their crystals often have small CL (6 to 12.5 pF), so load and layout matter even more.
  • Long traces or a ground pour gap under the crystal, which add stray capacitance and pick up noise. Keep the crystal next to the pins with a solid ground underneath.

What the checker does

The crystal rule checks that both signal pins of every quartz crystal have a capacitor to ground (active oscillators are skipped). If the crystal's value or fields contain a load capacitance such as CL=12pF, it computes the effective CL of your capacitors with 2 to 5 pF of stray capacitance and suggests a matching value when they are far off. It also flags a crystal whose two terminals are on the same net. Add the CL to the crystal's Value or a field in KiCad to get the value check.

Primary sources