Figure 36-15. Capture Double Buffering
BUFV
"capture"
IF
COUNT
CCx
EN
EN
"INT/DMA
request"
data read
CCBUFx
The TCC can detect capture overflow of the input capture channels: When a new capture event is
detected while the Capture Buffer Valid flag (STATUS.CCBUFV) is still set, the new timestamp will not be
stored and INTFLAG.ERR will be set.
Period and Pulse-Width (PPW) Capture Action
The TCC can perform two input captures and restart the counter on one of the edges. This enables the
TCC to measure the pulse-width and period and to characterize the frequency
f
and
dutyCycle
of an input
signal:
� = 1�
,
��������� =
�
�
�
Figure 36-16. PWP Capture
Period (T)
external
signal /event
capture times
COUNT
MAX
ZERO
"capture"
CC0
CC0
CC1
CC1
Selecting PWP or PPW in the Timer/Counter Event Input 1 Action bit group in the Event Control register
(EVCTRL.EVACT1) enables the TCC to perform one capture action on the rising edge and the other one
on the falling edge. When using PPW (period and pulse-width) event action, period
T
will be captured into
CC0 and the pulse-width
t
p
into CC1. The PWP (Pulse-width and Period) event action offers the same
functionality, but
T
will be captured into CC1 and
t
p
into CC0.
The Timer/Counter Event x Invert Enable bit in Event Control register (EVCTRL.TCEINVx) is used for
event source x to select whether the wraparound should occur on the rising edge or the falling edge. If
EVCTRL.TCEINVx=1, the wraparound will happen on the falling edge.
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
811