Using the
SSC (SPI) Interface in a Multimaster System
Semiconductor Group
3 of 40
AP1632 06.96
1
In the SAB C165 and C167, an internal High-Speed Synchronous Serial Interface is
implemented providing serial communication between C167 / C165 or other
microcontrollers with a transfer rate up to 5 MBaud at 20 MHz CPU clock. Due to the very
flexible configuration options this interface can be used in a wide range of applications
from simple external shift registers to expand the number of parallel ports or primitive
pulse width modulation (PWM) to high-end protocol driven microcontroller networks. For a
complete list of options for configuring the SSC refer to the C165 or C167 User’s Manual,
edition 8/94, section 11. Shown in the demo software is a multimaster full-duplex system
in which at a given time one microcontroller is configured as master while all others are in
slave mode.
This demo software has been created to show an example how to use the High-Speed
Synchronous Interface in a non-trivial application and to support solving of user specific
demands concerning the SSC. Due to pin limitations at Port2 (only P2.0-P2.7 available) of
the C165 it is recommended to use this software with C167 based boards only.
2
General operation and hardware environment for the SSC demo
Introduction
Figure 1:
Hardware for the SSC demonstration software
As shown in fig. 1, up to 16 C167 based boards are connected in full-duplex operation via
the SSC lines SCLK (SSC Shift Clock), MTSR (Master Transmit Slave Receive) and
MRST (Master Receive Slave Transmit). Every board is identified by a combination of 4
jumpers on the LED display board providing a 4-bit board ID. These ID is used in creating
and decoding messages to specify source and destination board. After starting the
program, the current board ID value is displayed on the center part of the LED display.
.
I
L
Push Button
external
RAM
P3.1-3.4
P3.0
P0.0-P0.15
P1.0-1.15
P4.0-4.7
P2.0-2.15
C167
s
P3.13/SCLK
P3.9/M TSR
P3.8/M RST
P3.13/SCLK
P3.9/M TSR
P3.8/M RST
C167
s
I
a
s
C167
VCC
R1,R2,R3
3.3k
SSC M aster Receive / Slave Transm it
SSC M aster Transm it / Slave Receive
SSC Shift Clock
SSC Dem o Board #1
SSC Dem o Board #2
SSC Dem o Board #3
(up to 16 boards;
dem o software lim ited)
. . .
I
a
P3.13/SCLK
P3.9/M TSR
P3.8/M RST