
Enhanced Time Processing Unit (eTPU2)
MPC5644A Microcontroller Reference Manual, Rev. 6
Freescale Semiconductor
971
Coherent Dual-parameter Controller is faster and have less impact on both eTPU and Host performance.
That said, the methods are:
•
Transfer Service
A microengine thread transfers, upon Host Service Request, data from/to a TPA to/from a PPA.
Coherency is guaranteed by the fact that a thread is atomic with respect to other threads in the same
engine, and so are its transfers. If parameters in PPA are shared by both engines, hardware
semaphores have to be used to access them.
•
Mailbox
For Host to eTPU transfers, the microcode checks a flag, set by the host, indicating the existence
of new parameter data in the TPA. It can, then, either access TPA data directly or copy it to the PPA.
For eTPU to Host transfers, when microcode changes PPA, it copies them to the TPA and flags
updated TPA data to Host, possibly using an Interrupt or a Data Transfer Request. The Mailbox
flag is reset when data is copied: by the eTPU microcode, when it transfers TPA to PPA (possibly
followed by an Interrupt); by the Host, when it reads data from the TPA. This indicates that TPA is
free for another transfer.
Transfer Service has the advantage of separating the task of data transfer from the functional service thread
that accesses the parameters, with less impact to the latter. Compared to the Mailbox method, however, it
has bigger average latency, because the Transfer Service thread has to contend for a time slot to execute.
This latency can be minimized if Transfer Service thread is assigned to a separate channel with higher
priority, but even so it does not guarantee that PPA is updated before the next execution of the functional
thread that uses it.
Mailbox method, on the other hand, makes the functional thread check for the existence of new data (Host
to eTPU). It does not have to be responsible for the transfer, though: it may access the TPA directly, and a
Transfer Service can then be used to copy data from TPA to PPA.
24.6.4
Programming hints and caveats
24.6.4.1
Atomic dual access after a call, return
A dual, back-to-back parameter access is not atomic after a call, a jump, or a return if they occurred in
parallel with an odd SPRAM access. It is safer to make a pair of parameter accesses that must be coherent
begin at the second instruction after a call/jump/return.
24.6.4.2
Resource polling
The use of polling while waiting for a condition or a resource (except semaphore lock) should be avoided
in order not to hang the microengine in long loops. This general programming guideline is greatly enforced
in eTPU, as a thread cannot be preempted for any reason. Safer polling, albeit with long and
indeterministic latency, can be obtained if one issues a channel link to itself and terminates the thread. The
microengine is then free to other tasks, and the next poll happens at the next time the channel is serviced.
This mechanism can be combined with finite (timed out) loops for better latency.
Summary of Contents for MPC5644A
Page 2: ...MPC5644A Microcontroller Reference Manual Rev 6 2 Freescale Semiconductor...
Page 24: ...MPC5644A Microcontroller Reference Manual Rev 6 24 Freescale Semiconductor...
Page 26: ...MPC5644A Microcontroller Reference Manual Rev 6 26 Freescale Semiconductor...
Page 52: ...Introduction MPC5644A Microcontroller Reference Manual Rev 6 52 Freescale Semiconductor...
Page 56: ...Memory Map MPC5644A Microcontroller Reference Manual Rev 6 56 Freescale Semiconductor...
Page 1228: ...Decimation Filter MPC5644A Microcontroller Reference Manual Rev 6 1228 Freescale Semiconductor...
Page 1440: ...FlexCAN Module MPC5644A Microcontroller Reference Manual Rev 6 1440 Freescale Semiconductor...