SD and microSD card pinout: SD bus and SPI modes
The SD card has 9 contacts and the microSD has 8: the microSD has only one ground. In SD bus mode, the bus uses CLK, CMD and four data lines, DAT0 to DAT3. In SPI mode, the same pads become CS (DAT3), DI (CMD), SCLK and DO (DAT0), and DAT1 and DAT2 go unused.
By Hugues Orgitello · Updated ·
Full-size SD card, 9 contacts
Assignment from Table 3-1 of the SD Physical Layer specification. Contact 9 sits before contact 1, on the chamfered-corner side: the physical order is 9, 1, 2 ... 8. Direction seen from the card. There is no write-protect contact: the WP slider is read mechanically by the socket.
| Pin | Signal | Dir. | SPI mode | microSD contact | Description |
|---|---|---|---|---|---|
| 1 | CD/DAT3 | I/O | CS, card select (active low) | 2 | Card detect and data, bit 3. 50 kOhm internal pull-up at power-up (Signal) |
| 2 | CMD | I/O | DI, data into the card | 3 | Command from the host, response from the card (Signal) |
| 3 | VSS1 | VSS | none | Ground (Ground) | |
| 4 | VDD | VDD | 4 | Supply, 2.7 V to 3.6 V (Power) | |
| 5 | CLK | In | SCLK, clock | 5 | Clock, driven by the host (Signal) |
| 6 | VSS2 | VSS2 | 6 | Ground (Ground) | |
| 7 | DAT0 | I/O | DO, data out of the card | 7 | Data, bit 0 (the only data line in 1-bit mode) (Signal) |
| 8 | DAT1 | I/O | RSV, reserved | 8 | Data, bit 1; interrupt line in SDIO (Signal) |
| 9 | DAT2 | I/O | RSV, reserved | 1 | Data, bit 2; Read Wait in SDIO (Signal) |
microSD card, 8 contacts
Numbering from the Kingston specsheet (Figure 1 and Table 3), the same as microSD sockets use; contact-side outline per Figure L-6 of the SD specification. Here the physical order follows the numbers, but the numbering differs from the SD card: DAT2 moves to contact 1. Contacts 4 (VDD) and 6 (VSS) are drawn longer, toward the insertion edge.
| Pin | Signal | Dir. | SPI mode | SD contact | Description |
|---|---|---|---|---|---|
| 1 | DAT2 | I/O | RSV, reserved | 9 | Data, bit 2 (Signal) |
| 2 | CD/DAT3 | I/O | CS, card select (active low) | 1 | Card detect and data, bit 3 (Signal) |
| 3 | CMD | I/O | DI, data into the card | 2 | Command and response (Signal) |
| 4 | VDD | VDD | 4 | Supply, 2.7 V to 3.6 V (Power) | |
| 5 | CLK | In | SCLK, clock | 5 | Clock, driven by the host (Signal) |
| 6 | VSS | VSS | 3, 6 | Ground (the only ground on a microSD) (Ground) | |
| 7 | DAT0 | I/O | DO, data out of the card | 7 | Data, bit 0 (Signal) |
| 8 | DAT1 | I/O | RSV, reserved | 8 | Data, bit 1 (Signal) |
UHS-II SD card: reassigned contacts and second row
Table 3-3 of the specification, full-size SD format. The second row (10 to 17) sits below the first, further from the insertion edge (Figure 3-13). In UHS-II mode, DAT0 and DAT1 (7 and 8) carry the differential RCLK clock; outside UHS-II, the first row keeps the assignment of the first table.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 4 | VDD1 | Main supply, 2.7 V to 3.6 V (Power) | |
| 7 | RCLK+ | In | Differential reference clock, positive (Differential pair) |
| 8 | RCLK- | In | Differential reference clock, negative (Differential pair) |
| 10 | VSS3 | Ground (Ground) | |
| 11 | D0+ | I/O | Lane D0, positive: input in full duplex, bidirectional in half duplex (Differential pair) |
| 12 | D0- | I/O | Lane D0, negative (Differential pair) |
| 13 | VSS4 | Ground (Ground) | |
| 14 | VDD2 | Second supply, 1.70 V to 1.95 V (Power) | |
| 15 | D1- | I/O | Lane D1, negative: output in full duplex, bidirectional in half duplex (Differential pair) |
| 16 | D1+ | I/O | Lane D1, positive (Differential pair) |
| 17 | VSS5 | Ground (Ground) |
An SD or microSD slot to integrate, a bus to move to UHS-I, a card that is not recognized? We design the interface, its ESD protection and the firmware that drives it.
SD bus mode or SPI mode?
The card starts in SD bus mode. It switches to SPI mode if CS is held low during the first CMD0 command, and only a power cycle brings it back to SD mode. SPI runs from any microcontroller SPI peripheral, at a cost in performance: one data line and one hardware CS per card.
What SPI does not do, per chapter 7 of the specification: no UHS-I, no guaranteed speed class (the host treats the card as class 0), no boot, no RPMB access, and functions added after version 2.00 must not be used. SDUC cards (above 2 TB) do not support SPI mode at all.
In SPI, command CRC is off by default, except for CMD0, which the card receives while still in SD mode: its CRC must be valid.
Pull-up resistors on CMD and DAT
CMD and DAT0 to DAT3 are pulled up to VDD on the host side, including the lines left unused in 1-bit or SPI mode. Espressif asks for 10 kOhm on those five lines; Kingston gives 10 to 100 kOhm for the pins reserved in SPI. A floating DAT1 or DAT2 can put the card in the wrong state.
The specification states that DAT1 to DAT3 are inputs at power-up and only become data lines after the SET_BUS_WIDTH command. While it does not use them, the host keeps its own DAT1 to DAT3 as inputs too.
Detecting the card: CD/DAT3 or the socket switch
At power-up, the card enables a 50 kOhm internal pull-up on CD/DAT3. The host detects the card by seeing the line go high, and the same pull-up selects the mode: left high, the line keeps SD mode; driven low, it selects SPI. The ACMD42 command disconnects this pull-up during transfers.
This method does not work with an external pull-up on DAT3: the line is then high with or without a card. That is why we most often use the socket’s card-detect switch. The Multicomp Pro MP013694 microSD socket, for example, adds two pins, CD1 and CD2, to its 8 contacts. If the product must honor an SD card’s write-protect slider, only a socket switch can read it: the card has no WP pin.
3.3 V or 1.8 V: UHS-I signaling
The card is always powered from 2.7 to 3.6 V and starts with 3.3 V signaling: Default Speed up to 25 MHz, High Speed up to 50 MHz. The UHS-I modes SDR50, DDR50 and SDR104 (up to 208 MHz) move CLK, CMD and DAT0 to DAT3 to 1.8 V, the card deriving that level from its 3.3 V supply.
The switch to 1.8 V is negotiated: the host requests it in ACMD41, the card accepts, then CMD11 starts the switch sequence. A 3.3 V-only host therefore works with a UHS-I card, without the fast modes. In hardware, the host I/O must be able to move from 3.3 V to 1.8 V (dual-voltage I/O or a level translator). Once at 1.8 V, the card returns to neither 3.3 V nor SPI without a power cycle: plan a switch on VDD.
Card power-up
Figure 6-5 of the specification sets the host-side sequence: VDD held below 0.5 V for at least 1 ms, then a ramp as monotonic as possible, from 0.1 ms to 35 ms. VDD must reach its minimum within 250 ms. The host then sends at least 74 clock cycles with CMD high (CS high in SPI) before the first command.
The 1 ms minimum below 0.5 V matters for restarts: a decoupling capacitor that drains slowly through a light load can leave VDD too high and the card in an undefined state. A load switch with active discharge solves it.
ESD protection at the socket
The contacts of a removable card are touched at every insertion. The full specification has a section on ESD requirements, left blank in the simplified version; on the host board, we place a protection diode array as close to the socket as possible, on CLK, CMD and DAT0 to DAT3.
The choice depends on the target speed. An integrated EMI and ESD filter such as the TI TPD6F003 (100 Ohm and 17 pF RC filter, 200 MHz at -3 dB, IEC 61000-4-2 level 4) suits memory cards at modest speeds. For SDR104 at 208 MHz, we prefer very low capacitance diodes, with no series resistor.
Dimensions: SD and microSD to scale
The SD card measures 24 × 32 mm, 2.1 mm thick (1.4 mm for the thin version). The microSD measures 11 × 15 mm, 1.0 mm thick. Both have their contacts along the insertion edge, on the face opposite the label.
UHS-II, SD Express and the second row
A UHS-II card keeps the first row to stay compatible with standard SD hosts and adds a second row: two differential lanes, D0 and D1, a second 1.8 V supply, VDD2, and three grounds. In UHS-II mode, the card no longer drives CLK, CMD, DAT3 or DAT2; the host must hold them at a defined level, with CLK low.
The UHS-II microSD also has a second row (Figure L-6 of the specification), but its assignment is in the microSD addendum, which is not public: we do not publish it. SD Express cards use the second row for a PCIe link with the NVMe protocol.
FAQ
- What is the microSD card pinout?
- From 1 to 8: DAT2, CD/DAT3, CMD, VDD, CLK, VSS, DAT0, DAT1. In SPI, contact 2 becomes CS, 3 DI, 5 SCLK and 7 DO; contacts 1 and 8 are reserved. Contact side facing you, insertion edge at the top, contact 1 is on the left, on the notch side.
- Why does the SD card have 9 contacts and the microSD 8?
- The SD card has two grounds, VSS1 (contact 3) and VSS2 (contact 6); the microSD keeps only one. The signals are the same, but the numbering changes: DAT2, contact 9 on the SD, becomes contact 1 on the microSD.
- Do all SD cards work in SPI mode?
- No. SDUC cards, above 2 TB, do not support SPI. The others do, but without UHS-I, without a guaranteed speed class and without the functions added after version 2.00 of the specification.
- Does an SD card need pull-up resistors?
- Yes, on CMD and DAT0 to DAT3, on the host side, even in 1-bit or SPI mode where DAT1 and DAT2 are unused. Card datasheets give 10 to 100 kOhm; Espressif recommends 10 kOhm.
- Does a UHS-I card work on a 3.3 V host?
- Yes. The card always starts with 3.3 V signaling and only moves to 1.8 V if the host asks for it. On a 3.3 V-only host, it runs at Default Speed (25 MHz) or High Speed (50 MHz).
- SD Association, Physical Layer Simplified Specification, version 9.10 (tables 3-1 and 3-3, figures 3-11, 3-13, L-1, L-5 and L-6, sections 3.7.1, 3.9, 6.4 and 7)
- Kingston, Industrial microSD (SDCIT) specsheet, microSD pin assignment and mechanical dimensions appendix
- Multicomp Pro, Micro SD Connector Push-Push MP013694 datasheet
- Espressif, ESP-IDF Programming Guide, SD Pull-up Requirements
- Texas Instruments, TPD6F003 6-channel EMI filter with ESD protection
Tables built from these documents and cross-checked against manufacturer datasheets. Always check the datasheet of the connector you actually use: some manufacturers number differently.
- The SPI bus: operation, modes and wiring
- Embedded Linux distributions compared
- Electromagnetic compatibility and ESD protection
- Raspberry Pi GPIO pinout
- Embedded firmware development
Other pinouts
- USB-C
- USB-A, USB-B, Mini and Micro
- RJ45 Ethernet
- M12 industrial
- DB9 (DE-9)
- JTAG and SWD
- HDMI
- Raspberry Pi GPIO
- M.2 (keys M, B and E)
- PCI Express card edge
- SATA
- DDR4 DIMM and SO-DIMM
- DDR5 DIMM and SO-DIMM
- OBD2 (OBD-II, J1962)
- ESP32, S3, C3 and C6
- Bosch ECUs EDC15P+, EDC16C34, MD1CS006
- RJ11, RJ14, RJ12 (6P6C)
- VGA (DE-15) and DVI
- RS-485 (Modbus)
- Arduino Uno, Nano and Mega