22.3.3.1.6 Input Capture Frequency and Pulse-Width Measurement Mode
In the Input Capture Frequency and Pulse-Width Measurement mode, the TCB peripheral starts counting when a positive edge is detected on the event input signal. The count value is captured on the following falling edge. The counter stops when the second rising edge of the event input signal is detected and will set the CAPT interrupt flag.
This mode requires TCB to be configured as an event user and is explained in the Events section.
The CAPT interrupt flag is cleared automatically after reading the low byte of the Compare/Capture (TCBn.CCMP) register, and the TCB peripheral is ready for a new capture sequence. Therefore, read the Counter (TCBn.CNT) register before the Capture/Compare (TCBn.CCMP) register since it is reset to BOTTOM at the next positive edge of the event input signal. An OVF interrupt and event are generated when the CNT value is MAX.