Jump to content

DataFlash

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SmackBot (talk | contribs) at 08:18, 13 December 2007 (Date/fix the maintenance tags or gen fixes using AWB). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

DataFlash is a low pin-count serial interface for flash memory. It is an Atmel proprietary interface, compatible with the SPI standard.

Information is written and read from a DataFlash chip using any microcontroller, such as the Atmel AVR, the Microchip PIC or the ARM.

The AT26 series DataFlash chips are software-incompatible with the original AT45 series chips. They use a simpler command set, supported by other vendors of serial flash but omitting SRAM buffers and other features that make AT45 chips simpler to support. On this page, only the original AT45 series chips will be called DataFlash; in this case, brand-oriented marketing creates needless technical confusion.

Examples of DataFlash

The AT45DB161D chip is an example of a 2MByte (16 Mbit) dataflash chip available from Atmel. This chip comes in a 8x5mm SOIC 8-pin package. This chip is used in a huge number of consumer electronic products. Any microcontroller can use this chip to store data.

The AT45DCB008D card is an 8MByte (64 Mbit) flash memory card, which could be mistaken for an MMC or SD card. This DataFlash card packages an AT45DB642D flash chip, which is also available in 8x6mm CASON 8-pin packages.

Should I use DataFlash or EEPROM? Or MMC/SD?

Both DataFlash and EEPROM chips can be accessed from a microcontroller, using a 4-wire SPI bus. Both are available in small 8 pin packages. The protocol interfaces are very similar; in both cases, bytes are written or read, via SPI, one or more bytes at a time.

DataFlash generally has a higher capacity than EEPROM, and provides much faster access times. DataFlash capacities in small packages range from 128KByte to 8MByte, while SPI EEPROM capacities in similar packages range from 1KByte to 512KByte. Flash chips are tuned for page access, rather than the byte access used with EEPROM. However, AT45 series chips have commands which let their drivers act more like EEPROM drivers. Leveraging the SRAM buffers exposed by AT45 chips to do more than support EEPROM-like access will of course take specialized software.

DataFlash cards are more expensive than the consumer oriented MMC or SD cards, and have lower capacities, but have an extremely simple programming interface compared to MMC/SD. All these cards can be used in SPI mode.

In summary, if a design requires more data storage than EEPROM can offer, or needs faster access times, use DataFlash. If it needs to leverage the AT45 SRAM buffers, use those DataFlash chips. If it needs second sources for parts, use EEPROMs, AT26 series chips, or MMC/SD cards. For cards used in field upgrades, use DataFlash cards if simple software support or compatibility with on-board flash chips are primary concerns; else MMC/SD if cost matters most. Otherwise, use EEPROM, as the programming code required to interface to the DataFlash chip will be simpler.

Example C source code to interface to DataFlash

A free example of PIC microcontroller source code in C, that can be used to interface to any DataFlash chip, is available from www.microchipC.com.