Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor10470271047027 SD/MMC SPI Communication Anchor10470281047028 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

Panel

...

borderWidth

...

Pin Name Type Description 1 CS I Chip Select 2 DataIn I
HTML Table
summary
classPlain_Table
Table Row (tr)
Table Cell (td)
Anchor
10514891051489
Table Cell (td)
Anchor
10514911051491
Table Cell (td)
Anchor
10514931051493
Table Cell (td)
Anchor
10514951051495
Table Row (tr)
Table Cell (td)
Anchor
10514971051497
Table Cell (td)
Anchor
10514991051499
Table Cell (td)
Anchor
10515011051501
Table Cell (td)
Anchor
10515031051503
Table Row (tr)
Table Cell (td)
Anchor
10515051051505
Table Cell (td)
Anchor
10515071051507
Table Cell (td)
Anchor
10515091051509
Table Cell (td)
Anchor
10515111051511
0

...

1051513
titleTable - 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

3

Table Cell (td) Anchor10515151051515

Vss1

Table Cell (td) Anchor1051517

1051517

S

Table Cell (td) Anchor10515191051519

Supply voltage ground

tr

Table Cell (td) Anchor10515211051521

4

Table Cell (td) Anchor1051523

1051523

VDD

Table Cell (td) Anchor10515251051525

S

td

Anchor10515271051527

Supply voltage

Table Row (tr) Table Cell (td) Anchor1051529

1051529

5

Table Cell (td) Anchor10515311051531

CLK

td

Anchor10515331051533

I

td

Anchor10515351051535

Clock

Table Row (tr) Table Cell (td)anchor1051537

1051537

6

td

Anchor10515391051539

VSS2

Table Cell (td) Anchor1051541

1051541

S

Table Cell (td) Anchor10515431051543

Supply voltage ground

Table Row (tr) Table Cell (td) Anchor10515451051545

7

td

Anchor10515471051547

DataOut

Table Cell (td) Anchor10515491051549

O

td

Anchor10515511051551

Card-to-host data and status

...

...



Anchor10470381047038The 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

10470391047039When 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.