Texas Instruments TMS320C3x User Manual page 456

Texas instruments computer hardware user's guide
Table of Contents

Advertisement

Example 12–10.
* TITLE: DMA TRANSFER WITH SERIAL PORT TRANSMIT INTERRUPT
*
.GLOBAL START
.DATA
DMA
.WORD 808000H
CONTROL
.WORD 0E13H
SOURCE
.WORD (_ARRAY+1)
DESTIN
.WORD 80804CH
COUNT
.WORD 127
IEVAL
.WORD 00100400H
.BSS
RESET1
.WORD 0E10H
SPORT
.WORD 808040H
SGCCTRL
.WORD 048C0044H
SXCTRL
.WORD 111H
STCTRL
.WORD 00FH
STPERIOD
.WORD 00000002H
SPRESET
.WORD 00880044H
RESET
.WORD 0H
.TEXT
START
LDP DMA
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.
DMA Transfer With Serial-Port Transmit Interrupt
; DMA GLOBAL-CONTROL REG ADDRESS
; DMA GLOBAL-CONTROL REG INITIALIZATION
; DATA SOURCE ADDRESS
; DATA DESTIN ADDRESS: SERIAL-PORT OUTPUT REG
; NUMBER OF WORDS TO TRANSFER =(MSG LENGHT–1)
; IE REGISTER VALUE
_ARRAY,128
; DATA ARRAY LOCATED IN .BSS SECTION
; THE UNDERSCORE USED IS JUST TO MAKE IT
; ACCESSIBLE FROM C (OPTIONAL)
; DMA RESET
; SERIAL-PORT GLOBAL–CONTROL REG ADDRESS
; SERIAL-PORT GLOBAL-CONTROL REG INITIALIZATION
; SERIAL-PORT TX PORT CONTROL REG INITIALIZATION
; SERIAL-PORT TIMER CONTROL REG INITIALIZATION
; SERIAL-PORT TIMER PERIOD
; SERIAL-PORT RESET
; SERIAL-PORT TIMER RESET
; LOAD DATA PAGE POINTER
DMA Controller
Peripherals
12-77

Advertisement

Table of Contents
loading

Table of Contents