Source code coming soon. The GitHub repository is private for now and opens to everyone very soon.
BetterSPICE Beta 0.8.1 Join the beta Download soon
Part VII  Design calculatorsReferenceContentsIndex
59

Crystal load capacitors

The two load capacitors of a Pierce crystal oscillator, as on a microcontroller’s XIN and XOUT pins: the values that make the crystal run at its marked frequency, the frequency error they give, and whether the oscillator has gain enough to start. The Advanced view adds the negative resistance, the drive level, the start-up time and the whole frequency budget for UART, USB, Ethernet, BLE or an RTC, with presets for a 16 MHz AT-cut crystal and a 32.768 kHz tuning fork. Group Parts. Search words include crystal, xtal, load capacitor, oscillator, pierce, ppm, cl and quartz.

The window, the Simple and Advanced views, full screen and the place buttons are in The calculator window.

59.1Simple: C1 = C2 for a CL

Simple: C1 = C2 for a CL
FieldUnitDefaultWhat it does
Crystal load capacitance CLpF18From the crystal datasheet. Reads a selected crystal’s cl.
Stray capacitancepF3Pins, traces and the amplifier input. 2 to 5 pF is typical.
C1 = C2pF30 (solved)The load capacitors, always the solved field.
FrequencykHz, MHz16 MHzReads a selected crystal’s freq.
Toleranceppm20Plus and minus, with the stability if the datasheet adds it.
Shunt capacitance C0pF3
Motional capacitance C1 of the crystalfF7
ESRΩ40
Amplifier gmµA/V, mA/V5 mA/VFrom the MCU datasheet. The gain margin is gm over gm critical and must be 5 or more.

C1 = C2 = 2 (CL − Cstray), from CL = C1 C2 / (C1 + C2) + Cstray. The tolerance in hertz is f × ppm / 10⁶. The pulling is Cm / (2 (C0 + CL)²) per pF, and the critical transconductance gmcrit = 4 ESR (2πf)² (C0 + CL)². With the nearest E12 capacitor, the frequency error is Cm/2 (1/(C0 + CL′) − 1/(C0 + CL)): a larger CL pulls the crystal below its marked frequency.

Simple: C1 = C2 for a CL
ResultWhat it is
C1 = C2Exact (orange).
Nearest E12, CL with it, Error with itThe standard value, the CL it gives, and the frequency error in ppm.
Tolerance± Hz.
Pullingppm per pF.
gm critical, Gain margin, gm for margin 5The margin is gm / gmcrit.
Simple: C1 = C2 for a CL
MessageWhen it shows
"The standard E12 capacitor puts the crystal 11.1 ppm below its marked frequency. Use two capacitors in parallel or tune on the board."Error over 10 ppm.
"The stray capacitance is as large as the load capacitance, so no positive capacitor gives the wanted CL. Check the crystal CL and the board stray value (2 to 5 pF is usual)."C1 at or under 0.
"Load capacitors under about 5 pF are dominated by the pin and trace capacitance. Treat the result as a starting point and measure the stray capacitance."C1 under 5 pF.
"Crystals with a CL under 6 pF are very sensitive to stray capacitance."CL under 6 pF.
"The amplifier gm of 0.5 mA/V gives a gain margin of 1.5, below the 5 that AN2867 asks for. Use a crystal with a lower ESR or CL, or an amplifier with at least 1.64 mA/V."Margin under 5.
"A CL above 32 pF is unusual and makes start-up harder because the amplifier needs more gain."CL over 32 pF.

The drawing shows the crystal with C1 and C2 to ground and the CL formula. There is no placed circuit: the oscillator’s amplifier (a gate or transistor, its bias and drive resistor) is your choice. Apply to the selected crystal and capacitors (or Apply to the selected load capacitors) writes the nearest E12 value into each selected capacitor and CL into a selected crystal.

Try it
An 18 pF, 16 MHz crystal
  1. Open the crystal calculator (type crystal): CL 18 pF, 3 pF stray, 16 MHz, ESR 40 Ω, gm 5 mA/V.

