Many hardware engineers treat a crystal oscillator as an ordinary small resistor and place it casually during PCB layout. Only after the board comes back do they discover that clock jitter exceeds the specification, the oscillator fails to start at low temperatures, or EMC radiation testing fails—and the rework cost multiplies several times over. Crystal oscillator routing has never been the simple task of “just connecting two wires and making them conduct.” By avoiding these five major layout taboos, the crystal oscillator circuit you design can start oscillating stably over a wide temperature range from -40°C to 85°C, with clock margin maximized.
-
First Major Taboo: Casually Placing the Crystal Oscillator at the Board Edge, Far from the MCU Clock Pin
The pitfall beginners most easily fall into is placing the crystal oscillator in an empty area at the PCB edge, routing a long loop to the MCU clock pin, and ultimately leaving a bunch of hidden faults. I once saw a mass-production board for an industrial gateway. To make the layout look nice, the engineer placed a 32 MHz crystal oscillator at a board-edge location 60 mm away from the MCU. As a result, during high-temperature aging, 30% of the boards exhibited out-of-spec clock drift. The correct approach is that the crystal oscillator must be placed tightly against the MCU clock input pin, with the center-to-center distance controlled within 10 mm. It should preferably be placed on the top layer on the same side as the main controller. It must absolutely not be placed at the board edge or near screw holes, nor should it be routed across layers, so as to avoid mechanical stress pulling on the crystal blank and to reduce parasitic inductance introduced by traces.
For a BGA-packaged main controller, preferentially choose an empty board area close to the clock input solder ball for the crystal oscillator. Do not route it to the back side of the BGA, so as to avoid additional signal attenuation introduced by long traces.
-
Second Major Taboo: Placing Load Capacitors Separately, Creating Long Loops in Routing
Many people know that the crystal oscillator should be close to the MCU, but they casually place the two matching load capacitors elsewhere on the PCB, ultimately causing the parasitic inductance of the oscillation loop to directly double. In a mass-production case of an industrial controller, the engineer used NPO capacitors with a nominal 1% tolerance but placed the capacitors 20 mm away from the crystal pins. As a result, 200 ps of extra jitter was captured on the clock signal, and the synchronization accuracy of the entire unit directly failed to meet the specification. The correct approach is that the two load capacitors must be placed tightly adjacent to the two output pins of the crystal. The ground pin of each capacitor should be connected directly to the main ground plane through a nearby via, forming a compact pi filter structure and minimizing the loop area formed by the crystal, the two capacitors, and the MCU internal oscillation loop.
Absolutely do not route the capacitor traces under other devices, and do not share ground vias of other signals, so as to avoid ground current from different loops coupling in and introducing additional noise into the clock signal.
-
Third Major Taboo: Placing Vias on Crystal Signal Lines and Routing Traces in a Crooked, Meandering Way
To make routing convenient, many people directly place vias on the XTAL_IN and XTAL_OUT signal lines of the crystal oscillator and route the traces through several right-angle bends, directly destroying signal integrity. The two clock signal lines of the crystal oscillator are themselves high-impedance weak analog signals. Vias introduce additional parasitic inductance and impedance discontinuity, and right-angle routing produces signal reflection at the corners, directly increasing clock jitter. The correct approach is that both traces should be routed entirely on the top layer, with no vias allowed. Use short, straight paths, and do not use sharp angles or right angles. For a passive crystal, make the two lines as equal in length as possible, with a length difference controlled within 5 mil. Use a uniform trace width of 6–8 mil, and keep at least 3W spacing from other nearby high-speed signal lines to avoid crosstalk.
For an active crystal oscillator with differential output, the two differential output lines must not only meet the equal-length requirement but also remain parallel throughout, with impedance controlled at 100 Ω differential impedance. Do not change trace width midway.
-
Fourth Major Taboo: Routing Other Signal Lines Directly Under the Crystal Oscillator, with the Ground Plane Cut by a Split Line
To save effort during routing, many engineers route a power split line or other high-speed signal lines on the second-layer ground plane directly under the crystal oscillator, directly cutting a gap in the crystal's ground return path. I once debugged an automotive OBC main control board. During cold start, the crystal occasionally failed to start oscillating. After checking for a long time, I found that the ground plane directly under the crystal had been cut with a gap by a 12 V power split line. The return path became high-impedance, and the Q factor of the oscillation loop was directly halved. The correct approach is that all layers directly under the crystal oscillator should be set as a strict keep-out area for signal lines, retaining only complete and continuous ground copper. No power or signal traces may be routed there, ensuring that the crystal's ground return path is complete and free of gaps.
In the blank area around the crystal oscillator, pour ground copper over the entire area and place dense vias to form a shielding ring, directly physically isolating the crystal oscillator from nearby strong interference sources such as switching power supplies, inductors, and relays.
-
Fifth Major Taboo: Not Placing a Decoupling Capacitor Near the Power Pin of an Active Crystal Oscillator, and Leaving the Metal Housing Floating and Ungrounded
When handling an active crystal oscillator, many people only connect the output line to the MCU, route the power pin directly to the main power supply with a long trace, and leave the metal housing completely floating. Ultimately, power supply noise couples directly into the clock signal. For the power pin of an active crystal oscillator, a 0.1 μF NPO decoupling capacitor must be placed tightly adjacent to the pin. If conditions permit, a 10 nF high-frequency capacitor can be connected in parallel. The power trace should pass through the capacitor before entering the crystal oscillator pin. Absolutely do not let the power supply route around a long path before connecting to the capacitor. For a crystal oscillator in a metal housing package, the housing pad must be connected to the ground plane nearby; do not leave it floating. Otherwise, the housing will become a small antenna, both radiating clock harmonics outward and easily coupling strong interference signals from the surroundings.
A small 22 Ω resistor can be connected in series at the output of the active crystal oscillator to suppress signal overshoot, avoid severe asymmetry in the output waveform, and further reduce the risk of EMI radiation exceeding limits.
By avoiding all five of these taboos, the crystal oscillator routing you draw can easily pass industrial-grade wide-temperature testing and EMC radiation testing without adding an additional shielding can, fundamentally eliminating mass-production failures such as failure to start oscillation, clock drift, and out-of-spec jitter.
