Hardware Reference
In-Depth Information
Chapter 13
SPI Bus
The Serial Peripheral Interface bus, known affectionately as spy , is a synchronous serial
interface that was named by Motorola. 39 The SPI protocol operates in full-duplex mode,
allowing it to send and receive data simultaneously. Generally speaking, SPI has a speed
advantage over the I2C protocol but requires more connections.
SPI Basics
Devices on the SPI bus communicate on a master/slave basis. Multiple slaves coexist
on a given SPI bus, with each slave being selected for communication by a slave select
signal (also known as chip select). Figure 13-1 shows the Raspberry Pi as the master
communicating with a slave. Additional slaves would be connected as shown with the
exception that a different slave select signal would be used.
Figure 13-1. SPI interface
Data is transmitted from the master to the slave by using the MOSI line (master
out, slave in). As each bit is being sent out by the master, the slave sends data bits on
the MISO line (master in, slave out). Bits are shifted out of the master and into the slave.
Simultaneously, bits are shifted out of the slave and into the master. Both transfers occur
to the beat of the system clock (CLK).
 
Search WWH ::




Custom Search