You should seeC1 = C2 = 30 pF. The nearest E12 is 33 pF, which gives CL 19.5 pF and −11.1 ppm, so the amber warning suggests two capacitors in parallel. ±20 ppm is ±320 Hz, the pulling 7.94 ppm/pF, gmcrit 0.713 mA/V and the gain margin 7.0 ×.

59.2Advanced: margin, drive and budget

The crystal’s Advanced view in full screen: a 16 MHz AT-cut crystal with E12 load capacitors, the frequency error against the capacitors, the parts, the ch
Figure 59.1The crystal’s Advanced view in full screen: a 16 MHz AT-cut crystal with E12 load capacitors, the frequency error against the capacitors, the parts, the checks, the negative resistance against gm, the frequency against temperature, the budget, the Pierce oscillator and the standard values.
Advanced: margin, drive and budget
ChoiceOptionsWhat it does
CrystalMHz (AT-cut), 32.768 kHzLoads a preset: 16 MHz, CL 18 pF, ESR 40 Ω, or a tuning fork with CL 12.5 pF, ESR 50 kΩ, C0 1.2 pF, 2.5 fF, 1 µW, gm 10 µA/V, an RTC target of 20 ppm.
Load capsSuggested, TypedSuggested: the nearest value of the series to 2 (CL − Cs), SOLVED.
Advanced: margin, drive and budget
TabIts dotCards
Load capacitorsThe load and stray checks.Result, Frequency error vs load capacitors, Standard values.
Oscillator margin and driveThe margin, negative resistance and drive checks.Negative resistance vs amplifier gm, Pierce oscillator, Checks.
Frequency budgetThe budget check.Frequency budget, Frequency vs temperature, Parts.
Verify in simulationNone.Calculator vs simulation.
Advanced: margin, drive and budget
FieldUnitDefaultWhat it does
Frequency, CL, ESR max, C0, C1 motional, Drive maxMHz, pF, Ω, pF, fF, µWfrom the presetGroup Crystal (datasheet).
Tolerance, Stability, Aging 1st yr, Life±ppm, ±ppm, ±ppm, years20, 20, 3, 10The fork has no stability figure: its temperature parabola is used.
Stray, Stray unsure, Cap tol.pF, ±pF, ±%3, 1, 5Group Board and load capacitors.
C1, C2, SeriespFSOLVED, E12 or E24
Amplifier gm, Rext, Vpp at XINmA/V, Ω, V5, 0, 1Group Oscillator. gm from the MCU datasheet (or 5 × its Gm_crit_max). Vpp measured at XIN with a low-capacitance probe.
Accuracy targetUART 2 %, USB FS, Ethernet, BLE, RTC 20 ppmSets the target: 20 000, 2500, 100, 50 or 20 ppm.
T min, T max°C−20, 70

How it works it out. f(CL) = fs (1 + Cm / (2 (C0 + CL))), the relation of the engine’s crystal part. gmcrit = 4 (ESR + Rext) (2πf)² (C0 + CL)², margin ≥ 5 (ST AN2867). The negative resistance follows Vittoz, Degrauwe and Bitz (IEEE JSSC 1988) with C0 and the pin capacitance, and equals AN2867 at small gm. The start-up time is the growth from noise to full amplitude at the net negative resistance. The drive is I = 2πf Vpp Ctot / 2√2 at XIN and DL = ESR I² (AN2867). The budget adds tolerance, stability (for the fork its parabola, −0.034 ppm/K² typical), aging × (1 + log10 years), and the worst load error over the capacitor and stray tolerances.

Advanced: margin, drive and budget
ResultWhat it is
C1 = C2The series value and the exact one.
CL with themAgainst what the crystal wants.
Load errorppm, and its range with the tolerances.
Pullingppm/pF, negative: a larger CL lowers f.
Gain marginWith gmcrit. Amber under 5.
Neg. resistanceIn multiples of the ESR.
Drive levelAgainst the maximum. Red over it.
Start-upNoise to full amplitude, an estimate, or never.

The Parts card gives the ESR the crystal may have for a margin of 5, the tolerance and stability it may have for the target (or no crystal fits: TCXO), the drive rating, C1 and C2 (C0G), Rext when the drive is too high, and the layout (short traces, ground guard, no signals under the crystal). Standard values lists the series values around the exact one with their CL, error and margin.

