Technical details

Transfer modes

The physical interface comprises 9 pins, except that the miniSD card adds two unconnected pins in the center and the microSD card omits one of the two VSS (Ground) pins.


SD card pin assignment miniSD card pin assignment microSD card pin assignment
SD card pinning.jpg Mini SD card pinning.jpg Micro SD card pinning.jpg

Various SD cards may support various combinations of the following bus types and transfer modes. The SPI bus and one-bit SD bus are mandatory for all SD families, as explained in the next section.
  • SPI: Serial Peripheral Interface Bus is primarily used by embedded microcontrollers. This bus type supports only a 3.3-volt interface.
  • One-bit SD: Separate command and data channels and a proprietary transfer format.
  • Four-bit SD: Uses extra pins plus some reassigned pins. UHS-I and UHS-II requires this bus type.
Once the host device and the SD card negotiate a bus interface, the usage of the numbered pins is the same for all three card sizes:

Notes:
  1. Direction is relative to card. I = Input, O = Output.
  2. PP = Push-Pull logic, OD = Open-Drain logic.
  3. S = Power Supply, NC = Not Connected (or logical high).

Interface

Command interface
SD cards and host devices initially communicate through a synchronous one-bit interface, where the host device provides a clock signal that strobes single bits into and out of the SD card. The host device thereby sends 48-bit commands and receives responses. The card can signal that a response will be delayed, but the host device can abort the dialogue.
Through issuing various commands, the host device can:
nside a 512 MB SD card: NAND flash chip that holds the data (bottom) and SD controller (top)
  • Determine the type, memory capacity, and capabilities of the SD card
  • Command the card to use a different voltage, different clock speed, or advanced electrical interface
  • Prepare the card to receive a block to write to the flash memory, or read and reply with the contents of a specified block.
The command interface is an extension of the MultiMediaCard (MMC) interface. SD cards dropped support for some of the commands in the MMC protocol, but added commands related to copy protection. By using only commands supported by both standards until determining the type of card inserted, a host device can accommodate both SD and MMC cards.
Inside a 2 GB SD card: two NAND flash chips (top and middle), SD controller chip (bottom)
Electrical interface
All SD card families initially use a 3.3-volt electrical interface. On command, SDHC and SDXC cards switch to 1.8-volt operation.
At initial power-up or card insertion, the host device selects either the Serial Peripheral Interface (SPI) bus or the one-bit SD bus by the voltage level present on Pin 1. Thereafter, the host device may issue a command to switch to the four-bit SD bus interface, if the SD card supports it. For various card types, support for the four-bit SD bus is either optional or mandatory.
After determining that the SD card supports it, the host device can also command the SD card to switch to a higher transfer speed. Until determining the card's capabilities, the host device should not use a clock speed faster than 400 kHz. SD cards other than SDIO (see below) have a Default Speed clock rate of 25 MHz. The host device is not required to use the maximum clock speed that the card supports. It may operate at less than the maximum clock speed to conserve power. Between commands, the host device can stop the clock entirely.
Inside a SDHC card
SDIO cards
The SDIO family comprises Low-Speed and Full-Speed cards. Both types of SDIO cards support SPI and one-bit SD bus types. Low-Speed SDIO cards are allowed to also support the four-bit SD bus; Full-Speed SDIO cards are required to support the four-bit SD bus. To use a SDIO card as a "combo card" (for both memory and I/O), the host device must first select four-bit SD bus operation. Two other unique features of Low-Speed SDIO are a maximum clock rate of 400 kHz for all communications, and the use of Pin 8 as "interrupt" to try to initiate dialogue with the host device.
Ganging cards together
The one-bit SD protocol was derived from the MMC protocol, which envisaged the ability to put up to 3 cards on a bus of common signal lines. The cards use open collector interfaces, where a card may pull a line to the low voltage level; the line is at the high voltage level (because of a pull-up resistor) if no card pulls it low. Though the cards shared clock and signal lines, each card had its own chip select line to sense that the host device had selected it.
The SD protocol envisaged the ability to gang 30 cards together without separate chip select lines. The host device would broadcast commands to all cards and identify the card to respond to the command using its unique serial number.
In practice, cards are rarely ganged together because open-collector operation has problems at high speeds and increases power consumption. Newer versions of the SD specification recommend separate lines to each card.
Achieving higher card speeds
The SD specification defines four-bit-wide transfers. (The MMC specification supports this and also defines an eight-bit-wide mode.) Transferring several bits on each clock pulse improves the card speed. Advanced SD families have also improved speed by offering faster clock frequencies and double data rate

