Datasheet
159
XMEGA B [DATASHEET]
8291B–AVR–01/2013
Figure 13-12 on page 159 shows an example where the period of an external signal is measured twice.
Figure 13-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.
13.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. Figure 13-13 on page 159 shows and example
where the pulse width is measured twice for an external signal.
Figure 13-13.Pulse width capture of an external signal.
Period (T)
external signal
events
CNT
MAX
BOTTOM
"capture"
Pulsewitdh (t
p
)
external signal
events
CNT
MAX
BOTTOM
"capture"