You are on page 1of 3

David Ryan

L01: Smith and Lanterman


Buffercam

Technical Review:
Non-volatile Digital Storage in Mobile Electronics (SD Cards)

Introduction
Secure Digital (SD) cards are a type of non-volatile digital storage used in many consumer
electronics. Non-volatile memory retains the data stored on it even when it is powered off. This
paper focuses on the types of SD cards, the underlying technology, and how to use them in an
embedded system.

Commercial Applications
Because SD cards are small, durable, and inexpensive, they are used in many consumer
electronics including digital cameras, mp3 players, cell phones, PDAs, and GPS units [1]. SD
cards are also used to log data from electronic sensors for use in academic, scientific, and
industrial applications. For example, they have been proposed for use in the implementation of a
“Car Black Box” designed to record information about car accidents [2]. Serial data loggers that
record directly to a SD memory card can be purchased as off-the-shelf modules [3]. These
premade modules are designed to make interfacing with SD card easy for small-scale projects.

SD memory cards come in several different sizes. MiniSD and microSD cards contain the same
underlying technology as the original SD memory card, but with smaller packaging. These
smaller cards can be placed in a mechanical adapter to allow them to be used in devices designed
for the larger SD cards [4,5]. MicroSD is the smallest of the three types of cards and is
approximately the size of a fingernail. Currently, about 80% of mobile handsets ship with a
microSD or miniSD slot [4].

Underlying Technology
The SD Card Association (Panasonic, SanDisk, and Toshiba) developed the SD Memory Card
specifications and revealed the technology in 2000 [6]. SD cards contain flash memory, a type of
EEPROM (Electrically Erasable Programmable Read-Only Memory) that is erased and written
in large blocks instead of individual bytes. Reads and writes are usually performed in 512 byte
blocks, but erasures are performed in bigger blocks. Depending on the size of the card, the size
of the erase block is typically either 32x512 bytes or 64x512 bytes [1]. Flash memory is
significantly cheaper than non-flash EEPROM and provides larger memory capacities and faster
write times. SD cards also offer several advantages over using embedded IC flash chips alone.
Since the memory cards are removable, the storage capacity of the device can be easily upgraded
as memory density increases. Additionally, SD cards contain a memory controller that identifies
defects in the flash memory and provides ECC for more reliable operation [1].

SD cards have two modes of communication: Serial Peripheral Interface (SPI) mode and Secure
Digital (SD) mode. SPI mode uses the Motorola SPI protocol that is implemented in many
microcontrollers. However, since SPI is a de facto standard rather than an internationally ratified
standard, the SPI settings must be adjusted to match the implementation used by the SD memory
card. The simplified specifications provide implementation details for communicating using SPI
mode at 25MHz [7]. However, the simplified specifications do not provide details for the SD
mode over a one-bit or four-bit interface because protocol is proprietary. Access to the full
specifications requires a $2500/yr membership to the SD Card Association.

Building Blocks for Implementation


A hardware connector is required to connect a SD card to an embedded electrical circuit. A
microcontroller or FPGA is also necessary to communicate with a SD card in an embedded
system. The SD Card Association has published the protocol for SPI mode communication at
25MHz, which is the easiest way to communicate with most microcontrollers. In addition, a file
system manager must be implemented to make the data on the SD card readable by other systems
and computers. Due to the prevalence of SD cards, it is relatively easy to find a code to manage
the SPI communication and the file system. For example, Microchip provides a free Memory
Disk Drive File System can manage a FAT file system and interface with a SD card based on
ISO/IEC 9293 specifications [8]. For Atmel microcontrollers, there is a similar Embedded
Filesystems Library [9]. Alternatively, a light-weight system that can read and write raw data to
a SD card if the FAT file system is not needed [10]. In this case, the data on the SD memory card
would not be recognized properly if the card was inserted into the memory card reader of a
computer without special software drivers to read raw data from the card. A similar light-weight
solution is also available for FPGAs [11]. By combining these building blocks in an embedded
system, data can be written and read from SD cards.
Works Cited

[1] J. Ellerbruch, "microSD: An alternative to conventional flash solutions," Embedded System


Engineering Magazine, vol. 13, no. 3, pp. 40-42, May 2005.

[2] D. G. Lee, S. M. Jung, and M. S. Lim, "System on Chip Design of Embedded Controller for
Car Black Box," 2007 IEEE Intelligent Vehicles Symposium, p. 1174–1177, 2007.

[3] SparkFun Electronics. Logomatic v2 Serial SD Datalogger. [Online].


http://www.sparkfun.com/commerce/product_info.php?products_id=8627

[4] SD Card Association. (2008) About microSD. [Online].


http://www.sdcard.org/about/micro_sd/

[5] SD Card Association. (2008) About miniSD. [Online]. http://www.sdcard.org/about/minisd/

[6] SD Card Association. (2008) About the SD Association. [Online].


http://www.sdcard.org/about/

[7] SD Group and SD Card Association. (2006, Sep.) SD Specifications - Simplified Physical
Layer Specification. [Online].
http://www.sdcard.org/about/memory_card/pls/Simplified_Physical_Layer_Spec.pdf

[8] Microchip. (2008) AN1045 - Implementing File I/O Functions Using Microchip’s Memory
Disk Drive File System Library. [Online].
http://ww1.microchip.com/downloads/en/AppNotes/01045b.pdf

[9] Sourceforge. (2007) Embedded Filesystems Library. [Online].


http://sourceforge.net/projects/efsl/

[10] www.Captain.at. (2007, Jun.) Atmel ATmega - SD Flash Memory Extension. [Online].
http://www.captain.at/electronic-atmega-sd-card.php

[11] opencores.org. (2008, Aug.) SD/MMC Controller: spimaster. [Online].


http://www.opencores.org/projects.cgi/web/spimaster/overview

You might also like