Crystal Oscillator Selection Guide — SMD vs THT, Frequency, Tolerance & MCU Compatibility
Crystal Oscillator Selection Guide — Frequency, Load Capacitance, Tolerance, ESR & MCU Compatibility
The crystal oscillator is the timing backbone of every digital system. A microcontroller without a stable clock source cannot execute instructions reliably. A USB interface without a precise 12MHz or 48MHz reference will fail enumeration. An RTC without a 32.768kHz crystal will drift minutes per day. Despite their critical role, crystal oscillators are among the most frequently mis-specified components in an electronic BOM — wrong load capacitance, wrong tolerance, wrong ESR, or wrong package — leading to oscillator startup failures, frequency drift, and intermittent system instability.
This guide covers every parameter you need to correctly specify a crystal oscillator for your application, with specific recommendations for the most common MCU platforms and timing applications.
Crystal Oscillator Fundamentals
How a Crystal Oscillator Works
A quartz crystal resonates at a precise mechanical frequency when an alternating electric field is applied across it (the piezoelectric effect). In a crystal oscillator circuit, the crystal is connected between the XIN and XOUT pins of a microcontroller or oscillator IC, forming a feedback loop that sustains oscillation at the crystal's resonant frequency. The oscillator circuit amplifies the crystal's signal and feeds it back through the crystal, maintaining stable oscillation.
Two types of crystal resonance are used in electronics:
- Fundamental mode: The crystal resonates at its primary mechanical frequency. Used for crystals up to approximately 30–40MHz. Most accurate and most commonly used.
- Overtone mode: The crystal resonates at an odd harmonic (3rd, 5th, 7th) of its fundamental frequency. Used for frequencies above 30MHz where fundamental-mode crystals become physically too thin to manufacture reliably. Requires a more complex oscillator circuit.
Crystal vs. Oscillator Module — Key Distinction
Two distinct product types are commonly called "crystal oscillators":
- Crystal resonator (passive): A bare quartz crystal in a package (HC-49S, 3225 SMD, etc.). Requires an external oscillator circuit (typically built into the MCU's XIN/XOUT pins). Lower cost, smaller size, requires correct load capacitor selection.
- Oscillator module (active): A complete oscillator circuit in a 4-pin package (DIP-14, SMD 5×7mm, etc.) with VCC, GND, output, and enable pins. Outputs a square wave clock signal directly. Higher cost, larger size, but no external components required and guaranteed startup.
This guide focuses primarily on passive crystal resonators, which are used in the vast majority of MCU-based designs.
Key Specification Parameters
1. Nominal Frequency
The frequency at which the crystal is designed to resonate, specified in Hz, kHz, or MHz. Common frequencies and their applications:
- 32.768 kHz: RTC (real-time clock) crystal. The frequency is exactly 2¹⁵ Hz, which divides evenly to 1Hz for timekeeping. Used in DS3231, PCF8563, STM32 RTC, and virtually every battery-backed timekeeping circuit. Package: cylindrical 2×6mm (through-hole) or 3215/2012 SMD.
- 8 MHz: Arduino Uno (3.3V variant), Arduino Pro Mini (3.3V), many low-power MCU designs. Also the internal RC oscillator calibration reference for many MCUs.
- 12 MHz: USB full-speed (12 Mbps) reference. Required for USB-capable MCUs (PIC18F, LPC1xxx, STM32F1 without internal PLL) to generate the 48MHz USB clock via PLL.
- 16 MHz: Arduino Uno (5V), Arduino Nano, Arduino Mega 2560. The most common Arduino crystal frequency.
- 20 MHz: PIC microcontrollers (many PIC18F series), some AVR designs.
- 24 MHz: STM32 designs using 24MHz as PLL input for 48MHz USB or 72MHz system clock.
- 25 MHz: Ethernet PHY reference clock (LAN8720, DP83848, W5500). Required for 10/100 Ethernet interfaces.
- 26 MHz / 27 MHz: GSM/GPRS module reference (SIM800, SIM900). Required for cellular modem designs.
- 40 MHz / 26 MHz: ESP8266 and ESP32 WiFi SoC reference clock. ESP8266 uses 26MHz; ESP32 uses 40MHz.
- 48 MHz: USB full-speed direct reference (no PLL required). Used in some USB-capable MCUs.
- 50 MHz / 125 MHz: Gigabit Ethernet PHY reference. Required for 1000BASE-T interfaces.
🛒 Need crystals in stock? Prototype-to-Production — Crystal Oscillators 32.768kHz to 200MHz, SMD & THT, Single Unit to Reel
2. Load Capacitance (CL)
Load capacitance is the most critical and most frequently misunderstood crystal specification. It defines the total capacitance that the crystal sees across its terminals in the oscillator circuit, and it directly determines the actual oscillation frequency.
Why load capacitance matters: A crystal specified for CL = 12pF will oscillate at its nominal frequency only when the total capacitance across its terminals is exactly 12pF. If the actual load capacitance is different, the crystal will oscillate at a slightly different frequency — this is called frequency pulling, and it can cause significant frequency error in precision timing applications.
How to calculate the required external capacitors:
The standard Pierce oscillator circuit (used in virtually all MCU crystal oscillator circuits) uses two capacitors (C1 and C2) from each crystal terminal to ground. The relationship between the external capacitors and the crystal's load capacitance is:
CL = (C1 × C2) / (C1 + C2) + Cstray
Where Cstray is the parasitic capacitance of the PCB traces and MCU pins (typically 2–5pF). For equal capacitors (C1 = C2 = C):
CL = C/2 + Cstray
Therefore: C = 2 × (CL − Cstray)
Example: Crystal with CL = 12pF, Cstray = 3pF: C = 2 × (12 − 3) = 18pF. Use 18pF capacitors for C1 and C2.
Common load capacitance values:
- 6pF: Low-load crystals for low-power MCU designs; requires smaller external capacitors (typically 8–12pF)
- 8pF: Common for 32.768kHz RTC crystals and some SMD crystals
- 12pF: Most common for general-purpose MCU crystals (Arduino, STM32, PIC)
- 16pF: Common for HC-49S through-hole crystals
- 18pF / 20pF: Higher load capacitance; less sensitive to stray capacitance variation
Critical rule: Always check the MCU datasheet for the recommended crystal load capacitance and external capacitor values. Many MCUs specify the exact crystal parameters and external component values in their oscillator design guidelines. Do not assume — verify.
3. Frequency Tolerance & Stability
Crystal frequency accuracy is specified in two parameters:
- Initial tolerance (at 25°C): The maximum frequency deviation from nominal at room temperature, expressed in ppm (parts per million). Common values: ±10ppm, ±20ppm, ±30ppm, ±50ppm. 1ppm = 1Hz error per 1MHz of nominal frequency.
- Temperature stability: The maximum frequency deviation over the operating temperature range. Specified as ppm over the temperature range (e.g., ±30ppm from −40°C to +85°C).
Tolerance requirements by application:
- General MCU clock (±50ppm): Adequate for most microcontroller applications where the clock is used only for instruction execution and internal timing. Arduino, basic embedded systems.
- UART communication (±30ppm): UART requires clock accuracy within ±2% of the baud rate for reliable communication. ±30ppm is adequate for most UART applications.
- USB full-speed (±500ppm total budget): USB 2.0 full-speed allows ±500ppm total clock error. A ±50ppm crystal with ±30ppm temperature stability is well within this budget.
- Ethernet (±50ppm): 10/100 Ethernet PHY requires ±50ppm or better. Gigabit Ethernet requires ±30ppm.
- RTC timekeeping (±20ppm): ±20ppm at 32.768kHz = ±0.6 seconds per day drift. For precision timekeeping, use ±10ppm or a temperature-compensated crystal (TCXO).
- GPS / cellular (±2.5ppm): GPS and cellular modems require TCXO-grade stability. Standard crystals are not adequate.
4. Equivalent Series Resistance (ESR)
ESR is the resistive loss of the crystal at resonance. It determines how much gain the oscillator circuit must provide to sustain oscillation. If the oscillator circuit's negative resistance (gain) is less than the crystal's ESR, the oscillator will not start.
ESR increases with: Higher frequency (above ~20MHz), smaller crystal package (SMD crystals have higher ESR than HC-49S), lower load capacitance, and aging.
ESR specification rule: The MCU's oscillator circuit must provide negative resistance at least 5× the crystal's maximum ESR for reliable startup across temperature and manufacturing variation. Check the MCU datasheet for the maximum crystal ESR it can drive.
Typical ESR values:
- 32.768kHz crystals: 30kΩ–70kΩ (very high ESR — requires MCU oscillator specifically designed for RTC crystals)
- 4–16MHz HC-49S: 30–80Ω
- 16–32MHz HC-49S: 50–150Ω
- 3225 SMD (4–16MHz): 50–120Ω
- 2016 SMD (16–32MHz): 80–200Ω
- 1612 SMD (above 24MHz): 100–300Ω
5. Package Selection — SMD vs. Through-Hole
Through-Hole Crystal Packages
- HC-49S (low profile): Industry standard through-hole crystal; 4.5mm height; 4–40MHz; ±30ppm standard; excellent ESR characteristics; easy to hand-solder; most widely available. The default choice for prototype and low-volume designs.
- HC-49U (full height): Taller variant (13mm); legacy designs and high-vibration environments; being phased out in favor of HC-49S and SMD.
- Cylindrical (2×6mm): 32.768kHz RTC crystal; watch crystal form factor; radial through-hole; standard for battery-backed RTC circuits.
SMD Crystal Packages
- 3225 (3.2×2.5mm): Most common SMD crystal package; 4–40MHz; good ESR characteristics; compatible with standard pick-and-place; recommended for production SMD designs.
- 2520 (2.5×2.0mm): Compact SMD; 4–40MHz; slightly higher ESR than 3225; good for space-constrained designs.
- 2016 (2.0×1.6mm): Ultra-compact SMD; 16–48MHz; higher ESR; for IoT and wearable designs where space is critical.
- 1612 (1.6×1.2mm): Miniature SMD; Bluetooth, WiFi module timing; highest ESR; requires careful oscillator circuit design.
- 3215 / 2012 SMD: 32.768kHz RTC crystals in SMD package; for all-SMD board designs.
MCU-Specific Crystal Selection Guide
Arduino Uno / Nano / Mega (ATmega328P / ATmega2560)
- Frequency: 16MHz (5V operation); 8MHz (3.3V operation — ATmega328P maximum at 3.3V is 8MHz)
- Load capacitance: 12–22pF (check specific MCU datasheet; ATmega328P recommends 12–22pF)
- External capacitors: 22pF typical for CL=18pF with ~3pF stray
- ESR maximum: 300Ω (ATmega328P oscillator can drive up to 300Ω ESR)
- Tolerance: ±50ppm adequate for most applications; ±30ppm for UART-heavy designs
- Package: HC-49S for prototyping; 3225 SMD for production
- Recommended MPN example: ABM3-16.000MHZ-D2Y-T (Abracon, 16MHz, 3225 SMD, 18pF, ±30ppm)
STM32 (STM32F1, STM32F4, STM32H7 series)
- HSE (High-Speed External) crystal: 4–26MHz depending on series; STM32F103 typically uses 8MHz with PLL to 72MHz system clock; STM32F4 uses 8–25MHz
- LSE (Low-Speed External) crystal: 32.768kHz for RTC
- HSE load capacitance: Typically 5–25pF; check specific STM32 datasheet and application note AN2867
- LSE load capacitance: 6–7pF typical for STM32 RTC crystal; use 6pF CL crystal with 6–8pF external capacitors
- HSE ESR maximum: Varies by series; STM32F103 can drive up to 200Ω ESR
- Critical note: STM32 AN2867 ("Oscillator design guide for STM8AF/AL/S and STM32 microcontrollers") is the definitive reference for STM32 crystal selection. Always consult this document.
- Common HSE frequencies: 8MHz (STM32F103 Blue Pill), 12MHz (USB without PLL), 25MHz (Ethernet PHY co-clock)
ESP8266 & ESP32
- ESP8266: 26MHz crystal; CL = 10pF; external capacitors 10pF; ESR < 100Ω; 3225 or 2520 SMD package
- ESP32: 40MHz crystal; CL = 10pF; external capacitors 10pF; ESR < 60Ω; 3225 SMD package recommended
- Critical note: ESP32 is sensitive to crystal ESR. Use crystals with ESR < 60Ω at 40MHz. High-ESR crystals cause startup failures, especially at low temperature. Espressif recommends specific crystal models in their hardware design guidelines.
- Tolerance: ±10ppm recommended for WiFi applications; ±30ppm minimum
Raspberry Pi Pico (RP2040)
- Frequency: 12MHz
- Load capacitance: 10pF (RP2040 datasheet specifies CL = 10pF)
- External capacitors: 15pF (accounting for ~2.5pF stray)
- ESR maximum: 150Ω
- Package: 3225 SMD
- Tolerance: ±30ppm
RTC Applications (DS3231, PCF8563, STM32 LSE)
- Frequency: 32.768kHz
- Load capacitance: 6pF (DS3231 internal capacitors) or 7pF (PCF8563); check IC datasheet
- External capacitors: DS3231 has internal load capacitors — no external capacitors required. PCF8563 requires external capacitors.
- ESR maximum: 50kΩ typical for RTC oscillator circuits
- Tolerance: ±20ppm for ±0.6 sec/day drift; ±10ppm for ±0.3 sec/day; TCXO for <±0.1 sec/day
- Package: Cylindrical 2×6mm (through-hole) or 3215/2012 SMD
- Critical note: DS3231 has a built-in TCXO and does not use an external crystal — it is a complete RTC module. DS1307 and PCF8563 require an external 32.768kHz crystal.
Active Oscillator Modules — When to Use Them
Active oscillator modules (4-pin packages with VCC, GND, CLK output, and optional enable) are preferable to passive crystals in specific situations:
- Frequencies above 30MHz: Above 30MHz, passive crystals operate in overtone mode and require a more complex oscillator circuit. An active oscillator module provides a clean fundamental-mode output at any frequency up to 200MHz+.
- Multiple clock domains: When multiple ICs need the same clock reference, an active oscillator module with a buffered output drives multiple loads without the loading effects that degrade passive crystal performance.
- Guaranteed startup: Active oscillator modules are guaranteed to start under all specified conditions. Passive crystal circuits can fail to start if the oscillator circuit gain is marginal, especially at low temperature.
- TCXO / VCXO requirements: Temperature-compensated (TCXO) and voltage-controlled (VCXO) oscillators are available only as active modules. Required for GPS, cellular, and precision timing applications.
Active oscillator module types:
- Standard oscillator (XO): Fixed frequency, no temperature compensation; ±50–100ppm; DIP-14 or SMD 5×7mm / 3.2×2.5mm
- TCXO: Temperature-compensated; ±2.5ppm over −40°C to +85°C; for GPS, cellular, precision timing
- VCXO: Voltage-controlled frequency; for PLL and frequency synthesis applications
- OCXO: Oven-controlled; ±0.01ppm; for laboratory and telecom applications
Crystal Oscillator PCB Layout Guidelines
Even a correctly specified crystal will fail to perform if the PCB layout is poor. Follow these layout rules:
- Place crystal close to MCU: Minimize trace length between crystal and XIN/XOUT pins. Long traces increase stray capacitance and susceptibility to noise. Target <5mm trace length.
- Keep load capacitors close to crystal: Place C1 and C2 immediately adjacent to the crystal terminals, not adjacent to the MCU pins.
- Ground guard ring: Surround the crystal and load capacitors with a ground guard ring connected to the PCB ground plane. This shields the high-impedance oscillator circuit from external noise.
- No signal traces under crystal: Do not route signal traces under the crystal footprint. The crystal body acts as an antenna and can couple noise into the oscillator circuit.
- Separate ground plane: Connect the crystal circuit ground (guard ring, capacitor grounds) to the analog ground plane, not the digital ground plane, to minimize digital switching noise coupling.
- Avoid vias in oscillator circuit: Vias add inductance and capacitance to the oscillator circuit. Route the crystal circuit entirely on one PCB layer where possible.
Frequently Asked Questions
My oscillator is not starting. What should I check first?
Check in this order: (1) Verify load capacitor values match the crystal's CL specification. (2) Verify the crystal's ESR is within the MCU oscillator's drive capability. (3) Check PCB layout — long traces, missing guard ring, or signal traces under the crystal are common causes. (4) Verify the crystal is not damaged — crystals can be damaged by ESD or excessive soldering heat. (5) Check the MCU oscillator configuration registers — many MCUs require the oscillator to be explicitly enabled in firmware.
Can I use a 16MHz crystal rated for 18pF load capacitance with 22pF external capacitors?
Using larger external capacitors than specified increases the effective load capacitance, which pulls the oscillation frequency slightly below nominal (typically a few ppm). For most applications this is acceptable. For precision timing, use the exact capacitor values calculated from the CL specification.
What is the difference between a crystal and a ceramic resonator?
A ceramic resonator uses a piezoelectric ceramic material instead of quartz. Ceramic resonators are cheaper and have built-in load capacitors, but their frequency tolerance is much worse (±0.5% = ±5000ppm) compared to quartz crystals (±30ppm). Ceramic resonators are acceptable for non-critical timing (basic Arduino sketches) but not for UART, USB, Ethernet, or any application requiring better than ±1% frequency accuracy.
Why does my RTC drift even with a 32.768kHz crystal?
RTC drift has several causes: (1) Crystal frequency tolerance — a ±20ppm crystal drifts up to ±0.6 seconds per day. (2) Temperature coefficient — 32.768kHz crystals have a parabolic frequency-temperature curve with a peak near 25°C; at temperatures away from 25°C, the frequency drops. (3) Incorrect load capacitance — wrong external capacitors pull the frequency off nominal. (4) PCB stray capacitance — unaccounted stray capacitance changes the effective load. For precision RTC, use a TCXO-based RTC module (DS3231) or calibrate the crystal frequency at your operating temperature.
Can I use the same crystal for both the HSE and LSE on an STM32?
No. The HSE (high-speed external) and LSE (low-speed external) oscillators on STM32 use different crystal frequencies — typically 8–25MHz for HSE and 32.768kHz for LSE. They are separate oscillator circuits with separate XIN/XOUT pins and require separate crystals.
Summary
Crystal oscillator selection requires specifying five key parameters correctly: nominal frequency (matched to your MCU and application), load capacitance (matched to the crystal specification and calculated external capacitors), frequency tolerance (matched to your communication and timing accuracy requirements), ESR (within the MCU oscillator's drive capability), and package (matched to your assembly process and board space constraints).
The most common crystal selection mistakes are: wrong load capacitance leading to frequency error, ESR too high for the MCU oscillator to drive reliably, and poor PCB layout causing noise coupling and startup failures. Consult your MCU's oscillator design guidelines (e.g., STM32 AN2867, Espressif hardware design guidelines) before finalizing your crystal selection.
🛒 Source crystal oscillators from Keszoox — Crystal Oscillators 32.768kHz to 200MHz — SMD & THT, Single Unit to Full Reel · Full Catalog — IC Chips, Timing Components, 360-Day Warranty · Spot Stock & BOM Matching — Speed Quote in 24H · Browse All Supply Chain Services