SERIAL COMMUNICATION INTERFACE (SCI)
6 - 70
PORT C
MOTOROLA
;*******************************************************************************************
;
TIMER USING SCI TIMER INTERRUPT
*
;*******************************************************************************************
;*************************************************
;
SCI and other EQUATES
*
;*************************************************
START
EQU
$0040
;Start of program
SCR
EQU
$FFF0
;SCI control register
SCCR
EQU
$FFF2
;SCI clock control register
IPR
EQU
$FFFF
;Interrupt priority register
;*************************************************
;
RESET VECTOR
*
;*************************************************
ORG
P:$0000
JMP
START
;*************************************************
;
SCI TIMER INTERRUPT VECTOR
*
;*************************************************
ORG
P:$001C
;Load the SCI timer interrupt vectors
MOVE
(R0)+
;Increment the timer interrupt counter
NOP
;This timer routine is implemented
;as a fast interrupt
;*************************************************
;
INITIALIZE THE SCI PORT
*
;*************************************************
ORG
P:START
;Start the program at location $40
MOVE
#0,R0
;Initialize the timer interrupt counter
MOVEP
#$2000,X:SCR ;Select the timer interrupt
MOVEP
#$013F,X:SCCR;Set the interrupt rate at 1 ms
;(arbitrarily chosen)
;Interrupts/second =
;fosc/(64
×
(7(SCP)-+1)
×
(CD+1))
;Note that this is the same equation
;as for SCI async baud rate
Figure 6-36 SCI Timer Example (Sheet 1 of 2)
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
.
..