
Understanding the eTPU Channel Hardware, Rev. 0
Channel Modes
Freescale Semiconductor
14
The user may populate the entry vector table by explicitly stating the conditions for each vector, for
example:
else if (MatchA_TransB && !MatchB_TransA)
/*...handles MatchA only...*/
else if (!MatchA_TransB && MatchB_TransA) || (MatchA_TransB && MatchB_TransA)
/*...handles MatchB only and MatchA and MatchB together...*/
The same vector encoding can be effected implicitly by reversing the order of the entry vector declarations:
else if (MatchB_TransA)
/*...handles all MatchB regardless of Match A...*/
else if (MatchA_TransB
/*...handles the rest of MatchA conditions...*/
NOTE
The Byte Craft eTPUC compiler requires that all entry conditions be
accounted for in the source code. A convenient way to complete the table
for unspecified conditions is to use the trailing
else
to vector to an empty
thread containing only an
end
statement. It is important that all link and
channel service requests be explicitly called to avoid a condition where an
empty thread fails to clear the requesting condition, and a channel hogs all
available cycles responding to the uncleared service request.
3
Channel Modes
In the channel action units, the matches and captures can be combined in various ways to control the
sequence of events, as well as pin action and service requests. The various combinations are encoded into
13 preprogrammed channel modes which, together with the pin action and time base selections, provide a
great amount of flexibility and versatility in the eTPU channel hardware. In some cases, the flexibility
simply reduces the amount of software required to support a function, while some channel configurations
enable the eTPU hardware to execute timing functions that could not be handled by software.
The modes are summarized in
Table 5
. The table is organized in sets of columns according to the order in
which events can occur in the various modes. The information includes events that are blocked and when
they are enabled, and those events that cause a channel service request (shaded). The subsections below
walk through each of the modes giving examples where needed. Thereafter, the summary table may be
used as a reference when designing an eTPU function.
Channel modes are set up by eTPU software, and can be changed within a function. It is a good idea not
to change the channel mode when any event is pending to avoid an unexpected result.