Main Content

SPI properties

Set the SPI bus properties of an Arduino® board to effectively manage communication between an Arduino board and SPI peripheral devices.

You can configure virtual SPI and SPI hardware properties for ESP32 Arduino-compatible boards. You can also configure SPI modules 0 and 1 for Raspberry Pi® Pico (Arduino Compatible) and Raspberry Pi Pico W (Arduino Compatible) hardware boards.

SPI Clock Out Frequency (KHz)

Select the rate at which the clock signal oscillates on the clock line during SPI communication. This frequency determines how fast data is transferred between the devices. This table lists the SPI clock out frequencies supported by different Arduino boards.

Arduino BoardsSupported SPI Clock Out Frequency (KHz)
Arduino Due4000 (default), 21000, 14000, 10500, 8400, 7000, 2000, 1000, 500, 336
Arduino Leonardo, Arduino Mega 2560, Arduino Mega ADK, Arduino Micro, Arduino Robot Control Board, Arduino Robot Motor Board, Arduino Uno, Arduino Uno R4 Minima, Arduino Uno R4 WiFi, ESP32-WROOM (Arduino Compatible) and ESP32-WROVER (Arduino Compatible) both VSPI and HSPI modules, Raspberry Pi Pico (Arduino Compatible) and Raspberry Pi Pico W (Arduino Compatible) both SPI0 and SPI1 modules4000 (default), 8000, 2000, 1000, 500, 250, 125
Arduino MKR WiFi 1010, Arduino MKR 1000, Arduino MKR Zero, Arduino Nano 3.0, Arduino Nano 33 BLE Sense, Arduino Nano 33 IoT, Arduino Nano RP2040 Connect, Teensy 4.0 (Arduino Compatible), Teensy 4.1 (Arduino Compatible)4000 (default), 12000, 8000, 2000, 1000, 500, 250, 125

SPI Mode

Select an SPI mode for data transmission. SPI mode refers to the configuration of clock polarity and clock phase, which determine how data is sampled and shifted in relation to the clock signal. These settings are crucial for ensuring proper communication between devices. SPI mode is defined by two parameters, clock polarity and clock phase.

  • Mode 0 - Clock Polarity 0, Clock Phase 0 — Initiate data sample when the clock signal is low and when data is on the rising edge of the clock and shifted out on the falling edge.

  • Mode 1 - Clock Polarity 0, Clock Phase 1 — Initiate data sample when the clock signal is low and when data is on the falling edge of the clock and shifted out on the rising edge.

  • Mode 2 - Clock Polarity 1, Clock Phase 0 — Initiate data sample when the clock signal is high and when data is on the falling edge of the clock and shifted out on the rising edge.

  • Mode 3 - Clock Polarity 1, Clock Phase 1 — Initiate data sample when the clock signal is high and when data is on the rising edge of the clock and shifted out on the falling edge.

Bit order

Select the bit order for transmission.

  • MSB first — Send the most significant bit first for data transmission.

  • LSB first — Send the least significant bit first for data transmission.

SD Card SPI CS Pin

Enter the chip select (CS) pin number of the SD card when interfaced with the Arduino board for SPI communication. This table lists the Arduino boards that support configuring the CS pin for the SD card.

Supported Arduino BoardsSD Card CS Pin Number
Arduino Due, Arduino Leonardo, Arduino MKR WiFi 1010, Arduino MKR 1000, Arduino Mega 2560, Arduino Mega ADK, Arduino Micro, Arduino Nano 33 BLE Sense, Arduino Nano 33 IoT, Arduino Uno4
Arduino MKR Zero28

Note

Do not change the CS pin for the SD card when using an Arduino MKR Zero board. Because the MKR Zero board has an in-built SD card slot, the support package auto-populates the parameter.

CAN SPI CS Pin

Enter the CS pin that the CAN shield uses for SPI communication with the Arduino board. This table lists the Arduino boards that support configuring the CS pin for CAN shield.

Supported Arduino BoardsCAN SPI CS Pin Number
Arduino Due10
Arduino Leonardo, Arduino Mega 2560, Arduino Mega ADK, Arduino Micro, Arduino Uno9
Arduino MKR WiFi 1010, Arduino MKR 1000, Arduino MKR Zero, Arduino Nano 33 BLE Sense, Arduino Nano 33 IoT3

SDO Pin

Enter the serial data out (SDO) pin number of the Arduino board to which the SPI peripheral device is connected. This table lists the Arduino boards that support configuring the SDO pin of an SPI device.

Supported Arduino BoardsVSPI ModuleHSPI Module
ESP32-WROOM (Arduino Compatible), ESP32-WROVER (Arduino Compatible)23 (default), 0-5, 12-19, 21, 22, 25-27, 32-36, 3913 (default), 0-5, 12, 14-19, 21-23, 25-27, 32-36, 39

Supported Arduino BoardsSPI0 ModuleSPI1 Module
Raspberry Pi Pico (Arduino Compatible), Raspberry Pi Pico W (Arduino Compatible)19 (default), 7, 315 (default), 11

SDI Pin

Enter the serial data in (SDI) pin number of the Arduino board to which the SPI peripheral device is connected. This table lists the Arduino boards that support configuring the SDI pin of an SPI device.

Supported Arduino BoardsVSPI ModuleHSPI Module
ESP32-WROOM (Arduino Compatible), ESP32-WROVER (Arduino Compatible)19 (default), 0-5, 12-18, 21-23, 25-27, 32-36, 3912 (default), 0-5, 13-19, 21, 22, 25-27, 32-36, 39

Supported Arduino BoardsSPI0 ModuleSPI1 Module
Raspberry Pi Pico (Arduino Compatible), Raspberry Pi Pico W (Arduino Compatible)16 (default), 4, 012 (default), 8

SCK Pin

Enter the serial clock pin number of the Arduino board to which the SPI peripheral device is connected. This table lists the Arduino boards that support configuring the SCK pin of an SPI device.

Supported Arduino BoardsVSPI ModuleHSPI Module
ESP32-WROOM (Arduino Compatible), ESP32-WROVER (Arduino Compatible)18 (default), 0-5, 12-17, 19, 21-23, 25-27, 32-36, 3914 (default), 0-5, 12, 13, 15-19, 21-23, 25-27, 32-36, 39

Supported Arduino BoardsSPI0 ModuleSPI1 Module
Raspberry Pi Pico (Arduino Compatible), Raspberry Pi Pico W (Arduino Compatible)18 (default), 6, 214 (default), 10