主要内容

SPI Mode

SPI mode for data transmission

Model Configuration Pane: Hardware Implementation / Hardware board settings / Target hardware resources / SPI properties

Description

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.

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.

Settings

Mode 0 - Clock Polarity 0, Clock Phase 0 | Mode 1 - Clock Polarity 0, Clock Phase 1 | Mode 2 - Clock Polarity 1, Clock Phase 0 | Mode 3 - Clock Polarity 1, Clock Phase 1
  • 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.

Programmatic Use

No programmatic use is available.

Version History

Introduced in R2015b