• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
 
Direct Memory Access (DMA)
 
What is DMA? A facility
o
 
transfer data from memory to memory
o
 
 / memory to peripheral
o
 
memory and peripherals can be internal / external
o
 
no intervention of CPU
o
 
DMA controller takes care of memory transfer
 
DMA has 6 channels for memory transfer
o
 
Each channel connects to a source location and destination location
o
 
Total 6 source and destination locations can be connected
o
 
Single transfer at a time
o
 
High priority channel is serviced before a low priority channel
o
 
For same priority it is serviced in a circular way 2,3,4,5,0,1
o
 
Transfer in terms of blocks of data
o
 
Block contains frames
o
 
For internal memories 4 clock cycles
o
 
2 read + 2 write
DMA Operation Configuration
 
Prior to transfer sub bank addressed registers have to be configured
o
 
Which channel?
o
 
Source and destination address
o
 
Priorities and enabling of channels with DMPREC register 16 bit
o
 
Size of the block DMA Sub bank Addressed RegistersName Address
Sub Addr
DescriptionDMSRC0 56h/57h 00h DMA channel 0 source address registerDMDST0 56h/57h 01h DMA channel 0 destination address registerDMCTR0 56h/57h 02h DMA channel 0 element count registerDMSFC0 56h/57h 03h DMA channel 0 sync select and frame count registerDMMCR0 56h/57h 04h DMA channel 0 transfer mode control registerDMSRC1………..DMSRCP 56h/57h 1Eh DMA source program page address (common channel) 
 
5 registers for each channel
 
Total 30 registers for 6 channels
 
+other control registers
 
Total 62 registers
Register Sub addressing
 
Technique used for configuring the DMA registers
 
Intervention of CPU required
 
Code for configuration is loaded into access registers DMSDI or DMSDN
 
Sub address to be configured is loaded into DMSA
 
DMSDI is auto-incremented
 
DMSDI for entire sets of registers
 
DMSDN for a single register access
 
 
Example Program 1: Write code to show how the DMA channel 2 source addressregister can be initialized with the value 1111h.
 
Following program is simulated in CCS:
; Program name ex9p6.s.def _c_int00dmsa .set 55h ; address of subbank address registerdmsdn .set 57h ; address of subbank access registerdmsrc2 .set 0ah ; subaddress.text_c_int00:stm dmsrc2, dmsa ; DMSA= address of DMSRC2= 0Ahstm #1111h, dmsdn ; write 1111h to DMSRC2.end
After execution:
Peripheral register DMSA=000ADMPREC =0000h
Example Program 2: Write TMS320C54xx code to show how the DMA channel 5context registers can be initialized. Choose arbitrary values to be written to theregisters.Solution: Since a set of registers are to be configured DMSDI is used.
DMSA .set 55h ; address of subank address registerDMSDI .set 56h ; address of subbank access registerDMSRC5 .set 19h ; subaddress of DMSRC5DMDST5 .set 1AhDMCTR5 .set 1BhDMSFC5 .set 1ChDMMCR5 .set 1DhSTM DMSRC5, DMSA ; DMSA= first sub addressSTM #2000h, DMSDI ; write 2000h to DMSRC5STM #3000h, DMSDI ; write 3000h to DMDST5STM #0010h, DMSDI ; write 0010h to DMCTR5STM #0002h, DMSDI ; write 2h to DMSFC5STM #0000h, DMSDI ; write 0h to DMMCR5
Example 3: Write a TMS320C54xx code to transfer a block of data from theprogram memory to the data memory. Following are the specifications:
DMSDIDMSDNDMSASub-addressedRegistersSUBBANKACCESSREGISTERSSUBBANKADDRESSREGISTER
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...