Oscillators & Clock Signals
How a circuit generates its own repeating signal from nothing but DC power — the source of every clock tick and radio tone.
Every digital system needs a heartbeat — a repeating signal that tells its logic when to move to the next step. That heartbeat comes from an oscillator: a circuit that, given only a steady DC supply, produces a continuously repeating output on its own, with no external repeating input to copy.
The trick behind almost every oscillator is positive feedback combined with something that takes time to charge or settle — an RC network, an inductor-capacitor pair, or a mechanical resonator. The 555 timer's astable mode from Lesson 22 is a simple RC oscillator: the capacitor charges, crosses a threshold, triggers the chip to discharge it, and the cycle repeats indefinitely — producing a square wave whose frequency depends on the resistor and capacitor values.
For applications that need much more precise, stable timing — like a microcontroller's main clock — RC oscillators aren't accurate enough, because resistor and capacitor values drift with temperature and manufacturing tolerance. Instead, designs use a crystal oscillator: a small quartz crystal that mechanically vibrates at an extremely precise, temperature-stable frequency when an electrical field is applied to it (a property called the piezoelectric effect). Most microcontrollers either have a crystal wired to two dedicated pins, or contain a less-precise oscillator built directly into the chip.
Oscillator frequency is usually described in Hertz (cycles per second) — a typical microcontroller might run its logic at 8–16 MHz (millions of cycles per second), while a crystal used just to keep time, like in a watch, commonly runs at exactly 32,768 Hz.