IT lexicon › Hardware › Hardware timer

Hardware timer

Hardware På svenska → Updated: 2026-11-04

A counter etched in silicon that ticks along on a clock regardless of what the CPU is busy with.

At its core is a counter register that increments once per clock pulse, usually after a prescaler has divided the frequency down. When the count hits a compare value or wraps around, the timer can fire an interrupt, reset itself or toggle an output pin. From those building blocks the same peripheral produces periodic interrupts, PWM, pulse measurement via input capture and precise timing windows via output compare.

The point is that the timing does not depend on interrupt latency or whatever code happens to be running. A delay loop in C changes with the compiler flags; a timer does not. A typical STM32 carries a dozen or so in assorted widths, and there is rarely a spare one left by the end of a project.

← Back to the lexicon