29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RM0008<br />

Secure digital input/output interface (SDIO)<br />

Table 122.<br />

Short response format<br />

Bit position Width Value Description<br />

47 1 0 Start bit<br />

46 1 0 Transmission bit<br />

[45:40] 6 - Comm<strong>and</strong> index<br />

[39:8] 32 - Argument<br />

[7:1] 7 - CRC7(or 1111111)<br />

0 1 1 End bit<br />

Table 123.<br />

Long response format<br />

Bit position Width Value Description<br />

135 1 0 Start bit<br />

134 1 0 Transmission bit<br />

[133:128] 6 111111 Reserved<br />

[127:1] 127 - CID or CSD (including internal CRC7)<br />

0 1 1 End bit<br />

The comm<strong>and</strong> register contains the comm<strong>and</strong> index (six bits sent to a card) <strong>and</strong> the<br />

comm<strong>and</strong> type. These determine whether the comm<strong>and</strong> requires a response, <strong>and</strong> whether<br />

the response is 48 or 136 bits long (see Section 20.9.4 on page 499). The comm<strong>and</strong> path<br />

implements the status flags shown in Table 124:<br />

Table 124.<br />

Flag<br />

CMDREND<br />

CCRCFAIL<br />

CMDSENT<br />

CTIMEOUT<br />

CMDACT<br />

Comm<strong>and</strong> path status flags<br />

Description<br />

Set if response CRC is OK.<br />

Set if response CRC fails.<br />

Set when comm<strong>and</strong> (that does not require response) is sent<br />

Response timeout.<br />

Comm<strong>and</strong> transfer in progress.<br />

The CRC generator calculates the CRC checksum for all bits before the CRC code. This<br />

includes the start bit, transmitter bit, comm<strong>and</strong> index, <strong>and</strong> comm<strong>and</strong> argument (or card<br />

status). The CRC checksum is calculated for the first 120 bits of CID or CSD for the long<br />

response format. Note that the start bit, transmitter bit <strong>and</strong> the six reserved bits are not used<br />

in the CRC calculation.<br />

The CRC checksum is a 7-bit value:<br />

CRC[6:0] = Remainder [(M(x) * x 7 ) / G(x)]<br />

G(x) = x 7 + x 3 + 1<br />

M(x) = (start bit) * x 39 + ... + (last bit before CRC) * x 0 , or<br />

M(x) = (start bit) * x 119 + ... + (last bit before CRC) * x 0<br />

Doc ID 13902 Rev 9 465/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!