Learning path

Full curriculum

Full curriculum

Unit content

Microcontroller clocks and clock trees

A microcontroller needs a clock source to pace processor and peripheral state changes. The source may be an internal oscillator, an external crystal or another reference.

A clock tree distributes derived clocks through dividers, multipliers and selectable paths. The processor core, buses and individual peripherals may therefore run at different frequencies.

Peripheral timing depends on the clock actually feeding that peripheral. Timer periods, serial baud rates and conversion timing can all be wrong when software assumes the wrong clock frequency.

Faster clocks can reduce execution time but usually increase dynamic power consumption. Low-power modes often disable or slow parts of the clock tree that are not currently needed.

Clock configuration is therefore not merely a startup detail. It establishes the time base from which many later hardware calculations are derived.