USD

The Fundamentals of Embedded Memory: EEPROM vs. FRAM vs. eMMC vs. SD Cards

By Jacob Beningo

Contributed By Digi-Key's North American Editors

A major element of every microcontroller-based embedded system is memory. For example, developers need enough RAM to hold all their volatile variables, create buffers, and manage various application stacks. As important as RAM is to an embedded system, developers also need a place to store their application code, non-volatile data, and configuration information.

The problem is that non-volatile memory technology options are expanding,  making it challenging to determine the right memory for an application.

This article provides an introduction to the various technologies. It then uses examples from suppliers such as ON Semiconductor, Adesto Technologies, Renesas, ISSI, Cypress Semiconductor, Advantech, GigaDevice Semiconductor, and Silicon Motion to help developers understand the characteristics of each memory type. It also discusses where each is best applied, so developers can use them effectively.

EEPROM and FRAM in embedded systems

The first, and most commonly considered memory device to add to an embedded system is EEPROM. This is a non-volatile memory that is often used to store system configuration parameters for an embedded application. For example, a device that is connected to a network such as a CAN bus might store the CAN ID in EEPROM.

EEPROM has several characteristics that make it a good choice for embedded systems developers:

  • A small physical footprint
  • Relatively inexpensive
  • Typical bit rates that range from 100 kilobits per second (Kbits/s) to 1000 Kbits/s
  • Standardized electrical interface
  • Typically supports I2C and SPI interfaces

A quick search for EEPROM on Digi-Key’s website currently shows nine EEPROM vendors with over 5,800 EEPROM variants. For example, the CAT24C32WI-GT3 from ON Semiconductor is a 32 Kbit (4 Kbyte) EEPROM device that comes in an 8-pin SOIC package that can connect to the I2C bus at speeds up to 1 megahertz (MHz) (Figure 1).

Image of CAT24C32WI-GT3 is a 1 Kbit EEPROM from ON SemiconductorFigure 1: The CAT24C32WI-GT3 is a 1 Kbit EEPROM from ON Semiconductor that can connect to a microcontroller through an I2C or SPI port to store configuration and application data. (Image source: ON Semiconductor)

What’s interesting about EEPROM is that it is also sometimes included on the actual microcontroller. For example, the R7FS128783A01CFM#AA1 32-bit microcontroller from Renesas has 4 Kbytes of onboard EEPROM that developers can use.

This assumes the configuration needs are within 4 Kbytes. If not, developers either need to use an external device or they could emulate additional EEPROM using the microcontroller’s flash memory.

Despite EEPROM’s popularity, it does have some potential disadvantages:

  • Typically limited to 1,000,000 erase/write cycles
  • Write cycles that are approximately 500 nanoseconds (ns)
  • Multiple instructions necessary to write a cell
  • Data retention of 10 years or more (recently 100 years or more is more common)
  • Susceptibility to radiation and high operating temperatures

EEPROMs work well in many applications, but for applications that require high reliability—such as in the automotive, medical, or space systems industries—developers will want to use a memory solution that is more robust, such as FRAM.

FRAM stands for “ferroelectric random access memory” and offers several advantages over EEPROM memory:

  • It’s faster (write cycles are less than 50 ns)
  • Has more write cycles (upwards of 1 trillion versus 1 million for EEPROM)
  • Lower power (requires 1.5 volts for operation)
  • More radiation tolerant

FRAM is available in memory sizes similar to that of EEPROM. For example, Cypress Semiconductor’s FRAM family can range from 4 Kbits to 4 Mbits. The FM25L16B-GTR has 16 Kbits (Figure 2). It comes in an 8-pin SOIC package and can operate at up to 20 MHz.

Image of Cypress FRAM familyFigure 2: The Cypress FRAM family hosts a range of memory sizes from 4 Kbits to 4 Mbits that can connect to a microcontroller over SPI to store configuration and application data. The FM25L16B-GTR (pictured) operates up to 20 MHz. (Image source: Cypress Semiconductor)

On the upper end, Cypress Semiconductor’s CY15B104Q-LHXIT has 4 Mbits and supports interface speeds up to 40 MHz (Figure 3). Some interesting features of this FRAM memory include:

  • 151 year data retention
  • 100 trillion read/write cycles
  • Is a direct replacement for serial flash and EEPROM

As one might suspect, FRAM is more expensive than EEPROM, which is why it’s important to carefully weigh the environmental factors that a device will operate in when selecting the right memory for an application.

Image of Cypress CY15B104Q-LHXIT is a 4 Mbit deviceFigure 3: The CY15B104Q-LHXIT is a 4 Mbit device that operates at up to 40 MHz. It is part of the Cypress FRAM family that ranges from 4 Kbits to 4 Mbits. (Image source: Cypress Semiconductor)

Flash, eMMC and SD cards in embedded systems

Flash memory in an embedded system can be used for several different purposes. First, external flash might be used to expand the internal flash memory in order to increase the available memory for application code. This is commonly done using SPI flash modules like the GD25Q80CTIGR from GigaDevice Semiconductor (Figure 4). The GD25Q80CTIGR could be used to expand the internal memory by 8 Mbits, assuming that the microcontroller can support it, all through the SPI interface.

