Every microcontroller needs a clock. Get it wrong and the chip sits there doing absolutely nothing — no blink, no serial output, no response.[1]

§ 01The clock is not optional

A microcontroller is a synchronous machine. Every instruction, every peripheral transaction, every timer tick happens on a clock edge. Take the clock away — or give it one that never stabilises — and the CPU simply stalls. It is not crashed; it has not entered a fault handler. It is waiting for something that has not arrived.

a bare printed circuit board in raking light, macro Enlarge ⤢
Fig. 2 — A crystal is a component with layout requirements, not a decoration.

Most chips support several clock sources: an internal RC oscillator trimmed at the factory, an external crystal, a ceramic resonator, or an external clock signal driven from elsewhere on the board. The internal oscillator is the convenient default — no external components, works at power-on. The trade-off is accuracy, typically a percent or two, which is fine for PWM or GPIO toggling but marginal for USB or precision baud-rate generation.

A crystal gives you accuracy in the tens of parts per million, but it demands two load capacitors, short and matched PCB traces, and a bit of patience. This is where new boards die. A crystal oscillator circuit is a high-impedance feedback loop oscillating at radio frequencies. Long traces add capacitance that detunes it. A ground plane too close does the same. A missing or wrong-value load capacitor and the circuit never reaches its oscillation threshold. The chip powers up, the startup timer expires, the oscillator is still not running, and the processor either stalls in a reset loop or falls back to the internal oscillator — silently, if you are not watching a clock-output pin.

Startup time matters too. Crystals can take milliseconds to reach stable amplitude. Every chip has a configurable startup wait — some call it an oscillator start-up timer (OST), others expose it as a clock-ready flag. If your firmware releases reset or reconfigures the PLL before that flag is set, you will generate a stable-looking clock signal that is not, in fact, stable. The result is corrupted early instructions and behaviour that changes with temperature or supply voltage.

The fix is almost always the same: check the crystal circuit against the datasheet's recommended layout, scope the OSC pin before you trust any other measurement, and confirm the clock-ready flag before enabling the PLL. A clock-output pin routed to a test point is worth its footprint on every new board spin.

Notes

  1. An oscillator that starts on the bench and not in the cold is a margin problem, not a mystery. ↩