fbpx
 

Selecting Flash Memory

Flash memory is becoming increasingly popular in portable devices as the main storage medium. Recent netbook usage of flash-based Solid State Drives (SSD) as a replacement for traditional disk-based hard drives also speaks to the increasing popularity of flash memory. Flash memory offers advantages such as a serial interface, fast access time (compare to hard drives), and low power consumption. For these reasons, flash memory is a popular design choice for embedded medical devices.

Types of Flash Memory

There are two main types of flash memory: NOR flash and NAND flash. The basic technologies for the two are the same – floating-gate transistors. The difference is how these transistors are connected together to form the memory blocks. NOR flash supports byte read/write, although erase is done in blocks. In this manner, NOR flash acts like traditional DRAM and ROM. NAND flash supports block-based or page-based access only and thus acts like a hard drive.

Traditional flash memory is manufactured using single level cells (SLC) technology, which means each floating-gate transistor holds one bit of data. Newer flash memory offers Multi-level cells (MLC), allowing two or more bits of data to be stored at one floating-gate transistor. MLC flash offers more storage capacity and lower cost, but tends to consume more power and is less reliable than SLC flash.

Flash Translation Layer

Due to the block nature of the NAND flash, one bad cell can render the entire block unusable. Thus memory management is needed to guarantee data integrity. Flash Translation Layer (FTL) is the software layer that handles flash memory management. It performs three major tasks: error code correction (ECC), bad block management, and wear leveling. ECC can correct up to 22 bits in each 2048 bits of data. In cases when ECC cannot correct the error, it may still be able to detect it. Since most flash memory is shipped with some bad blocks and bad blocks can occur during the lifetime of the device, bad block management is essential to keeping track of usable blocks. One main disadvantage of the flash memory is the write cycle limit. Typical flash memory guarantees about 100,000 write-erase cycles. Therefore, it’s important to balance out write activities over the entire memory range in order to increase memory lifespan.

A simple example can illustrate this point. Assuming that a file of 50 blocks is written to a flash memory containing 4096 blocks at a rate of 1 file/minute, and assuming that the write limit on the memory is 100K, without wear leveling, the memory is good for less than 70 days. On the other hand, with wear leveling, all blocks are used equally to balance out the write activities, and the memory is good for more than 15 years!

Size and Power Consumption

The service of FTL can be performed by various hardware and software components. ECC can be performed in hardware, where wear-leveling and bad block management may be included in the flash file system, especially when a Real-Time Operating System (RTOS) is used. When a device interfaces with a removable flash memory card, the memory management is done on the memory card. The tradeoffs between these approaches include power consumption, cost associated with the RTOS and microcontroller, and device footprint size.

When power consumption and device size are top concerns, eMMC flash memory can be a suitable option. eMMC flash is basically flash memory bundled with a memory controller. It eliminates the need of an RTOS for the purpose of managing flash memory, and offers lower power consumption and a smaller footprint than removable memory cards. It also offers a simple serial interface such as MMC/SPI, thus reducing complexity on the microcontroller side. Of course, this smaller packaging comes at a higher price, which could be a deciding factor in high volume production.

With so many varieties of flash memory, hopefully you can find the one that works for your design.

Lei Zong


Every challenge is different – Tell us about yours.