Direct Memory Access (DMA)
9 - 8
C2000 Microcontroller Workshop - Direct Memory Access Controller
DMA configured to re-init after transfer (CONTINUOUS = 1)
Ping-Pong Example Register Setup
SRC_BURST_STEP
SRC_TRANSFER_STEP
0x0000
DST_BURST_STEP
DST_TRANSFER_STEP
0x0001
SRC_ADDR_SHADOW
DST_ADDR_SHADOW
BURST_SIZE*
TRANSFER_SIZE*
0x0000
1 word/burst
0x0031
50 bursts/transfer
* Size registers are N-1
Objective: Buffer ADC ch. 0 ping-pong style, 50 samples per buffer
don’t care
since BURST_SIZE = 0
don’t care
since BURST_SIZE = 0
0x00000B00
starting address
0x0000C140
starting address**
Read/Write Data
Add Burst Step
to Address
Pointer
End Transfer
Add Transfer Step
to Address Pointer
Moved
“Burst Size”
Words?
Moved
“Transfer Size”
Bursts?
Y
Y
N
N
Wait for event to
start/continue transfer
Start Transfer
Convert ADC Channel ADCINA0 – 1 conversion per trigger (i.e. ePWM2SOCA)
DMA Registers:
ADC Registers:
Other:
** DST_ADDR_SHADOW must be changed between ping and pong buffer address in
the DMA ISR. Typically use a relocatable symbol in your code, not a hard value.
DMA Priority Modes
Channel Priority Modes
Round Robin Mode:
All channels have equal priority
After each enabled channel has
transferred a burst of words, the
next enabled channel is serviced
in round robin fashion
Channel 1 High Priority Mode:
Same as Round Robin except CH1
can interrupt DMA state machine
If CH1 trigger occurs, the current
word (not the complete burst) on
any other channel is completed
and execution is halted
CH1 is serviced for complete burst
When completed, execution
returns to previous active channel
This mode is intended primarily
for the ADC, but can be used by
any DMA event configured to
trigger CH1
DMA
event?
CH6
CH1
CH2
CH5
CH4
CH3
Y
N
Summary of Contents for C2000 Piccolo LaunchPad
Page 74: ...Interrupts 4 18 C2000 Microcontroller Workshop Reset and Interrupts ...
Page 100: ...Lab 5 System Initialization 5 26 C2000 Microcontroller Workshop System Initialization ...
Page 218: ...Lab 8 IQmath FIR Filter 8 42 C2000 Microcontroller Workshop Numerical Concepts ...
Page 334: ...F28069 controlCARD A 4 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 ...
Page 336: ...F28035 controlCARD A 6 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 SW3 ...