Toothed
wheel
Period
counter
55
56
57
0
T1
T2
T3
T4
T3 > 2 x T2
Angle Functions
838
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer (N2HET) Module
20.3.2.2.4 Gap Verification
After the CPU sets the synchronization and puts the HWAG into RUN time (that is, the start bit is set), the
tooth counter counts until reaching the teeth register (the number of real teeth of a full wheel revolution).
When the tooth counter reaches the teeth register, the gap flag signal is set. For more information on the
end of the cycle, see
. When the gap flag signal is set, it allows the HWAG to verify if
the singularity is in the correct position (last tooth). The module then applies the PCNT(n) > 2 x PCNT(n-1)
criteria by comparing PCNT(n) and PCNT(n-1) with one bit left shifted. If the criteria does not match when
the tooth arrives, then the HWAG sends an interrupt to the CPU and does not reset the ACNT counter.
The application software must recover from such an interrupt to keep the HWAG operating optimally. For
an example of gap verification criteria for a 60-2 toothed wheel, see
.
Figure 20-45. Gap Verification Criteria For a 60-2 Toothed Wheel
If the hardware criteria is not enabled, you must set the angle reset (ARST) bit in the HWAG global control
register 2 (HWAGCR2) to validate the singularity. The HWAGCR2 register must validate the singularity
before the active edge of the singularity tooth. If the HWAGCR2 register fails to validate the singularity, the
HWAG generates an interrupt and does not clear the ACNT counter when the tooth edge occurs.
NOTE:
For a 60-2 toothed wheel, set the ARST flag after the reload of the tick counter( when
PCNT(n) = PCNT(n-1)). By verifying the criteria, the application software can set the ARST
bit after this point.
The CPU can read the PCNT counter and make a custom criteria set the ARST bit on time for the HWAG.
The application software can use the gap flag interrupt to find the singularity tooth. Alternately, the CPU
can verify the validity of the singularity in the second tooth with a more accurate criteria by using the
HWAG previous tooth period value register (HWAPCNT1).