AN2897 Freescale Semiconductor / Motorola, AN2897 Datasheet - Page 27

no-image

AN2897

Manufacturer Part Number
AN2897
Description
Using the eTPU Angle Clock
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
should revert to Full_Sync mode. If the correction is made in error, the system software will indicate this
at the next gap.
4.2.12 Stall
Provision should be made to detect the cessation of the tooth signals. Typically the system resets a match
timer at each tooth edge, and reverts to a Stall status if the timer expires before the next tooth is detected.
5
The Angle Clock was implemented in the Reference Design with little more software than is listed in this
section. Several variations of the Angle Clock software have been written for various applications.
Freescale provides the Reference Design with a complete working angle clock and several drivers free to
customers. See your Freescale representative.
As described above, the eTPU Angle Clock can implement a free running angle counter or a periodic
wheel angle indicator. Each alternative has advantages as well as problems, which are discussed briefly
below.
5.1
If the LAST bit is not set periodically by the Angle Clock software, the wheel angle will accumulate
16777215 ticks then roll over to zero. If this is applied to a 60-2 tooth wheel with 60 ticks per tooth, each
revolution of the engine will increment the count by 0xE10 (3600) counts. Thus a specific point on the
wheel which is represented by 0xABC in TCR2 will on the next revolution be represented by 0x18CC, and
on the next cycle by 0x26DC. In order to find the absolute position on the wheel at any time, the software
must subtract the angle at some reference point from the indicated angle. While this seems tedious, the free
running angle counter offers one clear advantage: match comparisons for angles can be done using the
greater-or-equal compare. Any angle which previously occurred up to about 2300 revolutions in the past
can be immediately matched with respect to the current angle.
However, if a free running angle counter is used, each system function using the angle needs to use the
reference point to schedule or capture a channel action. If spark is to be scheduled for 12 degrees before
top dead center (BTDC), the spark driver function needs to know a reference point in order to program the
correct TCR2 value into the match register. In general the host software may change the spark angle at any
time. If a change is made which would require a spark to occur in the past, the greater-or-equal compare
would trigger a match immediately.
The free running counter design is much simpler if the number of teeth on the wheel and number of ticks
between the teeth were each powers of 2. For example, if a 64-2 tooth wheel was used in a system with
128 ticks per tooth, the number of ticks per revolution would be 64 (0x40) times 128 (0x80) or 8192
(0x2000). In this case the counter would count exactly 2048 (0x800) revolutions and roll over. The TCR2
counter value would simply be a concatenation of an 11-bit revolution number, a 6-bit tooth number, and
a 7-bit tick number.
Freescale Semiconductor
Angle Clock Application
Free Running Angle Counter
Using the eTPU Angle Clock, Rev. 0
Angle Clock Application
27

Related parts for AN2897