0
0
Embedded-cHow-ToBeginner · 4 min read

How to Design Crystal Oscillator Circuit in PCB Design

To design a crystal oscillator circuit in PCB design, place the crystal close to the oscillator IC pins and use short, direct traces to minimize noise. Add load capacitors as specified, ensure a solid ground plane, and keep the layout compact to maintain signal integrity and stable oscillation.
📐

Syntax

A crystal oscillator circuit in PCB design typically includes the following parts:

  • Crystal: The frequency-determining component.
  • Load Capacitors: Connected to each crystal pin to ground, they stabilize oscillation.
  • Oscillator IC or Inverter: Drives the crystal to oscillate.
  • Ground Plane: Provides a low-noise reference.
  • Trace Layout: Short and direct connections to reduce interference.

Each part must be placed and connected carefully to ensure proper function.

plaintext
Crystal Oscillator Circuit Layout Syntax:

[Oscillator IC Pin] --- [Crystal] --- [Oscillator IC Pin]
       |                 |
   [Load Cap C1]     [Load Cap C2]
       |                 |
     Ground           Ground

Key points:
- Load capacitors connect crystal pins to ground.
- Crystal is close to IC pins.
- Ground plane under the circuit.
💻

Example

This example shows a simple 16 MHz crystal oscillator circuit layout for a microcontroller on a PCB.

The crystal is placed very close to the MCU oscillator pins. Two 22 pF capacitors connect each crystal pin to ground. The ground plane is continuous under the oscillator area. Traces are kept short and direct.

plaintext
Component Placement:
- Crystal (16 MHz) between MCU pins XTAL1 and XTAL2
- Capacitor C1 (22 pF) from XTAL1 to ground
- Capacitor C2 (22 pF) from XTAL2 to ground

PCB Layout Guidelines:
- Place crystal within 5 mm of MCU pins
- Use short, direct traces (<10 mm)
- Keep ground plane solid and continuous under crystal and capacitors
- Avoid routing other signals near oscillator traces

Schematic snippet:

MCU XTAL1 --- Crystal --- MCU XTAL2
   |              |
  C1             C2
   |              |
 Ground         Ground
Output
A stable 16 MHz oscillation signal at MCU oscillator pins with minimal noise and startup delay.
⚠️

Common Pitfalls

  • Long or wide traces: Increase noise and reduce oscillator stability.
  • Placing crystal far from IC: Causes signal degradation and startup issues.
  • Missing or incorrect load capacitors: Oscillator may not start or run at wrong frequency.
  • Poor grounding: Leads to interference and unstable oscillation.
  • Routing other signals near oscillator traces: Causes crosstalk and noise.

Always double-check component values and layout proximity.

plaintext
Wrong layout example:

MCU XTAL1 ---[long trace]--- Crystal ---[long trace]--- MCU XTAL2
   |                                |
  C1 (missing)                  C2 (wrong value)
   |                                |
 Ground                         No ground plane

Right layout example:

MCU XTAL1 --- Crystal --- MCU XTAL2
   |              |
  C1 (22 pF)    C2 (22 pF)
   |              |
 Ground plane under all components
📊

Quick Reference

Design TipDescription
Place crystal close to IC pinsKeep distance under 5 mm to reduce noise.
Use correct load capacitorsTypical values 18-22 pF as per crystal datasheet.
Keep traces short and directMinimize trace length to under 10 mm.
Use solid ground planeProvides stable reference and reduces interference.
Avoid routing signals near oscillatorPrevents crosstalk and noise coupling.

Key Takeaways

Place the crystal and load capacitors very close to the oscillator IC pins.
Use short, direct traces and a solid ground plane to ensure stable oscillation.
Select load capacitor values according to the crystal datasheet for correct frequency.
Avoid routing other signals near the oscillator circuit to reduce noise.
Double-check layout and component placement to prevent startup and stability issues.