Crystal Load Capacitor Calculation: Is 22 pF Right?

Selection Guides and Comparisons Advanced 10 min read Published:
Crystal selection and load capacitor calculation: crystal and two load capacitors (C1, C2) symbol

The load capacitors next to a crystal are calculated from the load capacitance (CL) in the crystal’s datasheet: for two equal capacitors, use C = 2 × (CL − Cstray). Cstray is the stray capacitance added by the IC pins and PCB traces, and most designs assume 3–5 pF. That makes 22 pF the right answer only for crystals with a CL of about 14–16 pF. A crystal with CL = 12 pF needs about 15–18 pF, and a crystal with CL = 18 pF needs about 27–33 pF.

In most microcontroller projects, especially older PIC and AVR designs, 22 pF on both crystal pins has become a habit. The circuit usually works, because the oscillator tolerates a small load mismatch. But the frequency can shift by anywhere from a few ppm to a few tens of ppm, and in low-gain oscillators the oscillation can stop in the cold or as the crystal ages. This guide walks through the calculation step by step using two crystals from the store: the 10 MHz Abracon AB308-10.000MHZ-18-R60 with CL = 18 pF and the 16 MHz KYX K26160001210 with CL = 12 pF. For cases where a crystal cannot deliver the required accuracy, we also look at a TCXO, the Epson TG2520SMN 26 MHz.

Why does a crystal need capacitors?

The crystal oscillator in a microcontroller is usually a Pierce oscillator. Inside the IC there is an inverting amplifier (inverter) and a feedback resistor (Rf) that keeps it in its linear region. The crystal connects between the XIN (OSC_IN) and XOUT (OSC_OUT) pins, and capacitors C1 and C2 go from these two pins to ground. Together, the crystal and the two capacitors provide the additional 180-degree phase shift, and the circuit oscillates in the crystal’s very narrow parallel-resonance region.

A crystal operating in parallel mode is measured and trimmed by the manufacturer at a specific load capacitance. “16.000 MHz, CL = 12 pF” in a datasheet means this: the crystal oscillates at 16.000 MHz when it sees a 12 pF load across its terminals. With a larger load the frequency moves slightly below nominal, and with a smaller load slightly above. The purpose of the capacitor calculation is to present the crystal with the load stated in its datasheet.

Pierce crystal oscillator circuit: inverter and Rf inside the microcontroller, crystal between XIN and XOUT, C1 and C2 from the two pins to ground, optional series resistor Rs
Pierce oscillator. The load the crystal sees is the series combination of C1 and C2 plus the total stray capacitance from the board and pins (Cstray, shown in parallel with the crystal).

How to calculate crystal load capacitors: the CL formula

Seen from the crystal’s terminals, C1 and C2 are in series, and the stray capacitance adds in parallel to that series combination:

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

When C1 = C2 = C, the series combination becomes C/2 and the formula becomes:

C = 2 × (CL − Cstray)

Cstray covers the input capacitance of the XIN and XOUT pins, the PCB traces to the crystal and the solder pads. Its value depends on the IC and the layout, and 3–5 pF is the typical assumption. Some microcontroller datasheets give the pin capacitance or a recommended capacitor range directly; if yours does, use that first.

Worked example: 12 pF and 18 pF crystals

The table below shows the capacitor values calculated for the two crystals with Cstray = 3 pF and 5 pF, and the load the crystal sees when 22 pF is used. Standard values are taken from the E12 series (10, 12, 15, 18, 22, 27, 33 pF).

Crystal Datasheet CL Cstray Calculated C Selected C Resulting load Load with 22 pF
K26160001210 (16 MHz) 12 pF 3 pF 18 pF 18 pF 12 pF 14 pF
K26160001210 (16 MHz) 12 pF 5 pF 14 pF 15 pF 12.5 pF 16 pF
AB308-10.000MHZ-18-R60 (10 MHz) 18 pF 3 pF 30 pF 27 or 33 pF 16.5 / 19.5 pF 14 pF
AB308-10.000MHZ-18-R60 (10 MHz) 18 pF 5 pF 26 pF 27 pF 18.5 pF 16 pF

Two conclusions follow from the table. On the 12 pF crystal, 22 pF creates 2–4 pF more load than required, and the frequency shifts below nominal. On the 18 pF crystal, 22 pF means too little load, and the frequency rises above nominal. In both cases the shift is usually between a few ppm and a few tens of ppm; the amount depends on the crystal’s internal parameters, which these two datasheets do not give. Some manufacturers list the motional capacitance (C1) or the pullability in ppm per pF in the datasheet. UART communication easily tolerates this much shift, but in an RTC application that keeps time or in an RF circuit with narrow channel spacing, the difference is noticeable.

Comparison of the 14–16 pF load a crystal sees with 22 pF capacitors against the load required by 12 pF and 18 pF crystals
With Cstray at 3–5 pF, two 22 pF capacitors present a 14–16 pF load to the crystal. That range matches neither the 12 pF crystal nor the 18 pF crystal.

