![](http://datasheet.mmic.net.cn/290000/XPC801ZP25_datasheet_16187868/XPC801ZP25_390.png)
Serial Communication Modules
MOTOROLA
MPC801 USER’S MANUAL
16-19
16
16.3.2.3.2 SPI Slave Mode.
When the serial peripheral interface is in slave mode, it
receives messages from an SPI master and replies simultaneously. The SPISEL pin must
be asserted before receive clocks will be recognized and once it is asserted, the SPICLK pin
becomes an input from the master to the slave. The SPICLK pin can vary frequency from
DC to the BRGCLK/2 (12.5MHz for a 25MHz system). Before the data exchange, the core
writes the data to be transmitted into the SPITD register. The core should then set the STR
bit in the SPI command (SPCOM) register to enable the serial peripheral interface to prepare
the data for transmission and wait for the SPISEL pin to be asserted. Data is shifted out from
the slave on the SPIMISO pin and shifted in through the SPIMOSI pin.
The serial peripheral interface sets the E bit of the SPIER and issues a maskable interrupt
to the system interface unit interrupt controller whenever its transmit buffer is not full. The
serial peripheral interface sets the F bit of the SPIER and issues a maskable interrupt to the
system interface unit interrupt controller whenever its receive buffer has been filled with
data. The serial peripheral interface then continues receiving data until the SPISEL pin is
negated. Transmission continues until no more data is available or the SPISEL pin is
negated. After completing the transmission of characters, the serial peripheral interface
transmits ones until the SPISEL pin is negated.
16.3.2.3.3 Multimaster Operation.
The serial peripheral interface can operate in a
multimaster environment in which some SPI devices are connected on the same bus. In this
configuration, the SPIMOSI, SPIMISO, and SPICLK pins of all serial peripheral interfaces
are connected together and the SPISEL
input pins are connected separately. In this
environment, only one SPI device can work as a master at a time and all the others must be
slaves. When the serial peripheral interface is configured as a master and its SPISEL input
pin goes active, a multimaster error occurs because more than one SPI device is acting as
bus master.
The serial peripheral interface sets both ME bits in the SPIER and SPIRD registers. The
serial peripheral interface operation and output drivers are also disabled. The core should
clear the EN bit of the SPI mode (SPMODE) register before using the serial peripheral
interface again. After all the issues are addressed, the ME bit should be cleared and the
serial peripheral interface enabled following the same procedure that is used after a reset.