SD Card SPI CS Pin
R2026bChip 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 Boards | Default SD Card CS Pin Number |
|---|---|
| 4 |
Arduino MKR Zero | 28 |
| 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
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 Name | SD Card Interface Option | SD Card SPI CS Pin | Behavior |
|---|---|---|---|
| Teensy 4.0 | External SD Card Module only | Editable | Supports SD card logging only through an external SPI‑based SD card module. |
| Teensy 4.1 | External SD Card Module | Editable | Enables configuration of the chip‑select pin for an external SD card connected through SPI. |
| Teensy 4.1 | On‑board SD Card Interface | Read‑only | Uses the built‑in SD card hardware. The chip‑select pin is fixed. |
Programmatic Use
| No programmatic use is available. |
Version History
Introduced in R2023a