SD card structure
Sep 22, 2022| SD card interface, in addition to retaining the 7 pins of MMC card, also adds 2 more pins on both sides as data lines.
In SD card 3.0 specification, the theoretical maximum capacity of SD card is up to 2TB and the theoretical maximum read/write speed is up to 104MB/s (in the latest 4.10 specification, the theoretical maximum read/write speed has been increased to 312MB/S).
SD card is mainly divided into four parts: external pins, internal registers, interface controller and internal storage media.

(1) The main pins and functions are described as follows:
CLK: Clock signal, the controller or SD card transmits a command bit or data bit in each clock cycle. In the default speed mode of the SD bus, the frequency can be changed between 0~25MHz, and the bus manager of the SD card can not be affected. The freedom to generate any limit is 0~25MHz, and in UHS-I speed mode, the clock frequency can be up to 208M.
CMD: Command and response multiplexing pin, the command is sent by the controller to the SD card, which can be from the controller to a single SD card, or to all cards on the SD bus; the response is the command sent by the memory card to the controller The answer, the answer can come from a single card or all cards.
DAT0~3: Data lines, data can be transmitted from the card to the controller or from the controller to the card.
(2) The registers and functions are described as follows:
OCR (Operating Conditions Register) register: The 32-bit operating condition register mainly stores the VDD voltage range, and the SD card operating voltage range is 2~3.6V.
CID (Card IlDentification Register) register: the card identification code register, the length is 16 bytes, which stores the unique identification number of the SD card, which cannot be modified after programming by the card manufacturer.
CSD (Card-Specific Data Register) register: The card characteristic data register contains the necessary configuration information when accessing the card data.
SCR (SD Card Configuration Register) register: SD card configuration register (SCR), provides some special features of SD card in this card, the length is 64 bits, the content of this register is set by the manufacturer in the factory.
RCA (Relatve Card Address) register: The card relative address register is a 16-bit writable address register, the controller can select the SD card with the corresponding address through the address.
DSR (Driver Stage Register) register: The driver stage register is an optional register used to configure the driver output of the car.
(3) Interface controller
It is mainly used to control and manage the internal storage core, control and set it by receiving commands sent to it by the user, and respond according to the command, and then perform operations such as reading and writing data in response.
(4) Internal storage media
Flash block for data memory storage.

