CMP EMBEDDED.COM

Login | Register     Welcome Guest  
HOME DESIGN PRODUCTS COLUMNS E-LEARNING CONFERENCES CODE FORUMS/BLOGS NEWSLETTERS CONTACT FEATURES RSS RSS




There in a Flash: Flash Memory for Embedded Systems

by Brett Glass

Flash memory is solid state, nonvolatile memory that relies on stored electrical charge, rather than moving magnetic media, to store data. Like bubble memory, which was touted during the '80s as a solution for high-density, non-volatile, rewritable storage, it has no moving parts and is relatively rugged and durable. But unlike bubble memory, flash is light, compact, energy-efficient, and ever less expensive-making it an ideal storage medium for digital cameras, smart cards, automotive control systems, and many other embedded applications. Today's ultra-high-density disk drives are the undisputed kings of the hill in terms of megabytes per dollar, and are likely to remain so for the foreseeable future. But flash is the best choice in applications where mechanical shocks, environmental extremes, strict power constraints, or the need for small, rugged, swappable modules rules out the use of disk drives.


Flash vs. EEPROM

One of the most frequently asked questions about flash is how it differs from EEPROM, or electronically eraseable programmable read-only memory. While the two technologies are converging, each has a different heritage and intended use-and hence, different traditional strengths and weaknesses.

