When the single pulse mode is selected (MODE bits of the ATxCON0 register = 00), the Angular Timer starts a period counter after the first pulse. When the second pulse arrives, 360 degrees later, it stores the time between the first and second pulse as the Current Period Counter value in the ATxPERH/L register pair and resets the period counter back to zero.
The Angular Timer output can produce multiple output pulses based on the single input pulse per 360 degrees. For example, on every input pulse, there will be three additional output pulses for every 90 degrees of rotation—or every 25% of the time—between input signals.
The input pulse is mirrored on the period output. The extra pulse produced at the phase angles is output through the phase output.
Missing Pulse Detection
The Angular Timer can also detect missing pulses and indicate the occurrence to the software algorithm. It performs this task by the expected angle (or time) of the expected pulse based on the 360-degree calculations. The detection can be adaptive where the trip point adjusts with the variation of the input signal frequency or it can be fixed to a delay time independent of the changing frequency.
A missing pulse can occur when the input signal doesn't appear due to a stalled motor or just loss of signal. The missing pulse output is triggered if the difference between the stored value of the Current Period Counter value (ATxPERH/L register pair) and the most Recent Period Counter value is equal to the missing pulse delay value (ATxMISSH/L register pair). This missing pulse delay value can be set by the software algorithm. That value is fixed and even if the speed of the input signal changes, the absolute value of the difference between the Current Period Counter and the most Recent Period Counter still determines if the missing pulse detection is triggered.
Adaptive Missing Pulse detection will adjust to always trigger at the 50% point of the period after an input pulse was expected for a total of 1.5 times the expected arrival of the input pulse. If the input pulse frequency changes, the angular timer will adjust and so will the missing pulse detection.
The figure below shows a missing pulse detection using the adaptive mode. The trip point is 1.5 times the expected angle (time) of the pulse. If the motor supplying the input pulse through a sensor happens to stall for a period equal to 1.5 revolutions, then the missing pulse detection will be triggered.