The Angular Timer peripheral allows the software designer to interpret repeating signals as an angle measurement vs a time measurement. A repeating signal is converted into a 360-degree-angular representation from 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 is repeating. In this case it is easy to apply 360 degrees to this signal as the time it takes to repeat the signal and can easily be divided into 360 pieces with each 1 degree of rotation matched to a time element. The Angular Timer handles all that calculation automatically and will adjust automatically 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 Mode
- with fixed missing pulse
- with adaptive missing pulse
- Multiple-pulse Mode
- 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: