AN2897 Freescale Semiconductor / Motorola, AN2897 Datasheet - Page 17

no-image

AN2897

Manufacturer Part Number
AN2897
Description
Using the eTPU Angle Clock
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
All other sources of error for the Angle Clock involve detecting an extra tooth or missing one which should
have been detected. The angle clock hardware cannot automatically correct a tooth detection error. If a lost
or extra tooth error is possible, the application software must provide some means to detect the error. The
most obvious method is to continually monitor the position of the gap by repeating the gap detection and
verification algorithm. If the gap is detected at the wrong tooth position, or not detected at the expected
one, the angle count can be corrected. The decision to correct an apparent error can be made in the CPU
or the eTPU software, although prudence dictates that the decision is left to the more powerful host
processor.
The eTPU Angle Clock provides two features to correct a TCR2 counter that has become untracked by one
tooth. Each of these corrections can be repeated to make a multiple tooth correction.
3.4.2.1
If the Angle Clock hardware has missed counting a tooth, the software can assert IPH in the TPR to add a
single tooth. The effect of this assertion is to force the eTPU to recognize a physical tooth immediately. If
the tick counter is in Halt mode, the Angle Clock counts the inserted tooth, then begins a new sequence of
tick counts exactly as if a tooth had been detected by the channel. If the tick counter is in Normal mode, it
immediately goes into High Rate mode until the tick count is complete, then the inserted count is counted
as a physical tooth, and finally the Angle Clock returns to Normal mode. Note that if IPH is asserted when
the Angle Clock is in High Rate mode, it will be ignored.
The effect of inserting a tooth is that the angle clock will advance the angle count by one tooth without
missing any ticks. If a match is scheduled for an angle between the asserting of IPH and the time the count
is rectified, it will occur.
3.4.2.2
If the Angle Clock hardware has mistakenly counted an extra tooth, the software can assert HOLD in the
TPR to stop the count for exactly one tooth count. The effect of this assertion is to stop the tick count
immediately until the next tooth is detected. When that tooth is detected, the tick counter continues where
it left off, meaning that the tick count will count a portion of TICKS before the assertion of HOLD, and
the balance after the next tooth.
Do not use IPH to cancel a HOLD in progress. To correct the correction, simply negate HOLD.
Freescale Semiconductor
Inserting a Tooth
Deleting a Tooth
Asserting IPH (except when asserted during High Rate mode) will always
add exactly one tooth to the TCR2 angle count. The correction will be made
using the High Rate mode, and no count will be skipped.
Asserting HOLD will always subtract exactly one tooth from the TCR2
angle count. The correction is made by stopping the count, and the angle
count does not decrement or repeat any count.
Using the eTPU Angle Clock, Rev. 0
NOTE
NOTE
System Design
17

Related parts for AN2897