
eTPU Angle Clock Hardware
Using the eTPU Angle Clock, Rev. 0
Freescale Semiconductor
3
2
eTPU Angle Clock Hardware
The eTPU Angle Clock provides a counter that can be synchronized to a periodic input signal such as
would be produced by a sensor detecting teeth on a wheel attached to a rotating shaft. A typical toothed
wheel used in automotive applications might have 35 teeth spaced at 10 degree intervals with a missing
tooth in the 36th position (
Figure 1
). The Angle Clock hardware detects and times the teeth, compensates
for the missing teeth, and inserts a fixed number of additional counts (ticks) between each pair of teeth at
a rate determined by eTPU software. Typically, a system would insert 100 counts between each pair of
teeth, giving an angle resolution of 0.1 degree.
The Angle Clock is maintained in TCR2, one of two selectable timer counter registers in the eTPU, which
can be used by any channel to cause pin action and/or service requests on a match, or which can be
captured as a result of an input pin action. In addition, the eTPU can export the angle clock to another eTPU
or to an eMIOS device connected to a common Shared Timer and Counter (STAC) bus. The angle clock
can be read in real time by the host.
The eTPU Angle Clock operates as a state machine, processing inputs from the input pin and using
parameters provided by the eTPU software. A simplified diagram of the eTPU Angle Clock logic is shown
in
Figure 2
.
Figure 2. Angle Clock Simplified State Diagram
The heart of the Angle Clock is a tick generator that inserts a selected number of ticks between each pair
of teeth. A block diagram of the tick generator is shown in
Figure 3
.
New Edge
if LAST then TCR2 = 0
else incr TCR2
tickctr = 0
Tick Time
wait TRR time
New Tooth
incr TCR2
tickctr = 0
Fast Count
inc tickctr;
incr TCR2
wait clock/8
Miss Count
dec MISSCNT
wait TRR time
Tick Count
inc tickctr;
incr TCR2
tickctr > TICKS
Tooth Edge
tickctr
≤
TICKS
Hold
TRR time-out
tickctr = TICKS
MISSCNT = 0
tickctr = TICKS
MISSCNT > 0
Tooth Edge
tickctr
≤
TICKS