capturecompare
Capture/compare (CC) units are timer peripherals found in many microcontrollers that provide two related functions: capture of input events and comparison of a timer count with stored values to trigger actions. They are commonly used to generate timed waveforms, measure signal properties, and coordinate events in real time. A CC unit is typically part of a larger timer module and may include multiple independent channels, each configurable for input capture or output compare, and often capable of PWM generation.
In input capture mode, the current timer count is latched into a capture register when a selected
In output compare mode, the timer value is compared against a configured compare value. When the timer
Hardware details vary by device but typically include a prescaler, a counting register, a period (top) value,
Common uses include PWM for motor and LED control, servo positioning, and precise timing or measurement of