In Storage Insights #2, we highlighted some top recommendations for optimizing your storage device. There’s a lot of technical detail in Flash storage devices, so in the third edition of Storage Insights, we will cover the key technical elements of CompactFlash (CF) and Secure Digital (SD) flash storage cards.
CompactFlash (CF) became the most successful of the early memory card formats, surpassing smart media cards. Formats such as MMC/SD memory cards are smaller than CF, while offering comparable capacity and speed.
Traditional CF cards use the Parallel ATA (PATA) interface, but in 2008, a variant of CompactFlash, CFast was announced. CFast (also known as CompactFast) is based on the Serial ATA (SATA) interface.
CF cards can be used directly in a PC card slot with a plug-in adapter, used as an ATA (IDE) or PCMCIA storage device with a passive adapter or with a reader. Since the CF card is based on the PATA/IDE interface, it can easily be put on an PATA/IDE disk interface, as a Master or Slave device. Hence the CF card can serve as a disk drive in a Legacy PC using the IDE interface. This is because the CF card has a TRUE IDE mode, which allows the CF card to function exactly as a PATA/IDE drive. This mode is entered when the card has pin 9 grounded on the 50-pin connector when power is applied. When in TRUE IDE mode the CF card is not hot swappable. The passive adapter takes care of grounding pin 9.
CF Technical Description
The CompactFlash interface is a 50-pin subset of the 68-pin PCMCIA connector. It can be easily slipped into a passive 68-pin PCMCIA Type II to CF Type I adapter. The interface operates, depending on the state of mode pin 9 on power-up, as either a 16-bit PC Card Memory or I/O mode card, or as an IDE/PATA Disk via TRUE IDE mode.
CF IDE mode defines an interface that is Physically smaller than, but electrically identical to, the PATA/IDE interface. The CF device contains an Advanced Technology Attachment | ATA controller mode and appears to the host device as if it were a hard disk. CF devices must operate at 3.3 volts or 5 volts and can be swapped from system to system. CF (in TRUE IDE mode) supports cylinder-head-sector (C-H-S) and 28-bit logical block addressing (LBA 28). CF 5.0 introduced support for LBA-48 addressing. CF cards with flash memory can cope with extremely rapid changes in temperature, and Industrial CF cards can operate at a range of -40° to +85° C.
The CF Interface is a basically a Parallel ATA interface transferring 8 or 16-bit data in standard Memory and I/O modes or in TRUE IDE mode. Ultra DMA capable, these cards are capable of very high data transfer rates, provided the controller mapping is efficient.
Modern UDMA-7 CompactFlash Cards provide data rates up to 145MB/S.
CF Use in Embedded Systems
CF card use in embedded systems, such as routers, has been very popular even in the present. Legacy routers almost always contain CF cards. Direct connection of the 50-pin parallel bus to a CPU is not practical, although it was done in the old legacy systems, at a time when PATA drives were common. With the advent of Serial ATA (SATA), and most CPUs having a SATA port available, the CF card could be connected to the CPU using a CF to SATA bridge chip. This should allow full potential of the CF card to be realized.
SD/SDHC/SDXC Cards SD (Secure Digital) Card Basics
The SD card was spawned from the MMC (Multimedia) card. Very similar in electrical operation and form factor, the MMC card fell out of popularity in card format and was replaced with the SD card. The MMC card has one big advantage over the SD card in its capability to transfer 8 bits per frame to the SD cards 4 bits. SD has CPRM secure keys for recorded content protection.
MMC as an electrical entity is retained for use embedded MMC (eMMC), which is popular for use in embedded systems.
The SD interface is completely different than that of the CF/ATA. Operating voltages are 3.3V or 1.8V, with SDXC having a lower voltage transfer capability on added pins. SD is a hybrid (Parallel/Serial) interface.
The SD card operates in SD card mode or SPI mode. Mode is determined at power up, by the host device driver, sending a special command into the card. SPI mode is a 1-bit mode, which is speed limited, but popular in micro-controller applications. SPI interfaces are common in the micro-controllers.
There are three basic transfer modes supported by SD:
- SPI mode (one-bit separate serial in and serial out bits)
- 1-bit SD mode Bidirectional (separate command/response line)
- 4-bit SD mode Bidirectional (separate command/response line)
Then, add to this the Ultra High Speed (UHS) modes - I, II and III
Low speed cards support 0 to 400 kbit/s data rate and SPI and one-bit SD transfer modes. SD 2.0 cards support up to a theoretical 12.5 MB/s data rate in four-bit mode and 3.125 MB/s in SPI and one-bit SD modes, with a 25 MHz Host Clock. SD3.0 upped clock speed to 50 MHz, with a resultant doubling of these speeds. Moving forward, speeds have increased significantly with UHS modes using DDR Clocking, much higher host clock speeds, and added low voltage differential signaling pins in the highest UHS modes.
Version 2.0 also introduces a High-speed bus mode for both SDSC and SDHC cards, which doubles the original Standard Speed clock of 12.5MHz to produce 25MB/s.
SDHC host devices are required to accept older SD cards. However, older host devices do not recognize SDHC or SDXC memory cards, although some devices can do so through a firmware upgrade. Older Windows operating systems released before Windows 7 require patches or service packs to support access to SDHC cards.
The Secure Digital eXtended Capacity (SDXC) format, announced in January 2009 and defined in version 3.01 of the SD specification, supports cards up to 2TB (2048GB), compared to a limit of 32GB for SDHC cards in the SD 2.0 specification. SDXC adopts Microsoft’s exFAT file system as a mandatory feature.
Version 3.01 also introduced the Ultra High Speed (UHS) bus for both SDHC and SDXC cards, with interface speeds from 50MByte/s to 104MByte/s for four-bit UHS-I bus.
Version 4.0, introduced in June 2011, allows speeds of 156MByte/s to 312MByte/s over the four-lane (two differential lanes) UHS-II bus, which requires an additional row of physical pins.
Version 5.0 was announced in February 2016 at CP+ 2016 and added “Video Speed Class” ratings for UHS cards to handle higher resolution video formats like 8K.
SD cards and host devices initially communicate through a synchronous one-bit interface, where the host device provides a clock signal that strobes single bits in and out of the SD card. The host device thereby sends 48-bit commands and receives responses. The card can signal that a response will be delayed, but the host device can abort the dialogue.
Through issuing various commands, the host device can:
- Determine the type, memory capacity, and capabilities of the SD card.
- Command the card to use a different voltage, different clock speed, or advanced electrical interface
- Prepare the card to receive a block to write to the flash memory or read and reply with the contents of a specified block.
The command interface is an extension of the Multimedia Card (MMC) interface. SD cards dropped support for some of the commands in the MMC protocol, but added commands related to copy protection. By using only commands supported by both standards until determining the type of card inserted, a host device can accommodate both SD and MMC cards.
All SD card families initially use a 3.3-volt electrical interface. On command, SDHC and SDXC cards can switch to 1.8 V operation.
At initial power-up or card insertion, the host device selects either the Serial Peripheral Interface (SPI) bus or the one-bit SD bus by the voltage level present on Pin 1. Thereafter, the host device may issue a command to switch to the four-bit SD bus interface, if the SD card supports it. For various card types, support for the four-bit SD bus is either optional or mandatory.
After determining that the SD card supports it, the host device can also command the SD card to switch to a higher transfer speed. Until determining the card’s capabilities, the host device should not use a clock speed faster than 400kHz. SD cards other than SDIO have a “Default Speed” clock rate of 25MHz. The host device is not required to use the maximum clock speed that the card supports. It may operate at less than the maximum clock speed to conserve power. Between commands, the host device can stop the clock entirely.
To Learn More
Look for the next Storage Insights post soon, if you missed Storage Insights #2 - Optimizing your Storage Device or
Storage Insights #1 - Why Not All SD Cards are Created Equal, check them out!
Feel free to reach out to Delkin with any storage questions in the meantime.