SYNCHRONOUS SERIAL INTERFACE (SSI)
MOTOROLA
PORT C
6 - 149
the transmitter and receiver when TX data is transferred to the transmit data shift register.
This SPI master operating mode is shown in Figure 6-83. Word sync is inherent in the
clock signal, and the operation format must provide frame synchronization.
Figure 6-84 is the block diagram for the program presented in Figure 6-85. This program
contains a transmit test program that was written as a scoping loop (providing a repetitive
sync) using the on-demand, gated, synchronous mode with no interrupts (polling) to trans-
mit data to the program shown in Figure 6-86. The program also demonstrates using
GPIO pins as general-purpose control lines. PC3 is used as an external strobe or enable
for hardware such as an A/D converter.
The transmit program sets equates for convenience and readability. Test data is then writ-
ten to X: memory, and the data pointer is initialized. Setting M0 to two makes the buffer
circular (modulo 3), which saves the step of resetting the pointer each loop. PC3 is con-
figured as a general-purpose output for use as a scope sync, and CRA and CRB are then
initialized. Setting the PCC bits begins SSI operation; however, no data will be transmitted
until data is written to TX. PC3 is set high at the beginning of data transmission; data is
then moved to TX to begin transmission. A JCLR instruction is then used to form a wait
loop until TDE equals one and the SSI is ready for another data word to be transmitted.
Two more data words are transmitted in this fashion (this is an arbitrary number chosen
for this test loop). An additional wait is included to make sure that the frame sync has gone
low before PC3 is cleared, indicating on the scope that transmission is complete. A wait
of 100 NOPs is implemented by using the REP instruction before starting the loop again.
DSP1
MASTER
SLAVE
DSP2
SHIFT REGISTER
SHIFT REGISTER
SPI
CLOCK GENERATOR
Figure 6-83 SPI Configuration
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
.
..