AN2897 Freescale Semiconductor / Motorola, AN2897 Datasheet - Page 22

no-image

AN2897

Manufacturer Part Number
AN2897
Description
Using the eTPU Angle Clock
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
eTPU Software Design
else if (matchB_transA) //Here on MatchB (stall) or TransitionA (Tooth
edge)
{
if (IsTransALatched())
//If the Tooth edge is detected
{
/* Do some common tasks... */
switch(Last_State)
{
case InitializeCrank:
// State 2
CrankStatus = Waiting_Gap;
SetChannelInterrupt();//Inform the host that the crank status is
updated
Last_State = First_edge;
break;
/* Additional cases inserted here */
} // end of Switch...case statement
// The transition capture only need to setup once at init.
// Clear transition latch will re-arm the transition detection
ClearTransLatch();
// Setup match event to block out input trans too close to the valid
falling edge.
// The transition detection is disabled until the match event on the
action unit A occur.
SetupMatch_A((EdgeCaptureTime + ToothPeriod*BlankingRatio),
Mtcr1_Ctcr1_ge, match_no_change);
// Setup match event to detect stall condition
// If the crank edge transition does not occur again for a StallPeriod,
it is stalled
SetupMatch_B((EdgeCaptureTime + StallPeriod), Mtcr1_Ctcr1_ge,
match_no_change);
} // active edge
Using the eTPU Angle Clock, Rev. 0
22
Freescale Semiconductor

Related parts for AN2897