DMA Controller
12-77
Peripherals
Example 12–10 sets up the DMA to transfer data (128 words) from an array
buffer to the serial port 0 output register with serial port transmit interrupt XINT0.
The DMA sends an interrupt to the CPU when the data transfer completes.
Serial port 0 is initialized to transmit 32-bit data words with an internally gener-
ated frame sync and a bit-transfer rate of 8(H1) cycles/bit. The receive-bit
clock is internally generated and equal in frequency to one-half of the ’C3x H1
frequency.
This program assumes previous initialization of the CPU interrupt-vector table
(specifically the DMA-to-CPU interrupt). The serial-port interrupt directly affects
only the DMA; no CPU serial-port interrupt-vector setting is required.
Note:
Serial-Port Transmit Synchronization
The DMA uses serial-port transmit interrupt XINT0 to synchronize transfers.
Because the XINT0 is generated when the transmit buffer has written the last
bit of data to the shifter, an initial CPU write to the serial port is required to
trigger XINT0 to enable the first DMA transfer.
Example 12–10.
DMA Transfer With Serial-Port Transmit Interrupt
* TITLE: DMA TRANSFER WITH SERIAL PORT TRANSMIT INTERRUPT
*
.GLOBAL START
.DATA
DMA
.WORD
808000H
; DMA GLOBAL-CONTROL REG ADDRESS
CONTROL
.WORD
0E13H
; DMA GLOBAL-CONTROL REG INITIALIZATION
SOURCE
.WORD
(1)
; DATA SOURCE ADDRESS
DESTIN
.WORD
80804CH
; DATA DESTIN ADDRESS: SERIAL-PORT OUTPUT REG
COUNT
.WORD
127
; NUMBER OF WORDS TO TRANSFER =(MSG LENGHT–1)
IEVAL
.WORD
00100400H
; IE REGISTER VALUE
.BSS
_ARRAY,128
; DATA ARRAY LOCATED IN .BSS SECTION
; THE UNDERSCORE USED IS JUST TO MAKE IT
; ACCESSIBLE FROM C (OPTIONAL)
RESET1
.WORD
0E10H
; DMA RESET
SPORT
.WORD
808040H
; SERIAL-PORT GLOBAL–CONTROL REG ADDRESS
SGCCTRL
.WORD
048C0044H
; SERIAL-PORT GLOBAL-CONTROL REG INITIALIZATION
SXCTRL
.WORD
111H
; SERIAL-PORT TX PORT CONTROL REG INITIALIZATION
STCTRL
.WORD
00FH
; SERIAL-PORT TIMER CONTROL REG INITIALIZATION
STPERIOD
.WORD
00000002H
; SERIAL-PORT TIMER PERIOD
SPRESET
.WORD
00880044H
; SERIAL-PORT RESET
RESET
.WORD
0H
; SERIAL-PORT TIMER RESET
.TEXT
START
LDP DMA
; LOAD DATA PAGE POINTER