
Understanding the eTPU Channel Hardware, Rev. 0
Architecture of the eTPU Channel
Freescale Semiconductor
12
}
// end: If the Tooth edge is detected.
else // stall--here the transition latch is not set
{
DisableMatch();
CrankStatus = Stall;
SetChannelInterrupt();//Inform the host that the crank status is updated
ClearAllLatches();
}
}
...
In the example either a Stall time-out or a Tooth transition or both will cause the thread to be entered. Since
the logic first checks the tooth, that branch will be taken when both conditions exist. In that branch, the
stall condition is cleared and the stall condition is reset to a later time.
If the stall match only is set, the second branch is taken. The software is now no longer interested in a
transition that came too late, and clears all latches before reverting to the stall state.
NOTE
In some channel modes, certain match recognition latches or transition
detect latches may be asserted but not request service. However, the latch
conditions are nevertheless used to determine the selected vector
2.5.2
Coding the Service Request Handling
Because the Scheduler does not order the service requests for a channel, it is important for the coder to
understand the way the vectors are assigned to avoid writing code that handles the requests out of order.
Example 4.
/* The following might be used with a Periodic Angle Clock (See Application Note #xxxx)
to produce a short pulse at one angle and a channel interrupt to the host at another
angle. */
/* ... In the setup routine... */
SetupMatchB(Pulse_Start_Angle); //start a pulse at a specified angle
OnMatchBPinHigh();
SetupMatchA(Pulse_Start_Angle + Pulse_Width); //this sets the end of the pulse
OnMatchAPinLow();
Next_Match = Interrupt;
/* ... more... */
if (MatchA_TransB && Flag0)
{
if (Next_Match == Interrupt)