8-bit PIC® MCU Angular Timer Overview
The Angular Timer peripheral allows the software designer to interpret repeating signals as an angle measurement versus a time measurement. A repeating signal is converted into a 360-degree-angular representation on which all measurements are based.
For example, a motor that is rotating can have a sensor at a single location to indicate a home position. That sensor will produce a pulse that repeats. In this case, it is easy to apply 360 degrees to this signal because the time it takes to repeat the signal can easily be divided into 360 pieces with each degree of rotation matched to a time element. The Angular Timer handles the calculation automatically and will automatically adjust if the time between the sensor home pulses changes due to the motor speed changing.
Some of the Features of the Angular Timer Include
Specialized Rotational Timer
- Runs independently of the core
- Automatically generates output events based on user-defined angular intervals
- Interrupts are generated based on angles
Simplified Code Development
- Automatically adjusts for speed changes
- Software development is in terms of degrees
- Simplifies the math required
Angular Timer Modes
Four operating modes:
- Single-pulse Modes
- with fixed missing pulse
- with adaptive missing pulse
- Multiple-pulse Modes
- with fixed missing pulse
- with adaptive missing pulse
The Angular Timer also has capture-and-compare features that can be enabled to trigger interrupts at defined rotations.
The basic operation of the Angular Timer is derived from two input signals: an input clock selected by the Angular Timer Clock (ATxCLK) register, and an input signal selected by the Angular Timer Signal (ATxSIG) register. From these signals, three outputs are created:
- The period clock - outputs the controlling input signal.
- The phase clock - outputs any pulses in between the input clock pulse at defined phase angles.
- The missing pulse detector - creates a pulse when a missing pulse is detected.
Zooming in on an Angular Timer setup for output every 90 degrees produces the waveform below: