18.3.2.3 Input Capture
In Input Capture Mode, the counter value (TIMERn_CNT) can be captured in the Compare/Capture Register (TIMERn_CCx_CCV) (see
Figure 18.12 TIMER Input Capture on page 587
). The CCPOL bits in TIMERn_STATUS indicate the polarity of the edge that triggered
the capture in TIMERn_CCx_CCV.
TIMERn_CCx_CCV
m
n
y
z
TIMERn_CNT
Input
Read TIMERn_CCx_CCV
TIMERn_CCx_CCVB
m
y
prev. val
m
y
Figure 18.12. TIMER Input Capture
The Compare/Capture Buffer Register (TIMERn_CCx_CCVB) and the TIMERn_CCx_CCV register form double-buffered capture regis-
ters allowing two subsequent capture events to take place before a read-out is required. The first capture can always be read from
TIMERn_CCx_CCV, and reading this address will load the next capture value into TIMERn_CCx_CCV from TIMERn_CCx_CCVB if it
contains valid data. The CC value can be read without altering the FIFO contents by reading TIMERn_CCx_CCVP.
TIMERn_CCx_CCVB can also be read without altering the FIFO contents. The ICV flag in TIMERn_STATUS indicates if there is a valid
unread capture in TIMERn_CCx_CCV. In this mode, TIMERn_CCx_CCV is read-only.
In the case where a capture is triggered while both TIMERn_CCx_CCV and TIMERn_CCx_CCVB contain unread capture values, the
buffer overflow interrupt flag (ICBOF in TIMERn_IF) will be set. On overflow new capture values will overwrite the value in
TIMERn_CCx_CCVB and the value of TIMERn_CCx_CCV will remain unchanged. TIMERn_CCx_CCV will always contain the oldest
unread value and TIMERn_CCx_CCVB will always contain the newest value.
Note:
In input capture mode, the timer will only trigger interrupts when it is running.
EFM32JG1 Reference Manual
TIMER - Timer/Counter
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 587