...
Anchor |
---|
1047027 | 1047027 | SD/MMC SPI
Communication Anchor |
---|
1047028 | 1047028 | SPI is a simple protocol supported by peripherals commonly built-in on CPUs. Moreover, since the communication can easily be accomplished by software control of GPIO pins (“software SPI” or “bit-banging”), a SD/MMC card can be connected to almost any platform. In SPI mode, seven pins on the SD/MMC device are used, with the functions listed in
Table 12-4 Table - SD/MMC pinout (SPI mode). As with any SPI device, four signals are used to communicate with the host (CS, DataIn, CLK and DataOut). Some card holders contain circuitry for card detect and write protect indicators, which the MCU/MPU may also monitor.
anchor...
...
HTML Table |
---|
summary |
---|
class | Plain_Table |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
Anchor |
---|
1051489 | 1051489 | Pin Table Cell (td) |
---|
Anchor |
---|
1051491 | 1051491 | Name Table Cell (td) |
---|
Anchor |
---|
1051493 | 1051493 | Type Table Cell (td) |
---|
Anchor |
---|
1051495 | 1051495 | Description Table Row (tr) |
---|
Table Cell (td) |
---|
Anchor |
---|
1051497 | 1051497 | 1 Table Cell (td) |
---|
Anchor |
---|
1051499 | 1051499 | CS Table Cell (td) |
---|
Anchor |
---|
1051501 | 1051501 | I Table Cell (td) |
---|
Anchor |
---|
1051503 | 1051503 | Chip Select Table Row (tr) |
---|
Table Cell (td) |
---|
Anchor |
---|
1051505 | 1051505 | 2 Table Cell (td) |
---|
Anchor |
---|
1051507 | 1051507 | DataIn Table Cell (td) |
---|
Anchor |
---|
1051509 | 1051509 | I Table Cell (td) |
---|
Anchor |
---|
1051511 | 1051511 | |
...
title | Table - SD/MMC pinout (SPI mode) |
---|
|
Pin | Name | Type | Description |
---|
1 | CS | I | Chip Select | 2 | DataIn | I | Host-to-card commands and data |
Table Row (tr) |
---|
Table Cell (td) |
---|
Anchor |
---|
| 1051513 | 1051513 Table Cell (td) |
---|
Anchor |
---|
1051515 | 1051515 | Table Cell (td) |
---|
Anchor |
10515171051517 | Table Cell (td) |
---|
Anchor |
---|
1051519 | 1051519tr Table Cell (td) |
---|
Anchor |
---|
1051521 | 1051521 | Table Cell (td) |
---|
Anchor |
10515231051523 | Table Cell (td) |
---|
Anchor |
---|
1051525 | 1051525 | td Anchor |
---|
1051527 | 1051527 | Table Row (tr) |
---|
Table Cell (td) |
---|
Anchor |
10515291051529 | Table Cell (td) |
---|
Anchor |
---|
1051531 | 1051531 | td Anchor |
---|
1051533 | 1051533 | td Anchor |
---|
1051535 | 1051535 | Table Row (tr) |
---|
Table Cell (td) |
anchor1051537 | 1051537 | td Anchor |
---|
1051539 | 1051539 | Table Cell (td) |
---|
Anchor |
10515411051541 | Table Cell (td) |
---|
Anchor |
---|
1051543 | 1051543 | Table Row (tr) |
---|
Table Cell (td) |
---|
Anchor |
---|
1051545 | 1051545 | td Anchor |
---|
1051547 | 1051547 | Table Cell (td) |
---|
Anchor |
---|
1051549 | 1051549td Anchor |
---|
1051551 | 1051551 | Card-to-host data and status |
...
...
Anchor |
---|
1047038 | 1047038 | The four signals connecting the host (or master) and card (also known as the slave) are named variously in different manuals and documents. The DataIn pin of the card is also known as MOSI (Master Out Slave In); it is the data output of the host CPU. Similarly, the DataOut pin of the card is also known as MISO (Master In Slave Out); it is the data input of the host CPU. The CS and CLK pins (also known as SSEL and SCK) are the chip select and clock pins. The host selects the slave by asserting CS, potentially allowing it to choose a single peripheral among several that are sharing the bus (i.e., by sharing the CLK, MOSI and MISO signals).
Anchor |
---|
1047039 | 1047039 | When a card is first connected to the host (at card power-on), it is in the ‘inactive’ state, awaiting a
GO_IDLE_STATE
command to start the initialization process. The card will enter SPI mode (rather than card mode) because the driver holds the CS signal low while executing the
GO_IDLE_STATE
command. The card now in the ‘idle’ state moves through the ‘ready’ (as long as it supports the voltage range specified by the host) before ending up in ‘standby’. It can now get selected by the host (using the chip select) for data transfers.
Figure 15-5 flowcharts - Simplified SD/MMC SPI mode initialization and state transitions flowcharts this procedure.