Whether it be on our mobile phones, cameras, gaming consoles, or laptops, we all use Secure Digital (SD) cards once in a while for storage purposes. Well, everyone prefers them, thanks to their small size, durability, and non-volatile memory.
If you have a knack for technology, you’ve probably wondered how do SD cards work. Technically speaking, they are semiconductor-based flash memory cards that use NAND flash memory for storing data.
Moreover, they use the ‘Write Protection’ mechanism to prevent accidental data loss. If you wish to explore more, this article will guide you with everything you should know about SD cards and how they work.
SD Cards Use NAND Flash Memory
The first thing to know is that SD cards embed NAND flash memory chips that stores blocks of data in the form of charges. Basically, the technology adopts control and floating gates that help control data flow. Thus, if you’re transferring files, documents, or even photos to SD cards, they are all stored electronically.
Moreover, NAND is based on Electronically Programmable Read Only Memory (EEPROM), meaning it can be programmed and erased electronically.
- Single-Level Cells (SLC): This NAND stores only one bit of information in the form of 0 or 1 in each cell, making the data flow faster. Although they have the highest endurance, they are relatively expensive.
- Multi-Level Cells (MLC): This NAND stores two bits of information in each cell. Thus, they are slower than the SLCs but are comparatively economical.
- Triple-Level Cells (TLC): As the name suggests, this NAND stores three bits of information in each cell. So, they are even less powerful than SLCs and MLCs.
- Quad-Level Cells (QLC): This NAND stores four bits of data per cell. Hence, they are believed to be the slowest, cheapest, and with the least life expectancy among the four types.
- 3D NAND: Unlike the aforementioned 2D NANDs, they are multi-layered and store data in memory cells stacked one above the other. This ensures better endurance and improved performance over the former.
Basically, these NAND types are one of the many factors that determine the lifespan of SSDs, SD cards, and other memory drives. Hence, if you have an SD card supporting 3D NAND, it generally lasts longer.
Although most manufacturers claim that their SD cards last ten years, you should know that there are still other things that determine the lifetime. For example, using the memory cards at extreme temperatures, breaking the pins, or keeping them near a strong magnet (electromagnetic field) may negatively impact their lives.
How Do SD Cards Store & Retrieve Data?
In earlier days, we heavily relied on other storage drives, like Memory Sticks, Compact Flash cards, Smart Media cards, etc. Eventually, they were replaced by SD cards as they are relatively lighter in size and additionally support large storage.
Looking at the SD card closely, you’ll likely notice a row of terminals (pins) at the top section. Basically, some pins here are responsible for powering the card, while others work to help users store or recover data, like photos, videos, documents, and other files.
Like other storage devices, these flash memory cards also consist of transistors (that work like electrical switches) to help store data in ASCII code (a combination of 0 and 1). Hence, if the switch is turned on, the value ‘1’ is stored in the SD card, and if off, ‘0’ is stored.
For example, if you try storing the word ‘Example’, it will be stored as ‘01000101 01111000 01100001 01101101 01110000 01101100 01100101
’.
Well, the usage of regular transistors only aids in storing data temporarily. Hence, the stored data get lost, and we can’t retrieve them again. Thus, the NAND technology adopted by the SD cards utilizes MOSFET (Metal–Oxide–Semiconductor Field-Effect Transistor) that uses control and floating gates to store data permanently.
As shown in the illustration above, a typical transistor consists of a single gate. Here, when some positive voltage is passed from the source (value is 1), the gate is open, and data is stored. Likewise, when there is no voltage (value set to 0), the gate is closed, and information is not stored.
In such a case, if we remove our drive from the power source, no voltage is passed, and even the stored data will be lost. Thus, using a single-gate transistor isn’t applicable to SD cards.
Now, let’s look at the illustration of MOSFET, as shown above. Here, when the switch is turned on and the positive voltage is passed, some voltage gets stored at the top of the floating gate.
This ensures that whatever data is stored remains even when we remove the SD card from its slot. Now, we can easily retrieve this information from any other device. Interestingly, you can even use SD card readers and adapters if your PC has no SD card slot.
Basically, the number of transistors on an SD card determines the total memory capacity in SD cards. This means that the greater the number of MOSFETs, the more information will be stored. For example, a 32 GB memory card has a more significant number of transistors than a 16 GB, which is why we can store more information in the former.
Lastly, when you delete the saved data on your SD card, this time, a negative voltage is passed in the control gate. This removes the positive voltage, causing the data to be deleted.
SD Card Architecture
An SD card functions with these six components – Contact Pins, Registers, Card Interface Controller, Memory Core Interface, Power on Detection, and Memory Core. In this section, we will discuss each of them in brief.
Contact Pins
The nine contact pins or pads in an SD card ensure the whole body is seated correctly on the dedicated slots in the supported devices. Otherwise, your computer will likely not read the SD card.
Basically, the memory cards have data, power, and slot pins that work on either SPI (Serial Peripheral Interface) bus mode or SD bus mode. Moreover, they function only after interfacing with the Microcontroller Unit (MCU).
- Chip Select (CS): This pad or pin selects one or a set of integrated circuits. When active, it responds to input changes, and when inactive, it ignores any messages received.
- Command (CMD): This is the command pin that helps the SD card interact with the microcontroller for the exchange of vital information.
- VSS1 or GND: VVS1 is the first voltage source pin where the ground is to be connected.
- VCC: VCC or the Voltage Collector is another power pin used in SD cards that connects to the positive power in SD cards. Often, they are also called VDD or voltage drain.
- Clock (CLK): The clock pin is responsible for getting the clock signals or pulses from the microcontroller.
- VSS2: Like the VSS1, they connect to the ground and are also called the GND pin.
- DAT0 or DO: Basically, the Data Out or the DAT0 pin sends serial data to the MCU. In the SPI mode, this is used by the SPI Slave.
- DAT1 and DAT2: The final two pins are related to data and are responsible for the bi-directional communication between the SD card and MCU.
Registers
SD card registers are essential components that control various memory and storage features. Moreover, they also hold vital information, like the memory card’s identity number, serial number, manufacture date, etc. Below is a table consisting of all six registers with their length and function:
Register | Function | Length (in bits) |
OCR (Operating Conditions Register) | Stores voltage range (2 – 3.6V) | 32 |
CID (Card Identification Register) | Stores the unique SD card identification number | 128 |
RCA (Relative Card Address) | (Only in SD mode) Selects SD card by the address | 16 |
DSR (Driver Stage Register) | Responsible for drive outputs | 16 |
CSD (Card-Specific Data Register) | Stores SD card specific configuration information | 128 |
SCR (SD Card Configuration Register) | Provides special configuration features | 64 |
Card Interface Controller
The SD Card Interface Controller communicates with the contact pins, registers, and memory core interface to manage the overall internal storage of the memory card. Basically, the controller receives commands from an end user, and it responds accordingly.
Well, an SD card is an input device, and when we mount it on a PC, the CPU has to hold other operations and give priority to its commands. However, thanks to the card interface controller, these system interruptions are considerably minimized.
Moreover, the Card Interface Controller performs several operations, including reading, writing, and erasing saved information on the SD cards.
Memory Core Interface
Memory Core Interface interacts with the Card Interface Controller to provide a simple and responsive interface to an SD card.
Basically, the component is responsible for the overall implementation of the memory card. Also, it commands and sends crucial information to the Card Interface Controller for performing data operations.
Power on Detection
Power on Detection, located on the right side, detects the SD card after we have mounted it on a supporting device.
Furthermore, it provides power to the Card Interface Controller and Memory Core Interface for proper functioning. Also, you need this component if you’re planning to reset the SD card’s memory interface and controller.
Memory Core
The final component of SD cards is the Memory Core. Basically, this is the core area for data storage.
However, the storage area depends on the SD card family you’re using. Indeed, the working of an SD card is hugely influenced by its type. In short, SDUCs have the highest storage capacity (2 TB to 128 TB) and also work faster than the other SD families (SDSC, SDHC, and SDXC).
The below figure should help you identify the size and memory capacity of different SD card types.
How Secure are SD Cards?
One of the prime reasons end users prefer SD cards is their CPRM (Content Protection for Recordable Media) feature. This ensures copyright protection; hence, others cannot copy your content illegally.
To enable CPRM, you need to encode your content with Media Identifier and Media Key Block. This way, even if another user copies the data, they won’t be able to read it. Moreover, to access the CPRM-encoded data, you require a CPRM-enabled device and use the Media Identifier and Media Key Block to decrypt it.
Furthermore, some SD, SDHC, SDUC, and SDXC also have an added physical security mechanism within the card. This is the write-protection lock and is present at the left part of the memory card.
Basically, sliding the lock downwards will activate write protection, meaning you can’t modify any data in the SD Card. Similarly, pushing it upwards will unlock your card, disabling the write-protection mechanism. This way, it prevents an SD card from corruption.
Moving on, most storage devices are susceptible to physical damage after falling from a certain height. On the other hand, an SD card’s wedge-shaped design, notch, and guide grooves provide additional security. Moreover, they ensure that the card is correctly inserted in the dedicated slot.