← Block library

Crystal + Load Caps

@electrace/crystal-oscillator@1.0.0 · CC-BY-4.0
f 16 MHzcl 12.5 pF
The actual schematic inside this block — every part is explained below.

Crystal + Load Caps

The MCU's heartbeat. A quartz crystal resonates mechanically — like a tuning fork — at almost exactly one frequency, and the microcontroller's internal inverter amplifies that resonance into the system clock. Three parts, and two of them are capacitors that look like they do nothing.

  • Y1 — the crystal. It's cut to resonate at 16 MHz when it sees a specific capacitance (its rated CL, 12.5 pF here). Quartz is why your UART baud rate and USB timing work: tens of parts-per-million accuracy, versus a few percent for the MCU's internal RC oscillator.
  • C1, C2 — the load caps, and the part everyone gets wrong. In series as seen by the crystal: CL = (18·18)/(18+18) = 9 pF, plus ~3.5 pF of board strays ≈ the rated 12.5 pF. Wrong caps don't usually kill the oscillator — they pull it off frequency, or leave so little margin it fails at temperature extremes. "Works on my bench, dies in the field" is the classic symptom.

Why two caps and not one? The crystal plus the MCU's inverter form the actual oscillator (a Pierce oscillator); the caps complete the feedback network and set the load. The MCU datasheet's "connect a crystal" page is this exact block.

Exposes: xin/xout (to the MCU's OSC pins — order rarely matters for a passive crystal), gnd.

⚠ This is the most layout-sensitive square centimetre on the board: crystal millimetres from the MCU, caps grounded right at it, no signals routed underneath. The schematic is trivial; the placement is the engineering.

Exposed nets

xinin · signal
xoutout · signal
gndin · gnd

Inside this block

Y1
16MHz
the timebase — a quartz slab that mechanically resonates at almost exactly one frequency; the MCU's inverter turns that resonance into a clock
C1
18p
load capacitance, XIN side — with C2, presents the CL the crystal was cut for; the frequency is only exact at its rated load
C2
18p
load capacitance, XOUT side

Limits & gotchas

cl.note 0The load caps must MATCH the crystal's rated CL: CL = (C1·C2)/(C1+C2) + board strays (~3–5 pF). For this 12.5 pF crystal: 18 pF each. Wrong caps and it still oscillates — just off-frequency (your UART mysteriously garbles) or not at all in the cold.
layout.note 0Keep the crystal within millimetres of the MCU pins, caps grounded right at it, nothing noisy routed underneath. This is the most layout-sensitive square centimetre on most boards — long traces add stray C and pick up noise, and the oscillator that 'works on the bench' dies in the enclosure.
Use this block in a real design
Drop it on a canvas, wire it up, and watch the live checks — free, no card.
Start designing →
This page is generated from the block's source — the same content powers the editor's explanations and live checks.