8-bit PIC® MCU Angular Timer Capture/Compare

Last modified by Microchip on 2024/01/26 15:36

The Angular Timer Peripheral offers both a Capture feature and a Compare feature. These can be used to check the status of the angular timer registers or to react to a specific phase angle. The angular timer contains multiple built-in capture/compare modules that can be used. The Capture/Compare options are enabled and set up by their respective Angular Timer Capture/Compare Control (ATxCCONy) registers.

The CCyMODE bit of the ATxCCONy register controls whether each particular module is in Capture or Compare mode. The polarity of each module's respective output signal is controlled by the CCyPOL bit of the ATxCCONy. Both modes use an edge detect that is synced to the input clock of the angular-timer module.

Capture Mode

In Capture mode, the software has the ability to retrieve the status of the phase counter. This can be used to determine the angle of the input signal for further calculation in the main algorithm.

capture mode

Compare Mode

The Compare mode can trigger an output signal and if enabled, interrupt when the phase counter matches a preset value. This can be helpful when an event needs to occur at a specific phase angle.

compare mode