UG-1262
Rev. B | Page 164 of 312
Program Flow
After performing the following steps, the data FIFO issues DMA requests whenever the FIFO receives data. If the number of bytes
transferred matches the value specified by Bits[13:4] of the control data configuration register (CFG), the DMA_DONE internal
interrupt is asserted. To set up the DMA controller for a particular DMA channel, follow these steps:
1.
Enable the DMA controller by setting Bit 0 of CFG to 1.
2.
Enable the DMA data FIFO channel and set Bit 17 of CFG to EN_SET.
3.
Configure the DMA control description for the data FIFO channel. Refer to the Channel Control Data Structure section.
4.
Select the source for data FIFO (FIFOCON, Bits[15:13]).
5.
Set FIFOCON, Bit 11 and FIFOCON, Bit 12 to enable the FIFO and DMA requests.
6.
Enable the DMA_DONE interrupt.
DMA ARCHITECTURAL CONCEPTS
The DMA channel provides a means to transfer data between memory spaces or between memory and a peripheral using the system
interface. The DMA channel provides an efficient means of distributing data throughout the system, freeing up the core for other
operations. Each peripheral that supports DMA transfers has its own dedicated DMA channel or channels with their own register sets
that configure and control the operating modes of the DMA transfers.
DMA OPERATING MODES
The DMA controller has two buses, one connected to the system bus shared with the Cortex-M3 core and the other connected to 16-bit
peripherals. The DMA request can stop CPU access to the system bus for several bus cycles, such as when the CPU and DMA target the
same destination (memory or peripheral). The DMA controller fetches channel control data structures located in the system memory to
perform data transfers.
DMA capable peripherals, when enabled to use the DMA, can request the DMA controller for a transfer. At the end of the programmed
number of DMA transfers for a channel, the DMA controller generates a single cycle DMA_DONE interrupt corresponding to that
channel. The DMA_DONE interrupt indicates the completion of the DMA transfer. Separate interrupt enable bits are available in the
NVIC for each of the DMA channels.
CHANNEL CONTROL DATA STRUCTURE
Every channel has two associated control data structures: primary and alternate. For simple transfer modes, the DMA controller uses
either the primary or the alternate data structure. For more complex data transfer modes, such as ping pong or scatter gather, the DMA
controller uses both the primary and alternate data structures. Both control data structures occupy four 32-bit locations in the memory, as
detailed in Table 189. The entire channel control data structure is described in Table 190.
Before the controller can perform a DMA transfer, the data structure related to the DMA channel must be programmed at the designated
location in system memory, SRAM. The programming determines the source and destination data size, number of transfers, and the
number of arbitrations. The contents of the designated memory locations are as follows:
The source end pointer memory location contains the end address of the source data.
The destination end pointer memory location contains the end address of the destination data.
The control data configuration memory location contains the channel configuration control data.
Table 189. Channel Control Data Structure
Offset Address
Offset Register Name
Description
0x00
SRC_END_PTR
Source end pointer
0x04
DST_END_PTR
Destination end pointer
0x08
CHNL_CFG
Control data configuration
0x0C Reserved
Reserved