SYNCHRONOUS SERIAL INTERFACE (SSI)
MOTOROLA
PORT C
6 - 133
;*************************************************
;
Init SSI Interrupt
*
;*************************************************
ANDI
#$FC,MR
;Unmask interrupts.
MOVEP
#$01F8,X:PCC
;Turn on SSI port.
JMP
*
;Wait for interrupt.
;*************************************************
;
MAIN INTERRUPT ROUTINE
*
;*************************************************
XMT
MOVEP
X:(R0);pl,X:TX
;Move data to TX register.
JSET
#0,X:FLG,LEFT
;Check channel flag.
RIGHT
BCLR
#0,X:CRB
;Clear SC0 indicating right channel data
MOVE
#>$01,X0
;Set channel flag to 1 for next data.
MOVE
X0,X:FLG
RTI
LEFT
BSET
#0,X:CRB
;Set SC0 indicating left channel data.
MOVE
#>$00,X0
;Clear channel flag for next data.
MOVE
X0,X:FLG
RTI
END
Figure 6-73 Normal Mode Transmit Example (Sheet 2 of 2)
6.4.7.2.2
Normal Mode Receive
If the receiver is enabled, a data word will be clocked in each time the frame sync signal
is generated (internal) or detected (external). After receiving the data word, it will be trans-
ferred from the SSI receive shift register to the receive data register (RX), RDF will be set
(receiver full), and the receive interrupt will occur if it is enabled (RIE=1).
The DSP program has to read the data from RX before a new data word is transferred
from the receive shift register; otherwise, the receiver overrun error will be set (ROE=1).
Figure 6-74 illustrates the program that receives the data transmitted by the program
shown in Figure 6-73. Using the flag to identify the channel, the receive program receives
the right- and left-channel data and separates the data into a right data buffer and a left
data buffer. The program shown in Figure 6-74 begins by setting equates and then using
a JSR instruction at the receive interrupt vector location to form a long interrupt. The
main program starts by initializing pointers to the right and left data buffers. The IPR,
CRA, and CRB are then initialized. The clock divider bits in the CRA do not have to be
set since an external receive clock is specified (SCKD=0). Pin SC0 is specified as an in-
put flag (SYN=1, SCD0=0); pin SC2 is specified as TX and RX frame sync (SYN=1,
SCD2=0). The SSI port is then enabled and interrupts are unmasked, which allows the
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
.
..