Parameters to check when choosing a crystal

Before calculating the capacitors, you need to choose the right crystal. The main datasheet parameters to check, with the values of the two crystals:

Parameter AB308-10.000MHZ-18-R60 K26160001210 What it means
Frequency and mode 10 MHz, fundamental 16 MHz, fundamental Microcontroller oscillators expect a fundamental-mode crystal.
Load capacitance (CL) 18 pF 12 pF The input to the C1 and C2 calculation.
Frequency tolerance (25 °C) ±30 ppm ±10 ppm (20 ±2 °C) Production deviation at room temperature.
Temperature stability ±50 ppm (−10…+60 °C) ±20 ppm (range not specified) Additional deviation with temperature.
ESR (max.) 60 Ω 60 Ω A low value helps the oscillation start easily.
Shunt capacitance C0 (max.) 5 pF 7.0 pF Enters the gain margin calculation.
Drive level 100 µW 100 µW The power the crystal is allowed to dissipate.
Aging (first year) ±5 ppm ±5 ppm Frequency change over time.
Package Cylindrical, 8.0 × Ø3.0 mm Cylindrical, Ø2 × 6 mm Through-hole, radial leads.

In the AB308 series, CL is given by the number in the part number: “-18-” means 18 pF. The series datasheet also offers an “S” (series resonance) option instead. If a crystal trimmed for series resonance is used in a Pierce oscillator, the load capacitors push the frequency above nominal. In the same series, crystals from 40.001 to 70 MHz are 3rd-overtone crystals; without an additional LC circuit, these tend to oscillate at their fundamental frequency in a microcontroller oscillator.

Can the oscillator drive the crystal? Gain margin calculation

Choosing the right capacitors does not mean the oscillator will start reliably. As the crystal’s losses (ESR) and capacitances grow, the transconductance (gm) the oscillator amplifier must provide increases. The critical transconductance formula commonly used in application notes is:

gm_crit = 4 × ESR × (2πf)² × (C0 + CL)²

Let’s calculate with the worst-case datasheet values:

  • K26160001210: 4 × 60 Ω × (2π × 16 MHz)² × (7 pF + 12 pF)² ≈ 0.88 mA/V
  • AB308-10.000MHZ-18-R60: 4 × 60 Ω × (2π × 10 MHz)² × (5 pF + 18 pF)² ≈ 0.50 mA/V

Gain margin is the ratio of the oscillator’s actual gm to this critical value. The common recommendation is at least 5, which means an oscillator transconductance of about 4.4 mA/V for the 16 MHz crystal and 2.5 mA/V for the 10 MHz crystal. The oscillator’s gm is given in the microcontroller datasheet; some manufacturers list the highest supported ESR and CL values instead. The formula also shows that the required transconductance grows with the square of the (C0 + CL) sum: fitting larger capacitors than necessary on a low-power oscillator is a common reason why oscillation fails to start.

Drive level and series resistor

Both crystal datasheets give a drive level of 100 µW; for the AB308 this value is the upper limit. The power dissipated in the crystal is approximately P = I² × ESR, where I is the RMS current through the crystal. A high-gain oscillator can drive the crystal above this level. Exceeding this value accelerates aging and can damage the crystal in the long run. In that case a series resistor (Rs) is added at the XOUT pin; its value is set by the microcontroller manufacturer’s application note or by measurement. Since Rs also lowers the gain margin, both calculations should be checked together.

What does a frequency error in ppm mean?

1 ppm is one millionth of the 86,400 seconds in a day, an error of 0.0864 seconds per day. On this scale, the worst case for the two crystals works out as follows:

  • AB308-10.000MHZ-18-R60: ±30 ppm tolerance + ±50 ppm over temperature = ±80 ppm, about 6.9 seconds per day.
  • K26160001210: ±10 ppm tolerance + ±20 ppm over temperature = ±30 ppm, about 2.6 seconds per day.

Add ±5 ppm of aging for the first year, plus any shift caused by a wrong capacitor choice. For asynchronous interfaces such as UART, or interfaces that carry their own clock such as SPI, either crystal is more than adequate. USB full-speed (12 Mbit/s) communication requires ±0.25%, that is ±2500 ppm, and that limit is also far away from both crystals. In circuits that keep time, count frequency, or serve as the reference in GNSS and RF receivers, however, even a few ppm of error matters.

Crystal or TCXO?

When stability of a few ppm or better is required, a temperature-compensated crystal oscillator (TCXO) is used instead of working with a crystal and capacitors. A TCXO combines the crystal, the oscillator and the temperature compensation circuit in one package; no external load capacitors are needed.

The Epson TG2520SMN 26.000000 MHz MCGNNM is a TCXO in a 2.5 × 2.0 × 0.8 mm package. According to its datasheet, its frequency/temperature deviation is ±0.5 ppm over −40…+85 °C, and its tolerance at 25 °C is ±0.5 ppm before soldering and ±1.5 ppm after two reflow cycles. The supply range is 2.66–3.465 V, and current consumption is 1.5 mA max.

Keep two points in mind when using it. The output is a clipped sine wave with an amplitude of at least 0.8 V peak-to-peak; it is not a full-swing CMOS signal. The datasheet requires an external DC-cut (coupling) capacitor of at least 0.01 µF on the output and specifies its characteristics with a 10 kΩ // 10 pF load. Check in its own datasheet that the external clock input of the IC you will feed accepts an AC-coupled, low-amplitude signal.

For other options in the store, browse the crystals and oscillators categories.

Capacitor and PCB layout considerations

  • Dielectric: Use C0G (NP0) dielectric ceramic capacitors for C1 and C2. The capacitance of dielectrics such as X7R and Y5V changes with temperature and voltage, which moves the frequency.
  • Tolerance: A ±5% capacitor means ±1.1 pF at 22 pF. Choose a tight-tolerance value for precision applications.
  • Proximity: Place the crystal and capacitors as close to the IC pins as possible. Long traces increase Cstray and pick up noise.
  • Ground: Connect the ground ends of the capacitors by a short path to a point near the IC’s ground pin. Do not route fast-switching signal traces under or around the crystal.

Common mistakes

  1. Fitting 22 pF to every crystal. A capacitor chosen without reading the CL value shifts the frequency and can reduce the gain margin.
  2. Choosing the capacitor equal to CL. Fitting 12 pF to a crystal with CL = 12 pF makes the load 6 pF + Cstray because of the series connection, that is 9–11 pF; the crystal sees less load than it needs and the frequency shifts up.
  3. Ignoring Cstray. 3–5 pF looks small, but it is a large share of a 12 pF target.
  4. Using a series-resonant crystal in a Pierce circuit. Crystals with “S” instead of CL in the part number are not trimmed for this circuit.
  5. Connecting an overtone crystal directly to a microcontroller. Without an additional LC circuit, a 3rd-overtone crystal can oscillate in its fundamental mode at about one third of its marked frequency.
  6. Measuring the frequency with a probe directly at the pin. When an oscilloscope probe of about 10 pF touches XIN or XOUT, it changes the load, and the frequency you measure does not show the real value. If the microcontroller has a clock output (MCO, CLKOUT), measure there.

Frequently asked questions

Can I use 15 pF instead of 22 pF for crystal capacitors?

If the crystal’s CL is around 12 pF, 15 pF is the better choice. The rule is to calculate the value with C = 2 × (CL − Cstray) and take the nearest standard value. Instead of changing the value blindly, check the CL in the crystal’s datasheet.

Will the crystal work without capacitors?

Sometimes it oscillates with stray capacitance alone, but the frequency shifts above nominal and the oscillation is not reliable. In a permanent design, C1 and C2 should always be fitted. On some microcontrollers the load capacitance can be adjusted inside the IC; in that case external capacitors may not be needed, and the IC’s datasheet will say so.

What should I do if I don’t know the crystal’s CL?

The part number or the manufacturer’s datasheet gives the CL. If that information is missing, start with the capacitor value recommended by the microcontroller manufacturer and check the frequency by measuring at the clock output. Do not use a crystal with an unknown CL in a precision application.

Can C1 and C2 have different values?

Yes. The formula also holds for different values, and some application notes recommend a slightly larger capacitor on the XOUT side to adjust the gain margin. Unless there is a specific reason, equal values make the calculation and sourcing easier.

Is a crystal enough instead of a TCXO?

For the microcontroller clock, UART, SPI and USB full-speed, a crystal with ±30–80 ppm is enough. In applications that need stability of a few ppm or better, such as timekeeping devices, frequency counters, GNSS and narrowband RF circuits, a TCXO is preferred.

Conclusion

To choose crystal capacitors, first read the crystal’s CL value, then calculate with C = 2 × (CL − Cstray) and take the nearest standard value. 22 pF is correct only for crystals with a CL of about 14–16 pF; a 12 pF crystal needs about 15–18 pF, and an 18 pF crystal about 27–33 pF. Next, check that the microcontroller’s oscillator can drive the crystal with sufficient gain margin. If you need stability of a few ppm or better, use a TCXO instead of a crystal.

For a different take on timing circuits, see the 555 timer astable frequency calculation article, and for another calculation around the microcontroller, see the I2C pull-up resistor calculation article.

K26160001210KYX · EE02134-15$0.1849 In StockView

References

Ask Claude or ChatGPT about the parts in this article and their alternatives: your assistant brings them from our catalog with stock and prices.

How do I connect?

Products in this article

More from Selection Guides and Comparisons

For AI assistants

Search our catalog with Claude or ChatGPT

You came here from an AI assistant. Connect Claude or ChatGPT to Entegreci once, and it searches our catalog for the parts you ask about and brings back products with their availability, current price and a link.

“Is the 1N5819 in stock, and what could I use instead?”

Free for members. The assistant only reads the catalog; it can't place orders or see your account details.