Motorola MSC8101 ADS User's Guide Page 129

  • Download
  • Add to my manuals
  • Print
  • Page
    / 346
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 128
DMA Programming Examples
DMA Channels 6-21
;DMA1 init to output DATA from DMA Buffer
move.l #BUFF_START,d0 ;Init destination address
move.l d0,M_BDADDR1
move.l #PATT_SIZE,d0 ;Init transfer size
move.l d0,M_BDSIZE1
move.l #ATTR1,d0 ;Init channel 1 attrib
move.l d0,M_BDATTR1
DMA_START
moveu.l #dchcr0,d0 ;Init channel 0 config
move.l d0,M_DCHCR0
moveu.l #dchcr1,d0 ;Init channel 1 config
move.l d0,M_DCHCR1
CONT
move.l M_DSTR,d5
bmtsts #0xc000,d5.h
jf CONT
6.4.4 External to External Dual Access, Chained with Interrupts
Example 6-4 uses a dual access to transfer 100 bytes of data from external SDRAM
memory to a second external SDRAM memory location. DMA channel 2 reads data from
the first external SDRAM memory address controlled by the SDRAM controller. Then
DMA channel 3 reads data from the DMA FIFO and writes it to the second external
SDRAM memory location under control of the SDRAM controller. This first transfer is
chained to a second transfer that moves the data from the second external SDRAM address
to the DMA FIFO using DMA channel 2. DMA channel 3 then transfers the data from the
DMA FIFO to internal SRAM and generates an interrupt when the transfer is complete.
The code implements the DMA transfer as follows:
Note: This code does not show initialization of the external and internal memory
banks. It assumes that this is already complete.
1. The code begins with initialization of interrupts, as follows:
a. The interrupt mask bits (I0-2) of the Status Register (SR) are cleared. This
permits all interrupt priority levels.
b. ELIRE is programmed with IRQ18 at priority level 5 level-triggered mode.
c. To allow a DMA Channel 3 interrupt, the associated mask bit in the DIMR is
set.
d. To enable interrupts, an ei instruction is issued.
2. The first DMA transaction is initialized. Since it is a dual access transaction, both
DMA channel 2 and DMA channel 3 must be programmed. BD_BSIZE is not
Page view 128
1 2 ... 124 125 126 127 128 129 130 131 132 133 134 ... 345 346

Comments to this Manuals

No comments