
142
8210C–AVR–09/11
Atmel AVR XMEGA D
timer/counter restart until the event occurred. This can be used to calculate the frequency (f) of
the signal:
shows an example where the period of an external signal is measured
twice.
Figure 12-12.
Frequency capture of an external signal.
Since all capture channels use the same counter (CNT), only one capture channel must be
enabled at a time. If two capture channels are used with different sources, the counter will be
restarted on positive edge events from both input sources, and the result will have no meaning.
12.7.3
Pulse Width Capture
Selecting the pulse width measure event action makes the enabled compare channel perform
the input capture action on falling edge events and the restart action on rising edge events. The
counter will then restart on positive edge events, and the input capture will be performed on the
negative edge event. The event source must be an I/O pin, and the sense configuration for the
pin must be set to generate an event on both edges.
shows and
example where the pulse width is measured twice for an external signal.
f
1
T
---
=
Period (T)
external signal
events
CNT
MAX
BOTTOM
"capture"