Input Capture Frequency and Pulse-Width Measurement Mode

In this mode, the timer will start counting when a positive edge is detected on the Event Input signal. On the following falling edge, the count value is captured. The counter stops when the second rising edge of the Event Input signal is detected and this will set the interrupt flag.

Reading the capture will clear the interrupt flag. When the capture register is read or the interrupt flag is cleared the TC is ready for a new capture sequence. Therefore, read the counter register before the capture register since it is reset to zero at the next positive edge.

Figure 1. Input Capture Frequency and Pulse-Width Measurement