Kyros Engineering Engineering Tools
Home › Tools › Crystal Load Caps
// Embedded tools Proto v0.1Pierce oscillatorAN2867ppm budget

Crystal Load Caps

Pick a crystal and your board's stray capacitance to get the two load capacitors in standard values. Then check what matters after the board is built: will the oscillator start every time, is the crystal overdriven, and how many ppm the capacitor choice costs you.

Runs entirely in your browser. Nothing is uploaded.

1 · Crystal

Hz
pF
Ω
pF
fF
µW

2 · Board

pF
pF
pF
pF
×

3 · Oscillator

A/V
Ω

4 · Drive level

Vpp
pF

5 · ppm budget

±%
±pF
±ppm

Load capacitors

Fit
—
Ideal C1 / C2
—
E12
—
E24
—
CL with fitted values
—
Frequency error from snapping
—

Standard values near the ideal

C1C2CLCL errorFrequency

Will it start? (gain margin)

Gain margin gm / gm_crit
—
gm_crit
—
Oscillator gm
—
Gm_crit_max = gm / 5
—
—

Drive level

Drive level
—
Max swing for DL max
—
C_tot at OSC_IN
—
RExt starting value
—
—

Frequency pulling

Pullability at CL
—
Load offset vs series
—
Worst-case total
—
Time error
—
ContributorSwingppm

Pullability vs load capacitance

ppm of frequency shift per pF of load error, for this crystal's Cm and C0. A higher-CL crystal is less sensitive to stray and capacitor tolerance, but needs more oscillator gain.

Frequency offset vs load capacitance

Offset from the frequency at the nominal CL. The shaded band is the CL range the capacitor tolerance and stray uncertainty can produce.

// How it works

Load capacitors, oscillator margin and pulling in a Pierce oscillator

A crystal is cut to hit its frequency with one specific load across its pins, CL. In a Pierce oscillator that load is the two capacitors in series plus everything stray: the MCU pins, the traces and the pads. Get CL wrong and the frequency moves; get the oscillator gain wrong and it may not start at cold or on a low battery.

CL = C1 · C2 / (C1 + C2) + C_stray equal caps: C1 = C2 = 2 (CL − C_stray) per pin CL = (C1 + Cp)(C2 + Cp) / (C1 + C2 + 2Cp) + C_shunt, Cp = C_pin + C_trace equal caps: C1 = 2 (CL − C_shunt) − Cp, i.e. C_stray = Cp / 2 + C_shunt gm_crit = 4 · ESR · (2π f)² · (C0 + CL)² gain margin = gm / gm_crit ≥ 5 with a series resistor, use ESR + RExt; Gm_crit_max = gm / 5 DL = ESR · (π f C_tot Vpp)² / 2, C_tot = C1 + C_stray / 2 + C_probe RExt ≈ 1 / (2π f C2) (starting value, then re-check gm_crit) offset Δf / f = Cm / (2 (C0 + CL)) above the series resonance pull ppm = Cm/2 · [1/(C0 + CL_actual) − 1/(C0 + CL_nominal)] · 10⁶ pullability (ppm/pF) = Cm · 10⁶ / (2 (C0 + CL)²) C in pF

Example from AN2867: an 8 MHz crystal with C0 = 7 pF, CL = 10 pF and ESR = 80 Ω gives gm_crit = 0.23 mA/V. On an STM32F1 HSE with gm = 25 mA/V the gain margin is 107. A 32.768 kHz crystal is the hard case: ESR is tens of kΩ and the LSE oscillator's gm is a few µA/V, so the margin is often between 2 and 10 and depends on the drive-level setting.

Estimating stray capacitance

Without a measurement, start with the MCU's OSC pin capacitance from its datasheet plus 2–5 pF for traces and pads, and keep the traces short and symmetric. The per-pin model is more exact when you know each piece: pin and trace capacitance on each side adds to that side's capacitor, so it counts half towards CL, while capacitance directly between the two pins counts in full. For production, fit the computed values, measure the frequency on a few boards, and correct C_stray from the measured offset using the pullability.

Limits

References

  1. STMicroelectronics, AN2867 Oscillator design guide for STM8AF/AL/S, STM32 MCUs and MPUs, Rev 19 (Apr 2023): §3.3–3.7 formulas and examples, Table 5 (LSE gm and Gm_crit_max), Table 6 (HSE), Table 7 (recommended 32.768 kHz crystals with gm_crit). ST lists Rev 24 (Feb 2026) as current; it could not be retrieved for this build, and the formulas have been the same since Rev 13.
  2. Epson, FC-135 / FC-135R crystal unit datasheets (ESR, C0, C1 3.4 fF, drive level 1.0 µW max) and TSX-3225 spec sheets X1E0000210120, X1E0000210124, X1E0000210734 (16, 24, 25 MHz: R1, C1, L1, C0, drive level).
  3. ECS Inc., ECX-34Q datasheet (32.768 kHz, 70 kΩ, C0 1.1 pF, C1 3.5 fF, 0.5 µW max).
  4. Epson, MA-406/MA-505/MA-506 datasheet (HC-49/US SMD: R1 by frequency, C0 5 pF max, 10–100 µW).
  5. Philips Components, Quartz crystals, general applications, HC-49/U (1996), Fig. 14–15: typical C1 and C0 versus frequency, fundamental mode.

Clock that won't start on some boards?

Kyros reviews and debugs oscillator circuits and the layouts around them: crystal selection, load and margin calculations, and the production test that catches a marginal part before it ships.

Talk about your project →