Crystal Oscillator: Design Rules and Process Limits

A crystal oscillator is a mechanical resonator with a very high quality factor, and the circuit around it is an amplifier that has to keep it running. It is also one of the few analog circuits left on a digital board, and the layout decides whether it starts reliably at every temperature.

How the Oscillator Works

The crystal behaves as a series resonant circuit with an extremely narrow resonance. The amplifier around it provides the gain, and the capacitor network shifts the resonant frequency to the value the design requires.

The loop must have a gain greater than one at the resonant frequency and a phase shift of a multiple of three hundred and sixty degrees. The amplifier supplies the gain and the crystal and its capacitors supply the phase.

The circuit settles into the mode where these conditions are met, and the crystal then holds the frequency far more accurately than the tolerance of the components around it. That is the whole point of using one.

load capacitance and Frequency

load capacitance is the capacitance the crystal is specified to see, and it is usually quoted as a value such as eight or twelve picofarads. The two load capacitors are connected in series from the point of view of the crystal, and their value is twice the load capacitance.

The actual frequency depends on the difference between the load capacitance and the value the crystal was calibrated at. A difference of a few picofarads shifts the frequency by tens of parts per million, which matters for a clock that has to hold time.

The capacitor values include the tolerance of the components and the capacitance of the pins. A crystal specified for twelve picofarads with two twenty two picofarad capacitors is only correct if the board and the pins contribute nothing, which they never do.

Crystal oscillator and load capacitors on a microcontroller board

stray capacitance in Practice

stray capacitance comes from the traces, the pads and the pins of the device. It appears in parallel with the load capacitors and adds to the total, which pulls the frequency below the intended value.

The layout minimises the stray component by keeping the traces short and the components close to the crystal. Every centimetre of trace adds roughly a picofarad, so a crystal placed at the far side of the board can shift the frequency by more than the tolerance of the crystal itself.

Measuring the actual frequency at the output of the oscillator and adjusting the load capacitors is the practical way to deal with the unknown. One value is measured and the other can be trimmed to bring the frequency to the target.

start up margin and Negative Resistance

start up margin is the ratio of the negative resistance the amplifier presents to the series resistance of the crystal. A margin of at least five is the usual design target, and a marginal design fails at low temperature or after a few years of ageing.

The negative resistance is measured by inserting a resistor in series with the crystal and increasing it until the oscillator stops. A small variable resistor and a frequency counter make the measurement straightforward, and it is worth making on any design that has shown a start up problem.

The margin falls as the supply voltage falls and as the temperature drops. A design that starts reliably at room temperature and a nominal supply may fail in a product that runs from a battery in a cold environment.

Crystal with guard ring and short traces on a PCB layout

drive level and Ageing

drive level is the power dissipated in the crystal, and it is specified with a maximum. Exceeding it accelerates ageing and can crack the resonator, and the failure appears months later as a frequency shift.

The drive level is set by the amplifier and by the series resistor that is sometimes placed in series with the crystal. That resistor also reduces the loop gain, so adding it to protect the crystal can cost the start up margin.

The power dissipated is not easily measured directly. It is estimated from the current through the crystal, which can be measured with a current probe, and the figure is compared with the specification with a comfortable margin.

Grounding and Guarding

The oscillator is a high impedance node at a low signal level, and it is next to a digital circuit that switches at the same frequency and its harmonics. Keeping the two apart is the main layout task.

Place the crystal and its capacitors directly at the pins of the device, guard the traces with ground and avoid any other signal crossing the area. Do not route a clock output or a switching supply trace near the crystal.

The ground connection of the load capacitors should be a solid local plane rather than a thin trace. The current in that connection is the oscillating current of the resonator, and any impedance there appears in the loop.

Interaction with the Rest of the System

A crystal oscillator drives a clock input that is often distributed over the board, and the return current of that clock flows in the ground plane. Keeping the clock trace away from analog circuits and from connectors reduces the coupling.

The oscillator also picks up noise from the supply. A dedicated RC filter or a ferrite bead in the supply pin reduces the jitter, and it costs almost nothing on a board that already has a quiet regulator.

Where very low jitter is required, the oscillator is a separate component with its own regulator and its own ground, and the clock is distributed as a differential signal. The board level measures that keep such a clock clean are covered in our guide to mixed signal board design.

Choosing the Crystal

The specification of the crystal matters as much as the layout. The load capacitance, the tolerance, the temperature stability and the equivalent series resistance together determine whether the oscillator works across the temperature range of the product.

A crystal with a high equivalent series resistance is harder to start, and one with a wide temperature tolerance may not hold the frequency the application needs. The parameters are chosen together with the load capacitors rather than one after the other.

Verification and Faults

Verify the oscillator by measuring the frequency at the output pin with a counter and the waveform with a probe of low capacitance. A probe with a few picofarads of loading shifts the frequency while it is connected, so the measurement disturbs what it measures.

Measure the negative resistance and confirm the start up margin on at least one sample of each design. It is the only measurement that predicts whether the product will start in the cold.

A board that fails to start occasionally has a marginal margin, a stray capacitance problem or a crystal outside its tolerance. The release checks that keep such a design consistent are collected in our PCB design release checklist, and the assembly points are listed in judging PCB quality.

FAQ

How do I choose the load capacitors? Twice the specified load capacitance, minus the stray capacitance of the traces and pins. Measure the frequency and trim one of them.

What start up margin do I need? At least five times the series resistance of the crystal, measured at the lowest supply voltage and the lowest temperature.

Why does my board fail to start when cold? The start up margin falls with temperature. Measure the negative resistance and reduce the load capacitors or the series resistor.

Leave A Comment