AN2897 Freescale Semiconductor / Motorola, AN2897 Datasheet - Page 23

no-image

AN2897

Manufacturer Part Number
AN2897
Description
Using the eTPU Angle Clock
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
4.2.3
When the second edge is detected, the function can make the first measurement of the tooth period. The
period should be stored as a global variable, as it is the best measure of the wheel speed and may be used
by other drivers. Before it is overwritten, the previous period should be stored off for use in detecting the
gap.
4.2.4
When the third edge is detected, enough information finally exists to test for the missing tooth gap. This
routine is now the default for subsequent teeth. This state is repeated until the gap test is satisfied after
which a confirming test needs to performed on the following period.
It is necessary from this point on to count the teeth that are detected. For example, if a 36-1 tooth wheel
produces more than 35 tooth periods without a gap detection, an exception might be raised with the host.
Typically the tooth count is rectified when the first gap is detected. After that, the software can anticipate
subsequent gap detections.
If the wheel is to be tracked over 720 degrees as is necessary for a four-cycle automotive engine, a separate
search needs to be conducted for the unique cam information indicating which of the two crankshaft cycles
are currently being tracked. Note that the cam information and the crank synchronization are both needed
to determine full synchronization.
In addition to tracking the tooth period and count, the angle clock software should provide status to the
host and other applications using the angle information. The status selections might include:
Note that in a four-cycle engine, some limited operation is possible in Half_Sync mode.
Freescale Semiconductor
1. Stall indicates that the Angle Clock has not yet determined a valid period, or the time since the last
2. Searching_Gap is used to indicate that teeth have been detected at an acceptable rate, but the first
3. Half_Sync in a 720 degree system indicates that the gap has been verified, but the cam cycle
4. Full_Sync indicates that the TCR2 counter is synchronized with the wheel and the cam shaft.
5. Error indicates that the Angle Clock system has detected an incorrect state change.
tooth transition exceeded a specified limit.
gap has not yet been detected and confirmed.
information has not been determined.
case Testing_Possible_Gap:
{
ToothPeriodLast = ToothPeriod;
ToothPeriod= TempToothPeriod;
ToothTime = EdgeCaptureTime;
ToothCount = ToothCount + 1;
if (ToothPeriod > (ToothPeriodLast*GapRatio + ToothPeriodLast))
First Period
Testing for a Possible Gap
Using the eTPU Angle Clock, Rev. 0
EXAMPLE
eTPU Software Design
23

Related parts for AN2897