This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

The Raspberry Pi SPI Interface

Serial Peripheral Interface (SPI) is a full-duplex serial protocol for communicating with high-speed peripherals.

The SPI Master on Raspberry Pi™ hardware can drive two SPI peripheral devices. The SPI Master has four pins:

  • GPIO 11 (SPI0_SCLK) outputs a serial clock signal to synchronize communications.

  • GPIO 10 (SPI0_MOSI) outputs data to the SPI peripheral device.

  • GPIO 9 (SPI0_MISO) receives data from the SPI peripheral device.

  • GPIO 8 (SPI0_CE0) enables one SPI peripheral device.

  • GPIO 7 (SPI0_CE1) enables the other SPI peripheral device.

You can connect two SPI devices, such as displays, sensors, and flash storage to the SPI pins on the Raspberry Pi hardware. Connect both devices to the SCLK, MOSI, and MISO pins. Connect each device to one of the CE pins.

SPI on Raspberry Pi hardware supports:

  • Modes 0, 1, 2 or 3

  • 8 bits per word

  • Data speeds (Hz): 500000, 1000000, 2000000, 4000000, 8000000, 16000000, 32000000

For more information, see: