Angle Functions
850
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer (N2HET) Module
20.3.2.6 Tricks
20.3.2.6.1 Using HWAG Previous Tooth Period Value Register (HWAPCNT1)
The HWAG previous tooth period value register (HWAPCNT1) can compensate for errors because of
acceleration or deceleration.
If there is a variation of the toothed wheel, the ACNT register will have a discontinuity . For an explanation
of acceleration and deceleration, see
. Avoid this discontinuity by giving the
HWAPCNT1 register a smaller or larger value, depending of the variation. When HWAPCNT1 is modified,
the angle tick period is also be modified which causes faster or slower tick generation and decreases the
discontinuity on the next falling edge.
Because of this compensation, the NHET interface will not overflow and fewer errors will occur on the
NHET angle counter in case of strong acceleration.
NOTE:
Reading the angle increment will give the application the amount of the acceleration.
However, adding the value directly to the NHET counter will result in a discontinuity in the
compare sequence. Particularly angle based compare could be missed.
20.3.2.6.2 Using the Singularity During Normal Tooth Interrupt
This interrupt detects if the HWAG is desynchronized with the toothed wheel and resynchronizes the
HWAG.
Because the criteria was set during a tooth other than the singularity tooth, the interrupt occurs. Because
the criteria is based on PCNT > 2 × PCNT (n-1), this interrupt is likely due to the singularity.
The following steps explain how to resynchronize the HWAG with this interrupt:
1. Stop the HWAG
2. Reset ACNT
3. Reset tooth counter
4. Reset interrupt
5. Set start bit.
The HWAG will restart on the tooth zero.