
DMA Operation
7.2.9.1
DMAIV Software Example
The following software example shows the recommended use of DMAIV and the handling overhead for an
eight channel DMA controller. The DMAIV value is added to the PC to automatically jump to the
appropriate routine.
The numbers at the right margin show the necessary CPU cycles for each instruction. The software
overhead for different interrupt sources includes interrupt latency and return-from-interrupt cycles, but not
the task handling itself.
;Interrupt handler for DMAxIFG
Cycles
DMA_HND
...
; Interrupt latency
6
ADD
&DMAIV,PC
; Add offset to Jump table
3
RETI
; Vector
0: No interrupt
5
JMP
DMA0_HND
; Vector
2: DMA channel 0
2
JMP
DMA1_HND
; Vector
4: DMA channel 1
2
JMP
DMA2_HND
; Vector
6: DMA channel 2
2
JMP
DMA3_HND
; Vector
8: DMA channel 3
2
JMP
DMA4_HND
; Vector 10: DMA channel 4
2
JMP
DMA5_HND
; Vector 12: DMA channel 5
2
JMP
DMA6_HND
; Vector 14: DMA channel 6
2
JMP
DMA7_HND
; Vector 16: DMA channel 7
2
DMA7_HND
; Vector 16: DMA channel 7
...
; Task starts here
RETI
; Back to main program
5
DMA6_HND
; Vector 14: DMA channel 6
...
; Task starts here
RETI
; Back to main program
5
DMA5_HND
; Vector 12: DMA channel 5
...
; Task starts here
RETI
; Back to main program
5
DMA4_HND
; Vector 10: DMA channel 4
...
; Task starts here
RETI
; Back to main program
5
DMA3_HND
; Vector 8: DMA channel 3
...
; Task starts here
RETI
; Back to main program
5
DMA2_HND
; Vector 6: DMA channel 2
...
; Task starts here
RETI
; Back to main program
5
DMA1_HND
; Vector 4: DMA channel 1
...
; Task starts here
RETI
; Back to main program
5
DMA0_HND
; Vector 2: DMA channel 0
...
; Task starts here
RETI
; Back to main program
5
7.2.10 Using the eUSCI_B I
2
C Module With the DMA Controller
The eUSCI_B I
2
C module provides two trigger sources for the DMA controller. The eUSCI_B I
2
C module
can trigger a transfer when new I
2
C data is received and the when the transmit data is needed.
277
SLAU272C – May 2011 – Revised November 2013
DMA Controller
Copyright © 2011–2013, Texas Instruments Incorporated