Raspberry Pi SPI

Raspberry Pi SPI Interface Pinout

The Raspberry Pi SPI is an interface consisting of five pins on the P1 header.

Interface Pins

P1 Header PinsSPI Function
P1-19MOSI
P1-21MISO
P1-23SCK
P1-24CE0
P1-26 CE1

Chip Select

The chip select, also called slave select, consists of pin 24 (CE0), and pin 26 (CE1). These control lines are for selecting the slave device when sending data. The selected device receives the data, whilst the other device ignores it.

Clock

The clock signal, generated by the Raspberry Pi, feeds the slave devices. This is because SPI is a synchronous bus communication system where data bits that enter and exit the devices are in synchronous with the clock pulse.

Although armatures will use this bus for single word (8-bit) communication, a real advantage of this type of serial bus allows 16-bit, 32-bit, and 64-bit word sizes depending upon the hardware.

Voltage Levels

On the Raspberry Pi, the voltage levels will be 3.3 V for logic 1 state and 0 V for logic 0 states.

Expander

The Raspberry Pi can control only two slave devices, and if your project has many slave devices then one option is to use the daisy-chaining configuration. In this configuration, all the slave devices connect to a single slave select control line.

This Article Continues...

SPI: Serial Peripheral Interface
SPI: Serial Peripheral Interface Daisy Chain
Raspberry Pi SPI