AN2897 Freescale Semiconductor / Motorola, AN2897 Datasheet - Page 9

no-image

AN2897

Manufacturer Part Number
AN2897
Description
Using the eTPU Angle Clock
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
3.1
There are two basic angle counting modes that can be supported by the eTPU. In the periodic mode, the
TCR2 can be programmed to maintain a real time representation of the absolute angle of the wheel with
respect to a reference position, while in the free running mode it can track a continuously increasing angle
from startup, rolling over as the TCR1 (time) counter does after reaching 0XFFFFFF (16777215) counts.
The choice between these modes depends on the desired mode of comparison of angle positions.
3.1.1
If the Angle Clock software sets LAST at the end of a cycle, typically at 360 or 720 degrees, the TCR2
counter will roll over to 0 at the tooth edge after LAST. This means that comparison to the engine angle
must be done as equals-only. The greater-or-equal compare depends on the count rolling over after
0XFFFFFF. Greater-or-equal compares will be satisfied for any number from 0 to 0X7FFFFF less than the
programmed angle. This means that an attempt to setup a compare in the future will not work properly if
the future projected angle rolls over the end angle. In other words, 0 degrees will always test less than any
other angle, including 715 degrees, even though with the periodic Angle Clock, it is 5 degrees in the future.
Engineers are understandably uneasy about using an equal-only compare. If a spark is programmed to fire
at 32 degrees, missing the angle under any exceptional condition will cause an undesirable misfire.
However, the eTPU Angle Clock is designed not to miss any comparison counts regardless of the speed
dynamics of the input signal. This means that any compare that is programmed to occur at a selected angle
will absolutely occur at the next occurrence of that angle in TCR2.
The only danger is in writing the compare value just too late for the intended cycle. If the spark time was
changed, for example, to 31 degrees just after the Angle Clock reached 31.1 degrees, the spark could be
missed. Therefore it must be a requirement of all angle triggered driver software to test for any change that
steps the compare point over the current angle, and force the compare immediately when that happens.
3.1.2
To avoid the step-over problem mentioned above, a designer might choose to use the greater-or-equal
comparator in the eTPU channel with a free running Angle Clock. In this case, the trigger angle for any
function must be offset by the angle at a reference point on the wheel. For example, the software driver
could maintain the top dead center (TDC) value for the current cylinder. If the spark is set to 12 degrees
before TDC, the driver need only subtract the 12 degrees from the TDC angle to get an absolute firing
point. Regardless when the software is updated, the greater-or-equal compare will ensure that a event is
not missed. Then at some point in the cycle, for each driver the TDC angle must be updated for the next
cycle.
The disadvantage of using a free running Angle Clock is that a host read of TCR2 will not directly yield
the absolute position of the engine. The value will have to be reduced by a reference angle, modulus
360/720 degrees, and the reference angle will have to be updated every revolution.
Either the periodic or the free running Angle Clock can be applied successfully to an engine control
system.
Freescale Semiconductor
Steady State System Design
Periodic Angle Clock
Free Running Angle Clock
Using the eTPU Angle Clock, Rev. 0
System Design
9

Related parts for AN2897