Angle Functions
837
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer (N2HET) Module
is an example of a singularity research initializing the HWAG at the second tooth to start
synchronously with the third tooth. The HWAG angle value register (HWAACNT) contains 1024 (2 × 512)
and the HWAG current teeth number register (HWATHVL) contains 2.
The code is executed in a tooth interrupt subroutine in code using the PCNT(n-2) > PCNT (n-3) + PCNT
(n-1) algorithm.
Figure 20-44. Code
20.3.2.2.3 Stopping the HWAG
The HWAG starts synchronously with the active edge of the toothed wheel, but stops when the start
(STRT) bit in the HWAG global control register 2 (HWAGCR2) is reset. Within a tooth, the HWAG can be
stopped and parameters can be changed (that is, step width, angle counter, and so on) If this happens,
the restart will take effect on the next active tooth edge.
NOTE:
When stopping the HWAG, stop the angle increment delivered to the NHET and set it to
zero. Reload the NHET counter with the same value of the angle counter (± corrections), if
restarting the HWAG.