AN2897 Freescale Semiconductor / Motorola, AN2897 Datasheet - Page 3

no-image

AN2897

Manufacturer Part Number
AN2897
Description
Using the eTPU Angle Clock
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
2
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
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
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
Freescale Semiconductor
Figure
tickctr = TICKS
MISSCNT = 0
2.
eTPU Angle Clock Hardware
Hold
tickctr = TICKS
MISSCNT > 0
(Figure
dec MISSCNT
wait TRR time
Miss Count
Figure 2. Angle Clock Simplified State Diagram
1). The Angle Clock hardware detects and times the teeth, compensates
tickctr ≤ TICKS
Using the eTPU Angle Clock, Rev. 0
Tick Count
Tooth Edge
inc tickctr;
incr TCR2
New Tooth
incr TCR2
tickctr = 0
TRR time-out
tickctr ≤ TICKS
wait TRR time
Figure
Tick Time
Tooth Edge
3.
if LAST then TCR2 = 0
else incr TCR2
Fast Count
wait clock/8
New Edge
inc tickctr;
incr TCR2
tickctr = 0
eTPU Angle Clock Hardware
tickctr > TICKS
3

Related parts for AN2897