1
\$\begingroup\$

I have been looking at various different external storage ICs that would work with an arduino. When I looked at the specs of some EEPROM chips and compared it to the specs of other RAM chips, I noticed that they had relatively similar specs in terms of Read/ Write frequency and storage capacity. So if they have such similar characteristics, why would you use a RAM chip over an EEPROM chip? Wouldn't an EEPROM chip be much more useful as it is nonvolatile?

\$\endgroup\$
1
\$\begingroup\$

The two are intended for different purposes. EEPROM (Electrically Erasable Programmed Read Only Memory) is non-volatile and used for long-term storage just as configuration parameters which might be changed by the user; results of a calculation to be read out later; and something downloaded from the Internet such as an MP3 song or e-book. You can now get a 256MB (not bit) EEPROM now for $3.

EEPROM is not suitable as a substitute (or extension of) a computer's internal RAM, since as another answer pointed out, it takes much longer to write than to read, and you can eventually wear it out.

External RAM (Random Access Memory) is like the RAM inside your computer chip, except that it is harder to access. RAM is volatile; it will lose its consent when the power goes off. This sometimes is not a problem in embedded systems, since some are designed to never be completely turned off -- the external RAM may be left powered up even if the power to the microcontroller is turned off. This is called battery-backed up RAM.

External RAM is harder to access than the RAM is you CPU because it is connected over a serial link, either SPI or I2C, since all but the highest-end microcontrollers do not have an external address or data bus. So the external RAM does not appear in the address map of you microcontroller; rather you have to access it via a subroutine to first send the address to be accessed and then the data either to be written or read back. This is way way slower than accessing the RAM inside you microcontroller.

This limitation is also inherent in accessing EEPROMs.

External RAM can be used to hold large intermediate results of a calculation, data that is being logged (here you want to use battery-backed up RAM), and material temporarily downloaded from the Internet (such as a web page, or an MP3 song you don't need to keep around).

Static RAM is at least an order of magnitude more expensive than EEPROMs of the same size. You can't used dynamic RAM (which is cheaper) without special refresh circuitry.

\$\endgroup\$
  • \$\begingroup\$ Follow up question: Why hasn't NVRAM replaced EEPROM ICs? Using NVRAM would have all of the benefits of regular RAM without the slow read/write times of an EEPROM. \$\endgroup\$ – Takide Sep 8 '15 at 21:34
  • 1
    \$\begingroup\$ Cost. A 256K EEPROM costs around $2. An 256K NVRAM can cost up to $60. Why? It has a DRAM, Flash, memory controller, and battery (or SuperCap) all in one package. \$\endgroup\$ – tcrosley Sep 8 '15 at 22:17
7
\$\begingroup\$

EEPROMs are slow to write (milliseconds) and they wear out after a certain number of writes (reads are generally unlimited, with exceptions). You can wear an EEPROM out in a very short time if you're writing to particular locations continuously.

For example, this 1Mbit 24C1024 has a write time that can be as long as 5ms and a 'typical' life of 10^6 cycles.

If you write to the same location every 10ms then it will wear out in 2-3 hours.

\$\endgroup\$
2
\$\begingroup\$

Typically speaking:

DRAM/SRAM

  • much faster (especially when writing)
  • much more durable
  • volatile -- does not retain contents when powered off
  • less expensive because there may be fewer transistors and definitely cheaper transistors per bit of storage

EEPROM

  • Generally the opposite
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.