
141
8210C–AVR–09/11
Atmel AVR XMEGA D
Figure 12-10.
Event source selection for capture operation.
The event action setting in the timer/counter will determine the type of capture that is done.
The CC channels must be enabled individually before capture can be done. When the capture
condition occur, the timer/counter will time-stamp the event by copying the current CNT value in
the count register into the enabled CC channel register.
When an I/O pin is used as an event source for the capture, the pin must be configured for edge
sensing. For details on sense configuration on I/O pins, refer to
”Input Sense Configuration” on
. If the period register value is lower than 0x8000, the polarity of the I/O pin edge will be
stored in the most-significant bit (msb) of the capture register. If the msb of the capture register
is zero, a falling edge generated the capture. If the msb is one, a rising edge generated the
capture.
12.7.1
Input Capture
Selecting the input capture event action makes the enabled capture channel perform an input
capture on an event. The interrupt flags will be set and indicate that there is a valid capture result
in the corresponding CC register. At the same time, the buffer valid flags indicate valid data in
the buffer registers.
The counter will continuously count from BOTTOM to TOP, and then restart at BOTTOM, as
shown in
. The figure also shows four capture events for one capture channel.
Figure 12-11.
Input capture timing.
12.7.2
Frequency Capture
Selecting the frequency capture event action makes the enabled capture channel perform an
input capture and restart on positive edge events. This enables the timer/counter to measure the
period or frequency of a signal directly. The capture result will be the time (T) from the previous
Event System
CH0MUX
Rotate
Event channel 0
Event channel 1
Event Source Selection
CCA capture
CH1MUX
CH2MUX
CH3MUX
Event channel 2
Event channel 3
CCB capture
CCC capture
CCD capture
events
CNT
TOP
BOTTOM
Capture 0
Capture 1
Capture 2
Capture 3