SYNCHRONOUS SERIAL INTERFACE (SSI)
MOTOROLA
PORT C
6 - 131
Figure 6-73 is an example of transmitting data using the SSI in the normal mode with a
continuous clock, a bit-length frame sync, and 16-bit data words. The purpose of the pro-
gram is to interleave and transmit right and left channels in a compact disk player. Four
SSI pins are used:
1. SC0 is used as an output flag to indicate right-channel data (OF0=1) or left-chan-
nel data (OF0=0)
2. SC2 is TX and RX frame sync out
3. STD is transmit data out
4. SCK clocks the transmit data out
Equates are set for convenience and readability. Test data is then put in the low X: mem-
ory locations. The transmit interrupt vector contains a JSR instruction (which forms a long
interrupt). The data pointer and channel flag are initialized before initializing CRA and
CRB. It is assumed that the DSP CPU and SSI have been previously reset.
At this point, the SSI is ready to transmit except that the interrupt is masked because the
MR was cleared on reset and Port C is still configured as general-purpose I/O. Unmasking
the interrupt and enabling the SSI pins allows transmission to begin. A “jump to self” in-
struction causes the DSP to hang and wait for interrupts to transmit the data. When an
interrupt occurs, a JSR instruction at the interrupt vector location causes the XMT routine
to be executed. Data is then moved to the TX register, and the data pointer is increment-
ed. The flag is tested by the JSET instruction and, if it is set, a jump to left occurs, and the
code for the left channel is executed. If the flag is not set, the code for the right channel is
executed. In either case, the channel flag in X0 and then the output flag are set to reflect
the channel being transmitted. Control is then returned to the main program, which will
wait for the next interrupt.
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
.
..