19.3 Functional Description
19.3.1 Signals
The SPI interface consists of up to four signals: MOSI, MISO, SCK, and NSS.
Master Out, Slave In (MOSI):
The MOSI signal is the data output pin when configured as a master device and the data input pin when
configured as a slave. It is used to serially transfer data from the master to the slave. Data is transferred on the MOSI pin most-signifi-
cant bit first. When configured as a master, MOSI is driven from the internal shift register in both 3- and 4-wire mode.
Master In, Slave Out (MISO):
The MISO signal is the data input pin when configured as a master device and the data output pin when
configured as a slave. It is used to serially transfer data from the slave to the master. Data is transferred on the MISO pin most-signifi-
cant bit first. The MISO pin is placed in a high-impedance state when the SPI module is disabled or when the SPI operates in 4-wire
mode as a slave that is not selected. When acting as a slave in 3-wire mode, MISO is always driven from the internal shift register.
Serial Clock (SCK):
The SCK signal is an output from the master device and an input to slave devices. It is used to synchronize the
transfer of data between the master and slave on the MOSI and MISO lines. The SPI module generates this signal when operating as a
master and receives it as a slave. The SCK signal is ignored by a SPI slave when the slave is not selected in 4-wire slave mode.
Slave Select (NSS):
The function of the slave-select (NSS) signal is dependent on the setting of the NSSMD bitfield. There are three
possible modes that can be selected with these bits:
• NSSMD[1:0] = 00: 3-Wire Master or 3-Wire Slave Mode: The SPI operates in 3-wire mode, and NSS is disabled. When operating as
a slave device, the SPI is always selected in 3-wire mode. Since no select signal is present, the SPI must be the only slave on the
bus in 3-wire mode. This is intended for point-to-point communication between a master and a single slave.
• NSSMD[1:0] = 01: 4-Wire Slave or Multi-Master Mode: The SPI operates in 4-wire mode, and NSS is configured as an input. When
operating as a slave, NSS selects the SPI device. When operating as a master, a 1-to- 0 transition of the NSS signal disables the
master function of the SPI module so that multiple master devices can be used on the same SPI bus.
• NSSMD[1:0] = 1x: 4-Wire Master Mode: The SPI operates in 4-wire mode, and NSS is enabled as an output. The setting of
NSSMD0 determines what logic level the NSS pin will output. This configuration should only be used when operating the SPI as a
master device.
The setting of NSSMD bits affects the pinout of the device. When in 3-wire master or 3-wire slave mode, the NSS pin will not be map-
ped by the crossbar. In all other modes, the NSS signal will be mapped to a pin on the device.
Slave Device
Master Device
MISO
MOSI
SCK
MISO
MOSI
SCK
NSS
NSS
Figure 19.2. 4-Wire Connection Diagram
Slave Device
Master Device
MISO
MOSI
SCK
MISO
MOSI
SCK
Figure 19.3. 3-Wire Connection Diagram
EFM8SB2 Reference Manual
Serial Peripheral Interfaces (SPI0 and SPI1)
silabs.com
| Smart. Connected. Energy-friendly.
Rev. 0.1 | 208