System Memory

Aside from the CPU itself, memory is the most fundamental building block in any microprocessor-based system. The CPU fetches instructions from the memory, and these instructions tell the CPU what to do. If the memory is programmed incorrectly or connected to the CPU incorrectly, then even the most sophisticated processor will be confused !

There are several different types of memory available. This range of selection exists for the same reason that there are several varieties of almost anything in the electronics industry: price/performance/density trade-offs. Different designs have different requirements that make different memory architectures attractive. For example, some systems need a lot of memory, but not really fast memory; others require small amounts of really fast memory; some need memory that does not lose its data when the power is removed; and so on. Following is a discussion of the most common types of memory used today, along with some of their characteristics.

ROM, PROM, EPROM and EEPROM

The term ROM is an acronym for Read-Only-Memory. This type of device is programmed as part of the manufacturing process and cannot be changed by the CPU or by any in-house device programmer. A programmable read only memory (PROM) can be programmed by an in-house device programmer, but cannot be erased. A PROM gives the user of the device one shot at programming the device. If there is an error in the program or if the program needs to be updated, the old PROM must be discarded and replaced with a new, properly programmed device. An erasable programmable read only memory (EPROM) can be programmed and erased in-house, with the limitation that the programming is done with an external device programmer and erasure must be done with some ultra - violet light source. Finally, an electrically erasable PROM (EEPROM) is in-system byte-writable and byte-erasable. At first glance, the EEPROM would appear to be the ideal storage device; however, EEPROMs are relatively slow and fairly expensive, even at lower package densities . Generally, ROM, PROM and even EPROM are slowly fading into the sunset as new emerging technologies (i.e., flash) gain in popularity and drop in price.

RAM

This name is also an acronym: random access memory (RAM). Unlike the EPROM acronym, the term RAM doesnt give a very good indication of its characteristics, at least not from our point of view. The name reflects the fact that any byte can be accessed at any time, which was a step ahead of its predecessor, sequential access memory, when it first appeared on the electronics scene. For the sake of our discussion, we assume that all memory is random access, but not all memory is writable by the CPU. Therefore for us, the differentiating characteristic (compared to EPROM) is the fact that the processor can write to RAM. RAM is read/writable but is also volatile , which means that when power is removed, the data is not retained.

There are two fundamental types of RAM: static (SRAM) and dynamic (DRAM). SRAM is the easier of the two to interface with because it is static, meaning that it does not require any baby-sitting from the processor to do its job. Simply wire it up to the processor and use it. DRAM, on the other hand, requires external hardware to refresh it periodically so that the internal capacitors hold their charge. DRAM technology is much cheaper, but it is also slower and requires additional hardware to keep it running (the DRAM controller mentioned earlier). Because of these issues, DRAM is typically used in systems that require large amounts (> 1MB) of memory so that the added expense of the controller is justified. SRAM is simple but has a higher cost per byte of storage. It is typically used in systems that require small amounts of memory or in systems that need a small amount of fast writable memory (like a cache). For example, on your typical PC, some DRAM is available for general use, and a much smaller amount of SRAM is available for the CPU cache.

Flash Memory

Like EPROM, flash memory is also nonvolatile memory. The big advantage of flash memory over EPROM is that it is in-system programmable, which means that no separate device is needed to modify its contents. Early devices required a higher voltage (usually 12V), but todays parts require the same voltage as the rest of the board. Since the flash memory is in-system writable, no UV eraser is needed.

The architecture of flash memory comes in a few varieties, and although modern flash memory is in-system programmable, it is still not as convenient as using RAM. Typically, an erase procedure deals with a single sector of the memory. Sector sizes are usually relatively large, and an erasure sets all the bits within that sector to one (all bytes = 0xff ). Writing to the individual bytes changes only some of the bits within each byte to a zero state. Each operation (erase, write, and so on) except read is performed with a special programming algorithm. This algorithm is unique enough that it does not interfere with the typical interaction between the CPU and the memory.

Flash memory is quickly becoming the standard nonvolatile memory choice for new designs. Aside from the algorithm needed to write/erase the memory, the only other drawback of flash memory is that it has an upper limit to the number of times a sector can be erased. Usually the limit is high (100,000 or 1,000,000 cycles), but, nevertheless, it must be considered in the design.

Still Others

There are several other types of memory, most of which are some derivative of one or more of the above types. These other standards are not as popular, but they typically satisfy some niche in the market. For example, PSRAM (pseudo-static RAM) is a DRAM with some kind of refresh controller built into it. It satisfies a system that needs more SRAM than a single SRAM device supports but doesnt need the densities offered by DRAM. Nonvolatile SRAM (NVRAM) is static RAM with a battery backup. Some devices actually have the battery built into the plastic; others are nonvolatile simply because the hardware design has battery backup protecting the device; still others provide some type of automatic backup of RAM to on-chip flash when power is removed. Serial EEPROM is a type of EEPROM that communicates with the CPU usually using two to four I/O pins. Access is slow, but physical size is extremely small because there is no address or data bus.



Embedded Systems Firmware Demystified
Embedded Systems Firmware Demystified (With CD-ROM)
ISBN: 1578200997
EAN: 2147483647
Year: 2002
Pages: 118
Authors: Ed Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net