A prescaler is an electronic counting circuit used to reduce a high-frequency electrical signal to a lower frequency by integer division. It takes a basic timer clock frequency — which may be the CPU clock frequency or a higher or lower frequency — and divides it by a specified value before feeding it to a timer or counter, according to how the prescaler register(s) are configured.
Operation
The prescaler operates by counting input pulses and generating an output pulse after a predetermined number of them has been reached, effectively performing integer division on the input signal's frequency. The prescaler values, referred to as prescales, that may be configured are often limited to a few fixed values (typically powers of 2), or they may be any integer value from 1 to 2^P, where P is the number of prescaler bits.
The primary purpose of the prescaler is to allow a timer to be clocked at a rate appropriate for a desired application. In shorter timers (8-bit and 16-bit), there is often a tradeoff between resolution (which requires a high clock rate) and range (since high clock rates cause the timer to overflow more quickly). For example, using a 16-bit timer with 1-microsecond resolution would limit the maximum measurable period to approximately 65 milliseconds. A prescaler allows the ratio between resolution and maximum period to be adjusted to suit the application.
Applications
Prescalers are commonly used at very high frequencies to extend the upper frequency range of frequency counters, phase-locked loop (PLL) synthesizers, and other counting circuits. In microcontroller systems, prescalers are integrated into timer/counter peripherals to derive slower clock signals from a fast system clock for tasks such as timekeeping, pulse-width modulation, and event counting.
When used in conjunction with a PLL, a prescaler introduces a normally undesired change in the relationship between the frequency step size and the phase detector comparison frequency. To address this, it is common to either restrict the integer division to a low value or to use a dual-modulus prescaler — a prescaler capable of selectively dividing the input frequency by one of two (normally consecutive) integers, such as 32 and 33. Common fixed-integer microwave prescalers are available with moduli of 2, 4, 8, 5, and 10, and can operate at frequencies in excess of 10 GHz.
Nomenclature
A prescaler is essentially a counter-divider or frequency divider, and the terms may be used somewhat interchangeably in technical literature.