Home

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

input
edge
occurs
(rising,
falling,
or
both).
The
captured
timestamp
can
be
used
to
determine
input
period,
pulse
width,
or
frequency,
usually
with
interrupts
or
direct
memory
access
for
software
processing.
reaches
the
match,
the
CC
channel
can
drive
an
output
pin,
toggle
or
set/clear
the
output,
or
generate
an
interrupt
or
peripheral
event.
In
PWM
applications,
the
compare
value
sets
the
duty
cycle
while
the
timer’s
top
or
period
defines
the
overall
signal
period.
and
multiple
channels
that
can
be
configured
independently.
Features
may
include
edge
selection,
output
polarity,
dead-time
insertion
(in
advanced
timers),
and
per-channel
interrupts.
external
signals.
The
exact
terminology
and
capabilities
of
capture/compare
units
differ
among
microcontroller
families.