Does the PCB Crystal Oscillator Not Vibrate or Has a Frequency Offset? Beware of the Invisible Killer of Stray Capacitance and Its Solution Guide
Friends who do hardware development are likely to have encountered this kind of frustrating situation: even though they have selected a crystal oscillator with matching parameters, they either do not vibrate or the frequency drifts absurdly when soldering the board, and several crystal oscillators have been replaced but it is useless. In fact, many times, it's not that the quality of the crystal oscillator is poor, but rather that you overlook the ubiquitous "hidden capacitance" in the PCB - stray capacitance. Today, let's dismantle this "troublemaker" hidden in the circuit, talk about its source, harm, and taming methods.

What is stray capacitance? The 'natural parasite' in the circuit
Stray capacitance (Cstray) is a parasitic parameter that is completely unavoidable in circuits. As long as there are conductors, distances, and dielectrics, it will quietly form. You can understand it as countless invisible small capacitors on the PCB: between the wiring and the ground plane, between the component pins and pads, and even between two adjacent wires, capacitance effects are generated due to electric field coupling.
In conventional PCB design, the typical value of stray capacitance is between 2pF and 5pF, and the industry usually defaults to using 3pF as the initial estimation value. But this value is only an "ideal situation", in actual projects it is easy to break through the upper limit and become a "time bomb" that affects circuit stability.
The 'scam' of load capacitance: how does stray capacitance drag down crystal oscillators?
Friends who have used passive crystal oscillators know that the datasheet will clearly indicate a key parameter - load capacitance CL, which is the core condition for the crystal oscillator to operate at the nominal frequency. In the most commonly used Pierce oscillator circuit, we usually connect two symmetrical external capacitors C1 and C2 on both sides of the crystal oscillator. At this time, the equivalent load capacitance actually loaded on the crystal oscillator is not simply a series connection of C1 and C2, but also requires the "hidden interference" of stray capacitance.
For example, if the required load capacitance for a crystal oscillator is 18pF and we estimate the stray capacitance at 3pF, we will calculate the external capacitance that needs to be connected at 30pF. But if the actual stray capacitance is 5pF, the equivalent load capacitance will become 20pF, exceeding the nominal value of the crystal oscillator, directly causing the frequency to be low, and in severe cases, even making the crystal oscillator unable to start oscillating.
What situations can cause stray capacitance to exceed the standard?
Breaking through 3pF of stray capacitance is actually a common occurrence, and these scenarios should be particularly noted:
1. The "hidden attribute" of MCU pins: Many MCU IO pins have a nominal capacitance of 2pF, but in actual mass production, this value may rise to 4pF to 7pF, directly increasing the stray capacitance base of the entire circuit.
2. The longer the wiring, the larger the capacitance: for every 1cm increase in wiring between the crystal oscillator and MCU, it may result in an additional capacitance of 0.2pF to 1pF. If a large bend is made for the convenience of wiring, the stray capacitance will exceed the standard every minute.
3. Double sided clamping of multi-layer boards: In PCBs with four or more layers, if the crystal oscillator signal lines are tightly attached to the ground plane or power layer, a structure similar to parallel board capacitors will be formed, and the coupling effect will significantly increase stray capacitance.
4. Adding unnecessary details to the design: For the convenience of soldering, drawing the solder pads too large or placing the external capacitor too far away from the crystal oscillator will further amplify parasitic effects, causing the stray capacitance to accumulate more and more.
The 'killing power' of stray capacitance: differential treatment of passive and active crystal oscillators
The impact of stray capacitance on different types of crystal oscillators is completely different:
Passive crystal oscillator: Directly shaking the "foundation": The frequency of a passive crystal oscillator depends entirely on the external load capacitance, and stray capacitance can directly change the equivalent load capacitance value, causing frequency deviation at a mild level and making the crystal oscillator unable to meet the starting conditions at a severe level, resulting in a "strike" directly.
Active crystal oscillator: indirectly damaging the "environment": Active crystal oscillator has its own oscillation circuit, and stray capacitance will not directly affect the output frequency, but will interfere with signal quality. For example, increasing the jitter of the output signal, slowing down the rising edge, and even introducing additional noise can lead to a long-term decrease in system stability and more severe temperature drift.
Taming stray capacitors: It's time to start in the PCB design phase
Since stray capacitance cannot be eliminated, we need to find a way to control it. Proper attention to these details during the PCB design phase can effectively control stray capacitance within a reasonable range
1. Close fitting layout: The crystal oscillator should be placed as close as possible to the clock pin of the MCU, as close as possible, with the shortest path routing to reduce the distributed capacitance caused by routing.
2. Simplify wiring: The clock line of the crystal oscillator should be as short and straight as possible, avoiding vias. If it is necessary, vias should be drilled as few as possible, as each via will increase additional parasitic capacitance.
3. Small solder pads and short pins: While ensuring the reliability of soldering, try to minimize the size of the solder pads for the crystal oscillator and external capacitors, and also shorten the pins of the components as much as possible to reduce parasitic effects caused by pins and solder pads.
4. Reasonable reference: Provide continuous ground plane reference for the crystal oscillator signal line, but avoid too close contact between the signal line and the ground plane or power layer, and reduce the parallel plate capacitance effect.
5. Stay away from interference sources: Crystal oscillators should be kept away from interference sources such as DC-DC converters and high-frequency clock circuits. The electromagnetic radiation from these modules can be combined with stray capacitance, further deteriorating signal quality.
Practical debugging: from "estimation" to "accuracy"
In actual projects, it is difficult for us to directly measure the accurate value of stray capacitance. The usual approach is to "estimate first, verify later, and then fine tune":
1. First, calculate the initial value of the external capacitor based on the empirical value of 3pF, and then solder the board to test the frequency.
2. If the frequency is found to be low, it indicates that the actual stray capacitance is greater than 3pF and the external capacitance value needs to be reduced; If the frequency is too high, increase the external capacitance value.
3. Repeatedly adjust until the frequency reaches the nominal value. For example, there was a previous case where a crystal oscillator required an 18pF load capacitor. Initially, an external capacitor of 27pF was used, but the frequency was too low. It was determined that the stray capacitance was about 5pF. After replacing it with a 22pF capacitor, the frequency returned to normal.
Key Tips
In short, stray capacitance is the most easily overlooked yet significant factor in PCB design. Next time you encounter an abnormal crystal oscillator, don't rush to replace it. First, check if the stray capacitance is causing trouble. By attaching importance to it from the design stage and precise control through debugging, the crystal oscillator can operate stably at its nominal frequency, avoiding many unnecessary troubles.




