DMA Operation
634
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
DMA
NOTE:
Terminate the ping-pong DMA cycle in
by configuring task E to be a basic DMA
cycle by setting the cycle_ctrl field to 001b.
11.2.3.4.4.1 Example Application Use Case for Ping-Pong Cycle
Ping-pong mode is preferred when data is generated at high speed (for example, the ADC with fast
sampling rate) and the DMA should copy the data while the CPU is still processing the earlier block of
data.
In many applications, the ADC output data is processed by CPU in blocks. Consider a scenario when
DMA has copied a block data into the memory and interrupted CPU to process the data. The CPU started
processing the data, but meanwhile the ADC is ready with another conversion and triggers the DMA. The
DMA cannot copy to the earlier destination address, because the CPU has not finished processing the
previous data. Ping-pong mode allows the DMA to copy the data to a new location as defined by the
alternate data structure. So, while the CPU is busy processing the data copied the using primary data
structure, the DMA starts filling a new block using the alternate data structure. When the CPU processes
the data from alternate data structure, the DMA starts to fill the memory based on the primary data
structure. By using ping-pong mode, the application can prevent loss of any data for high-data-rate
requirements.
11.2.3.4.5 Memory Scatter-Gather Cycle Type
In memory scatter-gather mode, the controller receives an initial request and then performs four DMA
transfers using the primary data structure. After this transfer completes, the controller starts a DMA cycle
using the alternate data structure. After this cycle completes, the controller performs another four DMA
transfers using the primary data structure. The controller continues to switch from primary to alternate to
primary until either:
•
The host processor configures the alternate data structure for a basic cycle.
•
The controller reads an invalid data structure.
NOTE:
After the controller completes the N primary transfers, it invalidates the primary data
structure by setting the cycle_ctrl field to 000b.
The controller asserts
dma_done[C]
only when the scatter-gather transaction completes using a basic
cycle.
In scatter-gather mode, the controller uses the primary data structure to program the alternate data
structure.
lists the fields of the channel_cfg memory location for the primary data structure that
must be programmed with constant values and those that can be user defined.
Table 11-7. channel_cfg for a Primary Data Structure, In Memory Scatter-Gather Mode
Bit
Field
Value
Description
Constant-value fields:
[31:30}
dst_inc
10b
Configures the controller to use word increments for the address
[29:28]
dst_size
10b
Configures the controller to use word transfers
[27:26]
src_inc
10b
Configures the controller to use word increments for the address
[25:24]
src_size
10b
Configures the controller to use word transfers
[17:14]
R_power
0010b
Configures the controller to perform four DMA transfers
[3]
next_useburst
0
For a memory scatter-gather DMA cycle, this bit must be set to zero
[2:0]
cycle_ctrl
100b
Configures the controller to perform a memory scatter-gather DMA cycle
User-defined values:
[23:21]
dst_prot_ctrl
-
Configures the state of HPROT when the controller writes the destination data
[20:18]
src_prot_ctrl
-
Configures the state of HPROT when the controller reads the source data