Flash memory was originally created as a replacement for mass storage media such as floppy and hard disks. It's therefore designed for maximum capacity and density, minimum power consumption, and a high number of write cycles. (All non-volatile solid-state memory-whether it's EEPROM or flash-can endure a limited number of write cycles; it will, eventually, wear out.) Information stored in flash memory is usually written in blocks rather than a byte or word at a time (though, as I'll mention later, hardware and software can make them appear to be accessible one byte at a time).

EEPROMs, on the other hand, are descendents of the venerable EPROM. They were originally designed to hold configuration information, or to lend field reprogrammability to devices that would otherwise require a change of chips. They usually have far smaller capacities-kilobits, as opposed to megabits-and are programmable in smaller chunks, often byte-by-byte. (Some are accessed serially, bit-by-bit.) Read access times tend to be shorter than for flash (though flash is catching up). And because they were meant for occasional field upgrades rather than constant updating, EEPROMs tend to be built to allow fewer write cycles. Finally, small EEPROMs are much cheaper than flash (not per bit, but per device), because they're mature products based on much older semiconductor process technology.

As time goes by, the newer flash process technologies are sure to be incorporated into devices that more resemble EEPROMs, blurring the distinctions between the two categories of nonvolatile memory. For example, Atmel's so-called "serial flash" memory appears, from the system's point of view, to have byte-by-byte read and write capabilities. Also, it can stream data serially to a DSP, making it ideal for use in communications applications. However, it uses the newer flash process technology to provide longer life and greater capacity and density.


Two kinds of flash

While the innards of flash memory chips all work by pretty much the same principles, designers can buy and incorporate flash into their products in one of two forms. Linear flash, as the name implies, is laid out and addressed linearly, in blocks. The same address always maps to the same physical block of memory, and the chips and modules contain only memory plus address decoding and buffer circuits. This makes them simple, cheap, and energy-efficient. Linear flash is the obvious choice for nonvolatile memory that's built permanently into an embedded system. And if you write removable linear flash memory cards in a standard "flash file system" format, you can usually interchange linear flash memory modules between systems (though the odds of compatibility are a bit better with ATA flash, as described below).

The second form of flash is called ATA flash. As the name implies, an ATA flash memory module interfaces with the rest of the system using the de facto "AT Attachment" standard. The memory appears as if it were sectors on a hard disk and is accessed via the same register interface used by the original IBM PC/AT's hard disk controller (and, more recently, IDE disk drives). The main advantages of ATA flash, from the embedded system developer's perspective, are flexibility and interchangeability with hard disks. While linear flash modules aren't 100% interchangeable between devices that accept removable memory modules, ATA flash virtually always is. Why? Because the memory module looks just like a disk drive to the system to which it's connected. It can thus be accessed using an operating system's standard disk access code and familiar file system APIs-not to mention the standard library calls used in C and other high-level languages.

Another advantage is compatibility. So long as the memory is written according to the conventions of a standard file system (such as the MS-DOS "FAT" file system), it can be exchanged between any number of devices that recognize removable disk drives. (You can even substitute a disk drive for the flash module during development, or in versions of the product tailored for applications where ruggedness or power savings aren't as important.) For example, a memory card written by a digital camera that uses flash memory in a PC Card format can be read directly by any computer with a PC Card slot. This aids in debugging, and saves the developer the time and effort of developing special software and hardware interfaces to connect the camera to a computer.

Finally, because ATA flash incorporates intelligence, it can screen out defective portions of the memory and implement error checking similar to that used in a disk drive. It can also map emulated "sectors" to different physical cells within the memory array, evenly spreading out the wear caused by write cycles to prolong the life of the module. (You can implement this feature-called "wear leveling"-on your own if you use a linear flash array, but it's convenient to have the module do it for you.) ATA flash modules are available with features such as "lockable" boot blocks, which prevent the accidental or intentional overwriting of critical parts of the simulated disk.

The disadvantages of ATA flash, as you might expect, are expense and power. Because the cards have built-in intelligence, they cost more and suck up more power than simple memory modules. They may also require you to include, and pay royalties on, the disk access component of your embedded operating system. If that code, and the disk runtime library code, would not otherwise be needed, this might increase your system's memory requirements.


Flash Design Considerations

Flash memory offerings vary widely in capacity, price, speed, and features. This makes designing with flash a non-trivial exercise; the effective embedded system designer must know the full range of available products in order to choose a cost-effective solution.

One of the first tradeoffs the designer must consider-as with all embedded systems components-is the inevitable compromise between power and speed. Some flash memories can run at lower voltages (as low as 3V or less), which saves power, but works more slowly. Others run at higher speeds but require five or even 12V. Some vendors-including Intel-have created single products that can work at several speeds and power levels, depending on the voltage applied.

Many flash memories incorporate built-in RAM buffers that essentially act as caches, holding the contents of a block of memory from the flash array for fast access. Others provide just the raw memory-thus leaving the option of creating a cache to the system designer.

Another consideration when specifying flash memory is block size. ATA flash devices, because they emulate disk drives, naturally read and write data in "sectors"-usually 512-byte blocks. But linear flash memories have a block structure as well, though the circuitry may be designed to hide this from the rest of the system. As a designer, you'll need to choose the block size that best matches your application and the available RAM in your system.


Flash and Smart Cards

In the future, your credit card won't be just a piece of plastic with a magnetic strip on the back; it'll be a flash memory-perhaps with added intelligence. Several vendors, such as Xicor, have addressed the need for these specialized memories by creating chips that include built-in password protection, serial communications buses, and 100-year data retention. While these chips will find their most widespread uses in debit cards, credit cards, and similar applications, they're also useful for any embedded system where access control is a consideration-including cash registers, door locks, car alarms, automatic gates, parental supervison devices, or even sobriety testing systems. As an embedded system designer, it's worth your while to know about these devices-and consider what value you might be able to add to products by accommodating them in your system design.


Trends

What's new in the world of flash memory? One interesting trend in the industry is chip-scale packaging, in which the silicon chip arrives conformally coated with tiny metal bumps on the bottom. These bumps are soldered directly to the printed circuit board. As with other minute surface-mount components, placement is critical; but the size of the complete device can be very small.

Memory vendors are also moving to increase the density of flash memory by storing more than one bit per memory cell. In EPROMs, EEPROMs, and older flash memories, only one bit is stored in each cell, which (as in dynamic RAM chips) is a tiny capacitor. Either there's a sufficient amount of charge in the cell or there's not; the amount of charge determines whether the cell contains a 1 or a 0. Newer flash memory, however, allows four or more possible amounts of charge per cell and can thus store two or more bits in each. This should drive the cost per bit down even further, making flash a more attractive solution.

Finally, embedded system designers have begun to use flash memory to hold a system's code and its data, replacing solutions that include a combination of EPROM, EEPROM, and/or flash. Originally, designers hesitated to do so, fearing that a system run amok (or one that experienced a power glitch) would wipe out its own code. But many newer flash memory modules include the ability to "lock" key areas via hardware, providing assurance that critical code won't be mistakenly erased. Thus a small bootstrap loader and self-test program-perhaps programmed into an MCU's on-board EPROM or masked ROM-may be all that's needed besides the flash.


Flash Decision

Should your latest embedded system design incorporate flash memory? The answer will depend on your application, of course, but as capacities go up and prices go down, they're more and more tempting. And the ability to swap modules between your development system and your prototype or finished device-both during development or in the field -may greatly ease development and product support. In short, it's well worth at least viewing the Web pages listed below-and keeping flash in mind for your next project.


Brett Glass is an electrical engineer, computer consultant, and author residing in Laramie, WY. He may be reached at rogue@well.com.


Contact Information

AMD
Sunnyvale, CA
(800) 222-9323
www.amd.com

Atmel
San Jose, CA
(408) 451-2829
www.atmel.com

Fujitsu
San Jose, CA
(800) 642-7616
www.fujitsu.com

Intel
Folsom, CA
(503) 264-6835
www.intel.com

Micron
Boise, ID
(208) 368-3900
www.micron.com

Motorola
Austin, TX
(512) 933-6000
motserv.indirect.com/sps/General/chips.html

Nexcom Technology
Sunnyvale, CA
(408) 730-3690
www.nexcomtech.com

Samsung
San Jose, CA
(408) 954-7274
www.samsung.com

Sandisk
Sunnyvale, CA
(408) 542-0500
www.sandisk.com

SGS-Thomson
Lincoln, MA
(617) 259-0300
www.st.com

Toshiba
Irvine, CA
(714) 455-2000
www.toshiba.com

Xicor
Milpitas, CA
(408) 432-8888
www.xicor.com

Please see www.embedded.com/buyer.htm for a comparative chart of flash chip products.

Return to Embedded.com

Send comments to: Webmaster
All material on this site Copyright © 2000
CMP Media Inc. All rights reserved.

Embedded.com Career Center
Looking for a new job?
SEARCH JOBS

Browse all jobs

SPONSOR
RECENT JOB POSTINGS





 :