Motorola MSC8101 ADS User's Guide Page 174

  • Download
  • Add to my manuals
  • Print
  • Page
    / 346
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 173
8-22 MSC8101 User’s Guide
Host Interface (HDI16)
Example 8-9 shows the code necessary to set up a dual DMA to receive BUFF_SIZE
16-bit data elements from the HDI16 and place them into a buffer in the internal SRAM
located at BUFF_START. An interrupt is generated when the DMA is finished.
Example 8-9. Receive Interrupt Service Routine
INIT_ATTR0 EQU $08000010
INIT_ATTR1 EQU $80000000
INIT_DCHCR0 EQU $80000005
INIT_DCHCR1 EQU $80010045
INIT_DIMR EQU $40000000
INIT_ELIRE EQU $0c00
; setup source DMA DCPRAM
move.l #BD_ADDR0,r1 ; set source address base
moveu.l #I_GPCM+HORX,d0
move.l d0,(r1)
move.l #BD_SIZE0,r1 ; set size of source transfer
moveu.l #BUFF_SIZE,d0
move.l d0,(r1)
move.l #BD_BSIZ0,r1 ; set source base size
moveu.l #$00000000,d0
move.l d0,(r1)
move.l #BD_ATTR0,r1 ; set source channel attributes
moveu.l #INIT_ATTR0,d0
move.l d0,(r1)
; setup dstination DMA DCPRAM
move.l #BD_ADDR1,r0 ; set destination address base
moveu.l #BUFF_START,d0
move.l d0,(r0)
move.l #BD_SIZE1,r0 ; set size of destination transfer
moveu.l #PATT_SIZE,d0
move.l d0,(r0)
move.l #BD_BSIZ1,r0 ; set destination base size
moveu.l #$00000000,d0
move.l d0,(r0)
move.l #BD_ATTR1,r0 ; set destination channel attributes
moveu.l #INIT_ATTR1,d0
move.l d0,(r0)
; setup DMA internal mask register
move.l #M_DIMR,r1 ; set DIMR
moveu.l #INIT_DIMR,d0
move.l d0,(r1)
; setup DMA channel configuration and activate
move.l #M_DCHCR0,r1 ; set DCHCR0
moveu.l #INIT_DCHCR0,d0
move.l d0,(r1)
Page view 173
1 2 ... 169 170 171 172 173 174 175 176 177 178 179 ... 345 346

Comments to this Manuals

No comments