SERIAL COMMUNICATION INTERFACE (SCI)
MOTOROLA
PORT C
6 - 53
before the preamble is complete and resume normal transmission. Sending a break fol-
lows the same procedure except that instead of clearing TE, SBK is set in the SCR to send
breaks and then reset to resume normal data transmission.
The example presented in Figure 6-28 uses the SCI in the asynchronous mode to transfer
data into buffers. Interrupts are used, allowing the DSP to perform other tasks while the
data transfer is occurring. This program can be tested by connecting the SCI transmit and
receive pins. Equates are used for convenience and readability.
The program sets the reset vector to run the program after reset, puts a MOVEP instruc-
tion at the SCI receive interrupt vector location, and puts a MOVEP and BCLR at the SCI
transmit interrupt vector location so that, after transmitting a byte, the transmitter is dis-
abled until another byte is ready for transmission. The SCI is initialized by setting the in-
terrupt level, which configures the SCR and SCCR, and then is enabled by writing the
PCC. The main program begins by enabling interrupts, which allows data to be received.
Data is transmitted by moving a byte of data to the transmit register and by enabling in-
terrupts. The jump-to-self instruction (SEND JMP SEND) is used to wait while interrupts
transfer the data.
;*******************************************************************************************
;
SCI ASYNC WITH INTERRUPTS AND SINGLE BYTE BUFFERS
*
;*******************************************************************************************
;*************************************************
;
SCI and other EQUATES
*
;*************************************************
START
EQU
$0040
;Start of program
PCC
EQU
$FFE1
;Port C control register
SCR
EQU
$FFF0
;SCI interface control register
SCCR
EQU
$FFF2
;SCI clock control register
SRX
EQU
$FFF4
;SCI receive register
STX
EQU
$FFF4
;SCI transmit register
BCR
EQU
$FFFE
;Bus control register
IPR
EQU
$FFFF
;Interrupt priority register
RXBUF
EQU
$100
;Receive buffer
TXBUF
EQU
$200
;Transmit buffer
Figure 6-28 SCI Asynchronous Transmit/Receive Example (Sheet 1 of 3)
;*************************************************
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..