Advanced: margin, drive and budget
CheckValue and limitPassesMarginalFails
Gain margin gm / gm_critmargin5 or more3 or moreLess: low
Negative resistance vs ESR|Rn| · ESR + Rext5 × or more3 × or moreLess
Best |Rn| any gm can givethe peak · ESR5 × or more3 × or moreLess
Drive levelDL · crystal max1.25 × marginWithin itOver
Load capacitors vs straysmaller of C1, C26 pF or moreLess: the stray rules
Load error (all tolerances)ppmUnder a quarter of the targetUnder halfMore
Frequency budget vs target± ppm · targetWithin itUp to 1.25 × itOver
Advanced: margin, drive and budget
MessageWhen it shows
"Gain margin 1.4 is below 5, so start-up over temperature and aging is uncertain. Use a crystal with ESR ≤ 40.9 Ω or a lower CL (4 pF gives margin 5), or a stronger drive setting."Margin under 5.
"Drive level 437 µW is over the crystal’s 50 µW. It ages fast and can crack. Add Rext ≈ 995 Ω (the reactance of C2, AN2867), which gives a margin of 0.2, or lower the drive setting."Over the drive limit.
"Worst-case budget ±138 ppm against the ±20 ppm target (the 32.768 kHz tuning fork loses up to 100 ppm at the temperature ends). 8.6 s/day. Calibrate in firmware or use a TCXO or a compensated RTC."Over the target (an AT-cut crystal: use ±10 ppm / ±10 ppm or a TCXO).
"The E12 capacitors give CL 19.5 pF against 18 pF, −11.1 ppm. 30 pF is the exact value. Two capacitors in parallel or the next series get closer."Load error over 5 ppm.
"gm_crit passes but the negative resistance with C0 and the pin capacitance is below 3 × ESR. Use a smaller CL."The fuller model disagrees.
Advanced: margin, drive and budget
CheckAnalysis and measurementLimit
Load error (loop resonance)AC around the loaded frequency: the loop phase of the crystal with C1 and C2 (each with 2 Cs) and the AC source in the loop±6° at the calculated frequency
Negative resistance, Start-up, Frequency spreadCalculator only
Advanced: margin, drive and budget
ButtonWhat it does
Place load circuit and run ACV1 at the loaded frequency, X1 (freq, cl, esr, c0, cm), C1 and C2 with the stray, a 1 Ω sense resistor and 1 GΩ DC paths, IN and OUT, an AC sweep of ±300 ppm. Loop phase at the loaded frequency within ±6°. The amplifier, start-up and drive are not simulated.
Apply to crystal and capsC1 into the selected capacitors, CL into a selected crystal.
Advanced: margin, drive and budget
SimpleAdvanced
CL, Stray capacitance, Frequency, ESR, C0, motional C1, Amplifier gm, ToleranceThe same fields of the Crystal, Board and Oscillator groups
Try it
A 16 MHz crystal for Ethernet
  1. Open the crystal calculator and press Advanced (16 MHz preset, E12, Ethernet ±100 ppm).
  2. Look at Frequency budget, then set Crystal to 32.768 kHz.

You should see33 pF gives CL 19.5 pF: −11.1 ppm (−23 to +3 ppm with the tolerances), margin 6.1 ×, |Rn| 243 Ω, drive 76.9 µW of 100 µW, start-up 1.93 ms. The budget is ±68.8 ppm (tolerance 20, stability 20, aging 6.0, load 22.8) against ±100: all checks pass. The tuning fork gets 22 pF, but its temperature parabola makes the budget ±138 ppm against the 20 ppm RTC target, 8.6 s/day: the budget check fails.

Sources. ST AN2867, NXP and Abracon application notes, Epson for the tuning fork, and Vittoz, Degrauwe and Bitz, IEEE JSSC 23(3) 1988. The tests check gmcrit 713.1 µA/V for 16 MHz, 40 Ω, 3 pF and 18 pF, the exact load error (33 pF: −11.1 ppm), the Vittoz curve, the fork’s parabola and 0.0864 s/day per ppm, Rext, and the placed load circuit’s zero loop phase.