SERIAL COMMUNICATION INTERFACE (SCI)
6 - 54
PORT C
MOTOROLA
;
RESET VECTOR
*
;*************************************************
ORG
P:$0000
JMP
START
;*************************************************
;
SCI RECEIVE INTERRUPT VECTOR
*
;*************************************************
ORG
P:$0014
;Load the SCI RX interrupt vectors
MOVEP
X:SRX,Y:(R0)+ ;Put the received byte in the receive
;buffer. This receive routine is
;implemented as a fast interrupt.
;*************************************************
;
SCI TRANSMIT INTERRUPT VECTOR
*
;*************************************************
ORG
P:$0018
;Load the SCI TX interrupt vectors
MOVEP
X:(R3)+,X:STX ;Transmit a byte and
;increment the pointer in the
;transmit buffer.
BCLR
#12,X:SCR
;Disable transmit interrupts
;*******************************************************************************************
;
INITIALIZE THE SCI PORT AND RX, TX BUFFER POINTERS
*
;*******************************************************************************************
ORG
P:START
;Start the program at location $40
ORI
#$03,MR
;Mask interrupts temporarily
MOVEP
#$C000,X:IPR
;Set interrupt priority to 2
MOVEP
#$0B02,X:SCR ;Disable TX, enable RX interrupts
;Enable transmitter, receiver
;Point to point
;10-bit asynchronous
;(1 start, 8 data, 1 stop)
MOVEP
#$0022,X:SCCR;Use internal TX, RX clocks
;9600 BPS
MOVEP
#>$03,X:PCC
;Select pins TXD and RXD for SCI
MOVE
RXBUF,R0
;Initialize the receive buffer
MOVE
TXBUF,R3
;Initialize the transmit buffer
Figure 6-28 SCI Asynchronous Transmit/Receive Example (Sheet 2 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
.
..