
Channel Service Request
Understanding the eTPU Channel Hardware, Rev. 0
Freescale Semiconductor
35
a short time after the application of the drive, the resistor voltage will be well below the threshold and the
comparator will be off. The match conditions will not be satisfied.
When the load is shorted, the current will rise very fast, and at the Match A time, the comparator output
will be high. MRLA will be set, and since the OPACA is set to turn off the drive when Match A occurs,
the drive will be safely turned off. There is no software latency in this channel action, but a unique channel
entry condition will be satisfied when the shutdown occurs, allowing software error detection and
recovery.
A similar scheme may be used to detect a shorted resistive load with a high-side drive, accounting for the
turn-on delay of the transistor.
5
Channel Service Request
By setting up the channel hardware for optimal handling of the input and output pin events, the application
can ensure that the timing of these events is as accurate as the MCU clock, regardless of the software load
on the eTPU, as long as the total load is reasonably small. Once a transition is captured or a match
completed, the software required to record the event and set up the next is usually straightforward. If the
user avoids partitioning too much of the control algorithm into the eTPU software, there are only a few
additional matters to consider.
5.1
Servicing Order
In Example
8
, the normal channel operation will set both the MRLA and the MRLB. Abnormal operation
will set TDLA. Even if the delay between the matches is as little as 1 microsecond, in most cases the eTPU
will respond to the MRLB before the MRLA is asserted. Since we are not sure of the health of the load at
this time, we would not want to setup the next match yet. However, we must service the request and clear
the MRLB at least, or we will get continual MatchB service requests until we do.
It is also possible that the fault detection occurs before we schedule the channel for service. Thus in the
MatchB service routine, if TDLA is set, we should clear it and service the fault condition.
Note, however, that in the example whenever TDLA is set, MRLA must also be set. If we give
MatchA_TransB priority, we can handle the fault condition in all those cases where the scheduler response
was slow. Since MatchA indicates that the pulse is completed, if we do not also have TDLA, we have a
normal event. So what do we do with MatchB Just clear the flag and handle everything after MatchA.
The eTPUC compiler will automatically give priority to the first listed channel condition. Thus if the
source code uses the condition MatchB_TransA followed by MatchA_TransB, the first service routing will
be entered whenever MRLB or TDLA are set, regardless of MRLA and TDLB. Of course the priority can
be explicitly stated by using the following conditions (in either order):