File system

Like other types of flash memory card, an SD card of any SD family is a block-addressable storage device, in which the host device can read or write fixed-size blocks by specifying their block number.
MBR and FAT
Most SD cards ship preformatted with one or more MBR partitions, where the first or only partition contains a file system. This lets them operate like the hard disk of a personal computer. Per the SD card specification, an SD card is formatted with MBR and the following file system:
  • For SDSC cards: FAT16
  • For SDHC cards: FAT32
  • For SDXC cards: exFAT
Most consumer products that take an SD card will expect it to be partitioned and formatted in this way. The universal support for FAT16 and FAT32 allow the usage of SDSC and SDHC cards on most host computers with a compatible SD reader, to present the user with the familiar method of named files in a hierarchical directory tree.
On such SD cards, standard utility programs such as Mac OS X's "Disk Utility" or Windows' SCANDISK can be used to repair or retrieve corrupted data, and sometimes recover deleted files. Defragmentation tools for FAT file systems may be used on such cards. The resulting consolidation of files may provide a marginal improvement in the time required to read or write the file, but not an improvement comparable to defragmentation of hard drives, where storing a file in multiple fragments may involve a time penalty to move between physical areas of the drive. Moreover, defragmentation performs writes to the SD card that count against the card's rated lifespan. The write endurance of the physical memory is discussed in the article on flash memory; newer technology to increase the storage capacity of a card currently provides worse write endurance.
When reformatting an SD card smaller than 4 GB, FAT16 should be used. (This is also an option for 4 GB cards, but it requires the use of 64 kiB clusters, which are not widely supported.) FAT16 does not support cards above 4 GB.
The SDXC specification makes Microsoft's proprietary exFAT file system mandatory, which is supported only by some proprietary operating systems.
Other file systems
Because the host views the SD card as a block storage device, the card does not require MBR partitions or any specific file system. The card can be reformatted to use any file system the operating system supports. For example:
  • Under Unix-like operating systems such as Linux or FreeBSD, SD cards can be formatted using the UFS, EXT3, ext4, btrFS, HFS Plus, or the ReiserFS file systems.
  • Under Mac OS X, SD cards can be partitioned as GUID devices and formatted with the HFS Plus file system.
  • Under Windows and some Unix systems, SD cards can be formatted using NTFS and, on later versions, exFAT.
Additionally, an SD card called Live SD can contain an embedded operating system (such as Live USB). Computers that can bootstrap from an SD card (either using a USB adapter or inserted into the computer's flash media reader) instead of the hard disk drive may thereby be able to recover from a corrupted hard disk drive. A Live SD can be write-locked to preserve the system's integrity.
Risks of reformatting
Reformatting an SD card with a different file system, or even with the same one, may make the card slower, or shorten its lifespan. Some cards use wear leveling, in which frequently modified blocks are mapped to different portions of memory at different times, and some wear-leveling algorithms are designed for the access patterns typical of the file allocation table on a FAT16 or FAT32 device. In addition, the preformatted file system may use a cluster size that matches the erase region of the physical memory on the card; reformatting may change the cluster size and make writes less efficient.

Power use


The power consumption of microSD cards varies by manufacturer, but appears to be in the range of 66-330 mW (20-100 mA at a supply voltage of 3.3 V). Specifications from TwinMos technologies list a maximum of 149 mW (45 mA) during transfer. Toshiba, on the other hand, lists 264-330 mW (80-100 mA).