
What is a crystal oscillator?
Hello, colleagues,
A crystal oscillator uses the mechanical resonance of a quartz crystal to produce a stable electrical frequency reference. It establishes the timing rhythm of an electronic system. Frequency describes the number of repetitions per second; the oscillator is the source that generates them.
A microcontroller can schedule sensor readings, while a microprocessor coordinates its processing using clock signals. However, clock frequency and completed operations per second are different quantities. Architecture, memory access and software also affect performance.
Is a crystal the same as a crystal oscillator?
A quartz crystal is a passive resonator. Applying a supply does not make it deliver a usable clock output on its own. An amplifier and feedback circuit must sustain oscillation. This circuitry may be inside an integrated circuit or built using active components such as a transistor. A complete oscillator module combines the resonator and circuitry, delivering its specified output when correctly powered.
A crystal commonly uses two electrical connections, but pin or pad count alone does not identify the component. Passive crystals with four pads also exist. Check the part number, connections and datasheet together.
How does quartz determine frequency?
The piezoelectric effect links an electric field to mechanical deformation. Quartz resonates in particular vibration modes. Dimensions, cut and operating mode influence the resonant frequency. The oscillator replaces energy lost during vibration, so the electrical characteristics of the resonator and circuit must be compatible.
RC and crystal oscillators: timing stability
The red trace shows greater period variation; the blue trace is more regular. Differences are exaggerated for visibility. This is an illustration, not a measurement or ppm comparison; real crystals also have drift and jitter. The sine waves are illustrative, and a clock module may deliver a square-wave output.
RC oscillator, quartz crystal or ceramic resonator?
An RC oscillator uses a time constant associated with resistance and capacitance. Resistor and capacitor tolerances, temperature and circuit design affect the result. Internal RC clocks can save space and start quickly; calibrated versions meet the needs of many control applications. An external crystal is not required for every project.
Quartz crystals are often chosen when timing or communication needs tighter frequency tolerances. A ceramic resonator offers another balance of accuracy and cost. Select the source by considering permitted error, operating temperature, startup time, power consumption and cost together.
What does ppm mean? How much can a clock drift?
ppm means parts per million. At 10 MHz, a frequency deviation of ±20 ppm equals ±200 Hz. In a timekeeping circuit, a constant 20 ppm error corresponds to approximately 1.728 seconds per day gained or lost: 86,400 × 20 / 1,000,000. This example assumes a constant error.
Initial tolerance, temperature stability and aging are separate specifications. A single ±20 ppm figure may not represent the total error over the product’s operating life. Loading effects also matter. Accuracy describes closeness to the target frequency; stability describes how much frequency changes with conditions and time.
Why do clocks use 32.768 kHz crystals?
32.768 kHz means 32,768 cycles per second. Since 32,768 = 215, dividing the signal by two fifteen times produces a nominal 1 Hz output. This is useful in wristwatches and real-time clocks. Division does not remove the crystal’s relative error: a second derived from an inaccurate reference remains inaccurate.
Load capacitance and circuit compatibility
A crystal’s specified frequency applies at its stated load capacitance (CL). In a common two-capacitor Pierce circuit, the approximate relationship is CL ≈ (C1 × C2) / (C1 + C2) + Cstray. If C1 = C2, this becomes CL ≈ C1/2 + Cstray. Include pin and board effects; two arbitrary 22 pF capacitors are not a universal solution.
Check ESR, operating mode and drive level as well as nominal frequency. ESR relates to resonator losses; drive level is the power dissipated in the crystal. Two crystals marked with the same MHz value are not necessarily interchangeable.
What are XO, TCXO, OCXO and VCXO?
XO denotes a standard oscillator; TCXO compensates for temperature effects; OCXO keeps the crystal section at a controlled temperature. An OCXO requires consideration of warm-up time and additional power. A VCXO provides limited frequency adjustment through a control voltage. Some designs use a varactor diode, whose capacitance changes with voltage.
Why do power supply and PCB layout matter?
Check the module’s DC supply voltage, output level and compatibility with the receiving input. A 3.3 V oscillator should not be assumed to connect directly to every 5 V system. Output formats such as LVCMOS and differential outputs require different connection arrangements.
Switching power circuits produce rapid current and voltage changes around the inductor and MOSFET. Short crystal traces, the manufacturer’s layout guidance and appropriate supply decoupling help reduce unwanted interaction. A suitable crystal and a suitable PCB layout work together.
What does it do in wireless communication?
An RF module may use its reference clock for radio-frequency generation and timing. In systems such as Bluetooth, frequency error and clock characteristics must meet the particular circuit’s requirements. A “16 MHz” or “40 MHz” marking alone is insufficient: total tolerance and operating conditions matter too.
Sensors, optical measurements and PWM
In a sensor system, sampling intervals may depend on the time reference. For optical measurements using a photodiode, regular sampling helps interpret results on a time axis. However, a stable clock alone does not guarantee accurate amplitude measurements; the analog circuit and converter specifications also matter.
When PWM controls LED brightness, the timer clock influences switching frequency. Pulses transmitted through an optocoupler are also affected by its propagation delay and rise/fall times. Evaluate the reference clock alongside the timing limits of the signal path.
Crystal oscillators in industrial automation
Clock sources serve processors and communication circuits in PLCs and control boards. Serial timing matters in Modbus/RS-485 applications, but replacing a crystal does not resolve every RS-485 physical-layer problem. Industrial communication also requires attention to cabling, termination and interference.
If timestamps displayed by SCADA and records from wireless data loggers originate in different devices, synchronization to a shared time reference may be needed. A stable local oscillator does not automatically synchronize devices. System clock setting and communication delay remain separate considerations.
What should you check if oscillation does not start?
First check power, reset state, clock-source configuration and pin connections. Then review resonator compatibility, load capacitance, soldering and board cleanliness. A probe on sensitive crystal pins can load the circuit; a buffered clock output may be a better measurement point when the device supports one.
Jitter is the short-term displacement of clock edges from their expected timing; it is different from average frequency error. For demanding measurements, the method and the accuracy of the reference instrument matter as well as the frequency counter.
You may share this article with credit to OtomasyonAVM. Use the relevant product datasheet for circuit limits and connections.