|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Applications
MegaMicro Card by Tom Cantrel In the world of data flash cards, Tom compares MultiMedia Card to CompactFlash and Nexcom. His result bodes well for the smaller, faster, and more versatile MMC in a variety of handheld products. No place is Moores Law more rigidly enforced than in the memory market. The name of the game: make it denser, smaller, faster, and cheaperor go home. Hope, at least from the suppliers perspective, can be found in the historic fact that ever-lower priced bits are quickly consumed. Program bloat gets much of the blame since its easy to point the finger at some faceless programmer who couldnt resist filling another meg with frivolous features. But, exploding data is equally to blame, and nobodys forcing you to stockpile all those TIFs, GIFs, JPGs, and PDFs. With the recent unveiling of the MultiMedia Card (MMC, shown in Photo 1) by SanDisk and Siemens, its a good time to check out the flash data-card niche. But first, a bit of history.
Back in November 96, I described the battle between SanDisk CompactFlash (CF) and the Intel-backed Miniature Card ("Flash Fight Flares," INK 76). Since then, its safe to say that CompactFlash is clearly winning. In particular, widespread adoption of CF in the emerging digital camera market bodes well for the future. CF is designed into dozens of models, and SanDisk shipped more than a million CF cards in 97. Until now, acceptance of these cameras has been held back by limited resolution. However, the emergence of mega-pixel models under $1000, not to mention low-cost, photo-grade, inkjet printers are harbingers of big biz down the road. Then, in August 97, I covered the serial flash module from a startup called Nexcom ("Serial Flash Busts Bit Barrier," INK 85). Checking up, I find that late last year the company, product line, and single-transistor memory technology were acquired by Integrated Silicon Solutions Inc. (ISSI). These two articles set the stage for MMC, which can aptly be described as a hybrid that fills the gap between CF and the Nexcom-now-ISSI module. Simply put, MMC combines multi-megabyte aspirations with minimalist form factor, power consumption, and interface. BIG & SMALL At only 32 mm ? 24 mm (and 1.4 mm thick), the MMC footprint is barely 1 in.2, which is about half the size of CF. In fact, the MMC occupies about the same area as the Nexcom module, although the aspect ratio is a bit more squarish. However, where the Nexcom module topped out at a megabyte or so, MMC starts at 2 MB and goes all the way to 10 MB, with talk of 15- and 20-MB units in 1999 being bandied about. Meanwhile, CF is at 40 MB and headed to 80 MB. That is, MMC seems to be tracking at about a quarter of the capacity of CF. Besides obvious data-storage applications like digital photos or voice recording, new ideas are emerging to take advantage of flash-card technology. For instance, a museum in Japan provides a hand-held audio player with a card storing the equivalent of a tour guide. A change in exhibits simply calls for updating the flash cards with the new info. A subtle, but I suspect profound, difference for MMC is the prospect of read-only versions (i.e., ROM). Siemens has announced 2- and 8-MB units with plans for 32 MB in 1999 and a whopping 128 MB by 2001. This announcement opens the door for MMC as a medium for distributing software of all kinds, including programs and reference data such as maps, phone books, and even music. Siemens uses the analogy that flash MMC is like a hard drive, while ROM MMC is like a CD-ROM. The portable apps best served by the small size of the card are also likely to be finicky about battery life. To that end, the MMC adopts a number of power-saving features. To start, theres no 5-V option like the one offered with CF. Instead, the MMC operates at a somewhat lower voltage. Actually, the card is required to be able to establish basic communication with the host over a wide 2.03.6-V range. This communication enables the host to interrogate the cards Operating Condition Register (OCR), which defines the allowed voltage range (typically greater than 2.7 V) for memory access. The amount of power consumed during memory access isnt trivial (e.g., 35 mA at 3.3 V). However, the MMC has a low-power standby mode that cuts power by a factor of almost 1000 (e.g., 50 ?A at 3.3 V). The host can overtly issue a command that causes the card to go into standby. However, it may not be necessary because the MMC automatically puts itself to sleep after 5 ms of inactivity. Theres no need to reset the card or otherwise go through hoops to get going again. Even in standby mode, the card remains conscious enough to detect a subsequent command and wake itself up. Only a 1-ms delay is required before the card is ready for the next read or write, as opposed to the 50-ms delay that is required after powerup. TWINTERFACE One factor that really differentiates the MMC from CF is the interface. CF, reflecting its PCMCIA roots, requires a whopping 50 pins to support its 8-/16-bit IDE-disk-drivecompatible bus. Needless to say, the size and cost goals of MMC demand something more streamlined, as in just seven signals. As opposed to the expensive and mechanically precise pin-and-socketstyle connector of PCMCIA and CF, the MMC uses the surface-contact slide-in approach like the Nexcom module. A close look at Photo 1 shows that the socket power and ground contacts are offset to connect first on insertion and disconnect last on removala basic requirement for hot swap. Taking power and dual grounds may leave only four pins to get the job done, but SanDisk manages to provide two rather different ways of doing so (see Table 1).
I can imagine how the arguments went. On one side, the purists arguing for an elegant new interface offering high speed and lots of neat capabilities. On the other, pragmatists willing to dispense with the bells and whistles in favor of something quick and easy to hook up to any micro. Tastes great or less filling? Why not do both? The purists get what they want with the so-called MMC interface, which is the default when the card powers up. Pragmatists can choose a simple SPI (i.e., clocked serial) interface that, at best, directly connects to the ever-growing list of so-equipped micros or, at worst, calls for a few lines of bit-banging code. How does the MMC know which interface to use? In MMC mode, pin 1 is a reserved No Connect, but its defined as Chip Select (CS) for SPI mode. At powerup, the MMC card checks the CS pin and, if its asserted, switches the interface from MMC to SPI mode. In both modes, pin 5 is the clock input generated by the host to time data transfers. Data is referenced to the falling edge of the clock. The difference between the modes largely boils down to the last two pins. For MMC mode, they function as bidirectional command (CMD) and data (DAT) lines, while for SPI they are unidirectional data lines (DIN and DOUT). Also, the MMC CMD line switches between open-collector and push-pull output configuration, while SPI is push-pull only. Table 2 sums up the functional differences between the modes.
While SPI requires a CS line for each card, MMC mode uses an addressing scheme that supports, logically at least, up to 64K cards in a stack. Heres how. Each card has a unique 128-bit card ID (CID) register. In response to an ALL_SEND_CID broadcast from the host, all attached MMC cards try to drive their own CID on the CMD line (open-collector mode), and each simultaneously monitors the line for comparison. Any time a card outputs a 1 but sees a 0, it backs off (i.e., quits sending its CID). By the time the host clocks in the last bit of CID, only one card is left standing. The host proceeds to assign that card a 16-bit relative card address (RCA) that is used for the duration of the session. The host keeps issuing ALL_SEND_ CID commands. Cards that have gotten their RCA remain quiet. Eventually, all cards have an RCA and the last issued command times out, signaling completion of the ID phase. Another major difference is that MMC mode, thanks to the ability to overlap commands and data, offers terminate-at-will multiblock and streaming transfer modes. SPI handles everything as a single-block transfer with predetermined length. Finally, the MMC mode offers faster raw transfer (20 MHz vs. 5 MHz for SPI). However, the advantage of the higher speed is mainly found with the multiblock and streaming modes. The actual throughput is ultimately limited by memory bandwidth: 1 MBps for reads and 200 kBps for writes. The fact that the MMC doesnt have a 5-V option is evidence of the trend toward lower operating voltages to reduce power consumption and extend battery life. In situations where the MMC must connect to a 5-V device, level shifters are required. Figure 1, taken from a SanDisk app note, shows transistor pairs configured to step up and step down a 5-V SPI interface. SMARTS ONBOARD SanDisk sticks with the strategy of using an onboard intelligent controller in front of the memory chip. Their success in the marketplace is the best argument for adding a controller which, despite the cost penalty, is more than offset by various benefits. The controller goes out of its way to help preserve data integrity, incorporating functions like internal ECC, CRC, bad sector mapping, and wear-dependent write algorithms (write endurance is 300k cycles). Because the card handles these important functions, you dont have to fuss with them. Perhaps the most important benefit of the separate-controller approach is that it decouples the host-system hardware and software design from the particulars of the underlying memory technology. The host issues high-level commands like read, write, erase, and so forth, and the controller handles the details. This means todays design will work with tomorrows MMC cards, no matter what kind of esoteric memory technology finds its way under the hood. Along with the IDE-disk drive pretensions, the rigid adherence to disk nomenclature (cylinder, head, etc.) that characterized the earlier cards interface is fading. Other than the fact that the basic building blocks are 512-byte sectors, the organization isnt really much like a disk at all. Instead, the memory is partitioned as shown in Figure 2. The smallest amount that can be erased defines a sector. An erase group comprises 16 sequential sectors. A single erase command can zap an arbitrary selection of the sectors (i.e., any or all of the 16) within an erase group or an arbitrary selection of erase groups. The process involves tagging the start and end of a sequence of sectors or erase groups, untagging those (up to 16) that arent to be erased, and then issuing the erase command. A write-protect group, the smallest individually protectable unit, is composed of 32 erase groups. Plus, two card-level write-protect bitsone temporary and one permanentoffer global protection. Theres a permanent copy bit that is presumably intended to combat piracy. However, protection seems to depend on trusted software on the host or programmer, because the copy-bit setting doesnt otherwise affect card operation. The global write- and copy-protection bits are found in the CSD (card-specific data) register which, like the previously mentioned CID and OCR (voltage profile) registers, defines various card-unique parameters such as speed, power requirements, and partitioning (i.e., block, sector, group, device sizes). Table 3 summarizes the commands that are handled by the MMC. The subset of commands related to multiblock transfer and software addressing arent available in SPI mode, as I described earlier. All of the commands are six bytes in length, while responses vary from 1 to 16 bytes, depending on the command as well as on which interface is being used.
STACK THE DECK If you think the MMC is an ace, a good place to see more is the recently formed MultiMedia Card Association. Youll find late-breaking info and links to members like SanDisk, Siemens, Hitachi, Motorola, Nokia, and others. A $340 evaluation kit from SanDisk comes with a 20-MB MMC card, PC parallel port MMC drive, extender card, and the requisite software utilities and documentation. The MMC is less PC-centric than earlier cards, and it targets many nonPC-related apps. But, theres no denying the PC is often at least one, if not the ultimate, destination for just about all data. Unlike earlier disk cards, MMC cant piggyback on the PCs built-in IDE support. To make MMC look like a disk, you need flash-file system software. SanDisk offers a $2545 host developers toolkit containing the C source for a FAT (file allocation table) file system. Porting the driver to a design starts with writing a minimal set of low-level hardware-specific drivers that establish physical communication with the MMC. A configuration file specifies a variety of options, such as buffer sizes, whether to preerase when a file is deleted or extended (speeds subsequent writes), MMC or SPI interface, and so on. Put it all together, and you end up with an API (see Table 4) that knows about disks, files and their attributes, directories, and so forth.
GIGANANOCARD? Compared to older cards, MMC is a better fit with the form-factor, power-consumption, and cost requirements of anything that purports to be handheld or fit in a pocket. I especially like the simple, versatile interface. Its nicer to deal with a few pins rather than the 50+ of earlier cards. Thanks to SPI mode, the card is easily managed by the lowliest processors, yet designs requiring performance can exploit the faster MMC mode. SanDisk offers 2-, 4-, and 8-MB cards at $26, $32, and $43 in volume (for now, it looks like the formula is $3 per MB + $20). As of today, capacity, price, or both may hold back some applications. But thanks to Moores Law, both concerns will diminish over time, broadening MMC acceptance and design-in. The interesting question is, what happens next? History would predict that another downsizing lies around the corner. The only problem is that while silicon may shrink, people wont. The wizards may get a zillion bits on the head of a pin, but that doesnt mean its wise. Make the thing much tinier, and youll need a magnifying glass and tweezers to boot up. Tom Cantrell has been working on chip, board, and systems design and marketing in Silicon Valley for more than ten years. You may reach him by E-mail at tom.cantrell@circuitcellar.com , by telephone at (510) 657-0264, or by fax at (510) 657-5441. SOURCES MultiMedia Card Serial flash module MultiMedia Card Assn. Circuit Cellar INK provides up to date information for engineers, www.circuitcellar.com for more
information and additional articles.
Embedded Systems Home | Back to Applications menu
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Copyright © 2003 ChipCenter-QuestLink About ChipCenter-Questlink |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||