22.4.2.7.2 Period and Pulse-Width (PPW/PWP) Capture Action on Events
The TC can perform two input captures and restart the counter on one of the edges. This allows the TC to measure the pulse width and period, enabling characterization of the input signal’s frequency f and duty cycle:
Selecting PWP in the Event Action bit field in the Event Control register (EVCTRL.EVACT) enables the TC to perform one capture action on the rising edge and the another on the falling edge. The period T will be captured in CC1, and the pulse width tp in CC0. When EVCTRL.EVACT is set to PPW (period and pulse-width), the functionality is identical, except that T is captured in CC0 and tp in CC1.
The TC Event Input Invert Enable bit in the Event Control register (EVCTRL.TCINV) is used to select whether the wrap-around occurs on the rising edge or the falling edge. If EVCTRL.TCINV=1, the wrap-around occurs on the falling edge.
The TC can detect capture overflow of the input capture channels: If a new capture event occurs while the Capture Interrupt flag (INTFLAG.MCn) is still set, the new timestamp will not be stored, and INTFLAG.ERR will be set.
