HB28E016/D032/D064/B128MM2
74
Cyclic Redundancy Check
(CRC)
The CRC is intended for protecting MultiMediaCard commands, responses and data transfer against
transmission errors on the MultiMediaCard bus. One CRC is generated for every command and checked
for every response on the CMD line. For data blocks one CRC per transferred block is generated. The
CRC is generated and checked as described in the following.
CRC7
The CRC7 check is used for all commands, for all responses except type R3, and for the CSD and CID
registers. The CRC7 is a 7-bit value and is computed as follows:
generator polynomial: G(x) = x
7
+ x
3
+ 1
M(x) = (first bit) * x
n
+ (second bit) * x
n-1
+...+ (last bit) * x
0
CRC[6...0] = Remainder [(M(x) * x
7
)/G(x)]
All CRC registers are initialized to zero. The first bit is the most left bit of the corresponding bitstring (of
the command, response, CID or CSD). The degree n of the polynomial is the number of CRC protected
bits decreased by one. The number of bits to be protected is 40 for commands and responses (n = 39), and
120 for the CSD and CID (n = 119).
CRC16
The CRC16 is used for payload protection in block transfer mode. The CRC check sum is a 16-bit value
and is computed as follows:
generator polynomial: G(x) = x
16
+ x
12
+x
5
+ 1,
M(x) = (first bit) * x
n
+ (second bit) * x
n-1
+...+ (last bit) * x
0
CRC[15...0] = Remainder [(M(x) * x
16
) / G(x)]
All CRC registers are initialized to zero. The first bit is the first data bit of the corresponding block. The
degree n of the polynomial denotes the number of bits of the data block decreased by one (e.g. n = 4095 for
a block length of 512 bytes). The generator polynomial G(x) is a standard CCITT polynomial. The code
has a minimal distance d=4 and is used for a payload length of up to 2048 Bytes (n <= 16383).