SERIAL COMMUNICATION INTERFACE (SCI)
6 - 44
PORT C
MOTOROLA
pointers, operating mode register, and the IPR.
The SCI is then configured and the interrupts are unmasked, which starts the data trans-
fer. The jump-to-self instruction (LAB0 JMP LAB0) is used to wait while interrupts transfer
the data.
The program shown in Figure 6-21 is the program for receiving data from the program pre-
sented in Figure 6-20. The program sets the reset vector to run the program after hard-
ware reset, puts the MOVEP instruction to store the data in a circular buffer starting at
$100 at the SCI receive interrupt vector location, puts another MOVEP instruction at the
SCI receive interrupt vector location, sets the memory wait states to zero, and configures
the memory pointers and IPR. The SCI is then configured and the interrupts are un-
masked, which starts the data transfer. The jump-to-self instruction (LAB0 JMP LAB0) is
used to wait while interrupts transfer the data.
6.3.7
Asynchronous Data
Asynchronous data uses a data format with embedded word sync, which allows an un-
synchronized data clock to be synchronized with the word if the clock rate and number of
bits per word is known. Thus, the clock can be generated by the receiver rather than re-
quiring a separate clock signal. The transmitter and receiver both use an internal clock
that is 16
×
the data rate to allow the SCI to synchronize the data. The data format re-
quires that each data byte have an additional start bit and stop bit. In addition, two of the
word formats have a parity bit. The multidrop mode used when SCIs are on a common
ORG
P:0
;Reset vector
JMP
$40
;
ORG
P:$18
;SCI transmit interrupt vector
MOVEP
Y:(R0)+,X:$FFF4
;Transmit low byte of data
ORG
P:$40
MOVEP
#0,X:$FFFE
;Clear BCR
MOVE
#$100,R0
;Data ROM start address
MOVE
#$FF,M0
;Size of data ROM - Wraps around at $200
MOVEC
#6,OMR
;Change operating mode to enable data ROM
MOVEP
#$C000,X:$FFFF
;Interrupt priority register
MOVEP
#$1200,X:$FFF0
;8-bit synchronous mode
MOVEP
#7,X:$FFE1
;Port C control register – enable SCI
MOVEC
#0,SR
;Unmask interrupts
LAB0 JMP
LAB0
;Wait in loop for interrupts
Figure 6-20 SCI Synchronous Transmit
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
.
..