Electronic – arduino – Why use RAM IC over EEPROM IC

arduinoeepromnon-volatile-memoryramstorage

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?

Best Answer

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.