Image of GD25Q80CTIR flash memory from GigaDevice Semiconductor LimitedFigure 4: The GD25Q80CTIR flash memory from GigaDevice Semiconductor Limited can be used to expand internal flash space by 8 Mbits through the SPI port. (Image source: GigaDevice Semiconductor Limited)

Second, external flash might be used to store configuration information or application data rather than using an EEPROM or FRAM. An external flash chip might be used instead in order to decrease BOM costs or to boost internal memory for stored data from the application. A microcontroller peripheral and memory map can be configured to include this external flash so that it’s easier for the developer to access it without having to specifically make custom calls to a driver that would be required to interface with an EEPROM or FRAM.

An example of an external flash device that would be used for this purpose is the AT25SF161 from Adesto Technologies (Figure 5). This uses a queued SPI (QSPI) interface. QSPI is an extension to the normal SPI protocol that allows more data throughput for the system. This is extremely interesting to developers needing to store or retrieve large amounts of data during a single transaction.

QSPI works by removing CPU intervention within the QSPI peripheral and changing the interface from the standard four pins (MOSI, MISO, CLK and CS) to six pins (CLK, CS, IO0, IO1, IO2, IO3). This allows four pins to be used for input and output versus SPI’s traditional two pins.

Image of Adesto Technologies AT25SF161 external flash memory deviceFigure 5: The Adesto Technologies AT25SF161 external flash memory devices can be used to extend internal flash. They feature a QSPI interface for faster storage and retrieval of data. (Image source: Adesto Technologies)

Finally, flash can be used to store application data and payload information. For example, a GPS system would not attempt to store all the GPS maps locally on the processor; instead, it would use an external memory storage device like an SD card or an eMMC device. These storage media can be connected to a microcontroller through SPI or through a dedicated SDIO interface that makes for efficient interfacing with the external memory device.

For example, the IS21ES04G-JCLI eMMC from ISSI can be directly connected to an SDIO interface on the microcontroller in order to add 32 Gbits of flash storage to the device (Figure 6).

Image of ISSI eMMC flash module has 32 Gbits of memoryFigure 6: The ISSI eMMC flash module has 32 Gbits of memory that can be connected to a host through SPI or SDIO. (Image source: ISSI)

From an electrical interface standpoint, SD cards and eMMC devices are the same. That is to say, they have the same common pins that are used to connect the devices to a microcontroller, although they certainly come in different packages. Still, the two memory types can be quite different from each other. Compared to SD cards, eMMC generally exhibits the following differences:

  • More robust and less likely to have physical corruption
  • Faster interaction
  • More expensive
  • Soldered onto the board and not removable

If the user doesn’t need to remove the memory, then using eMMC provides a more robust solution, but it will be dependent upon the end application. In either case, a developer needs to select their memory carefully because all memory is not created equal.

For example, a subsystem that will be placed in an automobile may require that the memory be proven and certified to be reliable to a higher standard than standard flash devices. In this case, a developer would look for auto qualified memory such as the SM668GE4-AC 4 Gbyte eMMC module from Silicon Motion.

When it comes to SD cards, developers have to pay close attention to what they are buying, since like eMMC, not all SD cards are created equal. Developers need to carefully examine the speed class and the operating temperature for the card. For example, most SD cards are rated for 0 to 70˚C, which is appropriate for consumer electronics.

There are also speed classes associated with each card that describe the maximum interface speed that can be expected. For example, a Class 2 rating means that a card will be slow for an application that is storing images versus a card with a Class 10 rating that is designed for HD video like the SQF-MSDM1-4G-21C SQFlash 4 Gbyte microSD card from Advantech.

Image of Advantech SQF-MSDM1-4G-21C SQFlash microSD cardFigure 7: The Advantech SQF-MSDM1-4G-21C SQFlash microSD card hosts 4 Gbytes of memory and has a high-end Class 10 speed rating. (Image source: Advantech Corp)

Tips and tricks for selecting memory

Selecting the right memory type and interface for an embedded product can be challenging. Here are a number of “tips and tricks” that developers need to consider when selecting the right memory for an application:

  • Clearly identify the operating conditions for the memory such as:
    • Expected erase/write cycles
    • Environmental conditions and factors such as temperature, vibration, and radiation
    • Data load requirements
  • Document the minimum, desired, and maximum bit rates necessary to successfully use the memory for the application
  • Select the memory interface type that best meets the documented desired bit rate
  • For harsh environmental conditions like automotive or space systems, select memory that has an automotive rating or is radiation tolerant
  • Use a break-out board to test the selected memory device by integrating it with the microcontroller development kit

Following these tips will help ensure that developers select the right memory for their embedded application.

Conclusion

Developers today have a wide range of non-volatile memory devices to choose from that can be used to store data ranging from application code to configuration information. As shown, developers need to carefully evaluate their application needs and then carefully select the memory type and interface to balance those needs with cost.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this author

Jacob Beningo

Jacob Beningo is an embedded software consultant. He has published more than 200 articles on embedded software development techniques, is a sought-after speaker and technical trainer, and holds three degrees, including a Masters of Engineering from the University of Michigan.

About this publisher

Digi-Key's North American Editors