24.3.3.1.3 Input Capture on Event Mode

The counter counts from BOTTOM to MAX in the Input Capture on Event mode. When an event is detected, the Counter (TCBn.CNT) register value is transferred to the Capture/Compare (TCBn.CCMP) register, and a CAPT interrupt and event are generated. The Event edge detector can be configured to trigger a capture on either rising or falling edges.

This mode requires TCB to be configured as an event user and is explained in the Events section.

The figure below shows the input capture unit configured to capture the falling edge of the event input signal. The CAPT interrupt flag is cleared automatically after reading the low byte of the Capture/Compare (TCBn.CCMP) register. An OVF interrupt and event are generated when the CNT is MAX.

Figure 24-5. Input Capture on Event
Important: It is recommended to write 0x0000 to the Counter (TCBn.CNT) register when entering this mode from any other mode.