
8
The following four bytes in the command are 0x00. These are called the argument
bytes. For a read or write operation the address would be given with these bytes.
There is no argument for a command 0, so these are all given as 0x00.
The final byte is the Cyclic Redundancy Check (CRC). This is used by the SD card to
ensure that the information was read correctly. The default setting for the use of the
CRC is off, so while the SD card is in SPI mode, it ignores all CRC values, and dummy
bytes such as 0x95 can be used. The only CRC that is necessary to give is for the
command 0. After the dummy clock pulses are sent to the SD card, it will wait for an
incoming command.
Every full command issued to the SD card will be responded to with a response token
from the SD card. This shows if the command was received and carried out correctly.
Figure 6 shows the makeup of the token response.
Figure 6: Response Token. Taken from SD Specifications Part 1 Version 2.00 [4, 111].
As the figure shows there are three bits, S1 to S3, that make up the response
token. These bits show the results of the command given. For example, there are
three possible response tokens for a write operation which are 101 indicating a CRC
error, 110 indicating a data write error, and 010 indicating the data has been
accepted. [5.]
Many commands need to be issued in order to determine how to proceed with
the communications of the SD card as there are many different makes and
models of SD cards that should be able to be used in the same systems. These
commands are used for example to ensure the card is working at the correct
voltage level and that the commands given to the card are in the correct
format. This process alone could easily take up a lot of the microcontroller's
memory.
Komentarze do niniejszej Instrukcji