![Texas Instruments AM1808 Скачать руководство пользователя страница 634](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_1094558634.webp)
Transfer Examples
634
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Enhanced Direct Memory Access (EDMA3) Controller
17.3.4.4 Ping-Pong Buffering
Although the previous configuration allows the EDMA3 to service a peripheral continuously, it presents a
number of restrictions to the CPU. Since the input and output buffers are continuously being filled/emptied,
the CPU must match the pace of the EDMA3 very closely in order to process the data. The EDMA3
receive data must always be placed in memory before the CPU accesses it, and the CPU must provide
the output data before the EDMA3 transfers it. Though not impossible, this is an unnecessary challenge. It
is particularly difficult in a 2-level cache scheme.
Ping-pong buffering is a simple technique that allows the CPU activity to be distanced from the EDMA3
activity. This means that there are multiple (usually two) sets of data buffers for all incoming and outgoing
data streams. While the EDMA3 transfers the data into and out of the ping buffers, the CPU manipulates
the data in the pong buffers. When both CPU and EDMA3 activity completes, they switch. The EDMA3
then writes over the old input data and transfers the new output data.
shows the ping-pong
scheme for this example.
To change the continuous operation example, such that a ping-pong buffering scheme is used, the DMA
channels need only a moderate change. Instead of one link parameter set, there are two; one for
transferring data to/from the ping buffers and one for transferring data to/from the pong buffers. As soon
as one transfer completes, the channel loads the PaRAM set for the other and the data transfers continue.
shows the DMA channel configuration required.
Each channel has two link parameter sets, ping and pong. The DMA channel is initially loaded with the
ping parameters (
). The link address for the ping set is set to the PaRAM offset of the pong
parameter set (
). The link address for the pong set is set to the PaRAM offset of the ping
parameter set (
). The channel options, count values, and index values are all identical
between the ping and pong parameters for each channel. The only differences are the link address
provided and the address of the data buffer.