English
Language : 

LM3S1627 Datasheet, PDF (280/719 Pages) Texas Instruments – ARM and Thumb are registered trademarks and Cortex is a trademark
Micro Direct Memory Access (μDMA)
7.3.4.3
7.3.4.4
7.3.4.5
Table 7-12. Channel Control Word Configuration for Peripheral Ping-Pong Receive Example
Field in DMACHCTL
DSTINC
DSTSIZE
SRCINC
SRCSIZE
reserved
ARBSIZE
XFERSIZE
NXTUSEBURST
XFERMODE
Bits
31:30
29:28
27:26
25:24
23:18
17:14
13:4
3
2:0
Value
0
0
3
0
0
3
63
0
3
Description
8-bit destination address increment
8-bit destination data size
Source address does not increment
8-bit source data size
Reserved
Arbitrates after 8 transfers
Transfer 64 items
N/A for this transfer type
Use Ping-Pong transfer mode
Note:
In this example, it is not important if the peripheral makes a single request or a burst request.
Since the peripheral has a FIFO that will trigger at a level of 8, the arbitration size is set to
8. If the peripheral does make a burst request, then 8 bytes will be transferred, which is
what the FIFO can accomodate. If the peripheral makes a single request (if there is any
data in the FIFO), then one byte will be transferred at a time. If it is important to the
application that transfers only be made in bursts, then the channel useburst SET[n] bit
should be set by writing a 1 to bit 8 of the DMA Channel Useburst Set
(DMAUSEBURSTSET) register.
Configure the Peripheral Interrupt
In order to use μDMA Ping-Pong mode, it is best to use an interrupt handler. (It is also possible to
use ping-pong mode without interrupts by polling). The interrupt handler will be triggered after each
buffer is complete.
1. Configure and enable an interrupt handler for the peripheral.
Enable the μDMA Channel
Now the channel is configured and is ready to start.
1. Enable the channel by setting bit 8 of the DMA Channel Enable Set (DMAENASET) register.
Process Interrupts
The μDMA controller is now configured and enabled for transfer on channel 8. When the peripheral
asserts the DMA request signal, the μDMA controller will make transfers into buffer A using the
primary channel control structure. When the primary transfer to buffer A is complete, it will switch
to the alternate channel control structure and make transfers into buffer B. At the same time, the
primary channel control word mode field will be set to indicate Stopped, and an interrupt will be
triggered.
When an interrupt is triggered, the interrupt handler must determine which buffer is complete and
process the data, or set a flag that the data needs to be processed by non-interrupt buffer processing
code. Then the next buffer transfer must be set up.
In the interrupt handler:
1. Read the primary channel control word at offset 0x088 and check the XFERMODE field. If the
field is 0, this means buffer A is complete. If buffer A is complete, then:
280
November 17, 2011
Texas Instruments-Production Data