Main Content

SD Card SPI CS Pin

R2026b

Chip select (CS) pin number of the SD card

Since R2023a

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

Description

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 and Arduino compatible boards that support configuring the CS pin for the SD card.

Supported Arduino BoardsDefault SD 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 Uno

  • Teensy 4.0

4

Arduino MKR Zero

28
  • ESP32–WROOM

  • ESP32–WROVER

5

ESP32 S3

10

Teensy 4.1

254

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.

Settings

4 | 28 | 254 | 5 | 10 | use the pin mapping table for the corresponding block to determine the appropriate SD Card SPI CS pin for your hardware.

For ESP32 boards, you can configure virtual SPI and SPI hardware properties.

For Raspberry Pi® Pico and Raspberry Pi Pico W hardware boards, you can configure SPI modules 0 and 1 to support SPI–based workflows.

Use this table to compare the available SD card interface options and SPI CS pin behavior supported on each Teensy board.

Board NameSD Card Interface OptionSD Card SPI CS PinBehavior
Teensy 4.0External SD Card Module onlyEditableSupports SD card logging only through an external SPI‑based SD card module.
Teensy 4.1External SD Card ModuleEditableEnables configuration of the chip‑select pin for an external SD card connected through SPI.
Teensy 4.1On‑board SD Card InterfaceRead‑onlyUses the built‑in SD card hardware. The chip‑select pin is fixed.

Programmatic Use

No programmatic use is available.

Version History

Introduced in R2023a