Introduction
In order to examine the memory capabilities of the 16F84A, and to work with embedded systems in general,
it is important to have some knowledge of the characteristics of the memory technologies in use. A detailed
survey can be found in Chapter 4 of Ref. 1.1. The following section gives just a brief overview of the
different memory technologies currently used by Microchip.
An ideal memory reads and writes in negligible time, retains its stored value indefinitely, occupies negligible
space and consumes negligible power. In practice no memory technology meets all these happy ideals!
In general, different technologies are strong in one or more of these characteristics and weaker in others.
There is not one best memory technology, and different technologies are therefore applied for different
applications, according to the need.
Any memory is made up of an array of memory cells, where each cell holds one bit of data. The characteristics
of the single cell reflect the characteristics of the overall array; therefore, each technology is described
here simply in terms of its cell design.
Static RAM (SRAM)
Here each memory cell is designed as a simple flip-flop, using two back-to-back transistor pairs. Two further
transistors allow the cell to connect into the main array. Data is held only as long as power is supplied.
Hence the SRAM technology is volatile. With each cell taking six transistors, SRAM is not dense. However,
if made from CMOS (Complementary Metal Oxide Semiconductor) it can be made to consume very little
power and can retain its data down to a low voltage (around 2 V). It has thus been a popular technology in
battery-powered systems. SRAM is mainly used for data memory (RAM) in a microcontroller.
EPROM (Erasable Programmable Read-Only Memory)
In this technology each memory cell is made of a single MOS transistor – but with a difference. Within the
transistor there is embedded a ‘floating gate’. Using a technique known as hot electron injection (HEI), the
floating gate can be charged. When it is not charged, the transistor behaves normally and the cell output takes
one logic state when activated. When it is charged, the transistor no longer works properly and it no longer
responds when it is activated. The charge placed on the floating gate is totally trapped by the surrounding
insulator. Hence EPROM technology is non-volatile. EPROM can, however, be erased by exposing it to
intense ultraviolet light. This gives the trapped electrons the energy to leave the floating gate.
A special version of EPROM is ‘OTP’ – One Time Programmable. Here the EPROM is packaged in plastic,
without a window. Therefore, OTP can be programmed only once and never erased.
With a single transistor for a cell, EPROM is very high density and robust. Its requirement for a quartz
window and ceramic packaging, to enable erasing, raises its price and reduces its flexibility. EPROM used
to be integrated onto many microcontrollers for program memory, forcing the whole microcontroller to be
ceramic-packaged, with a quartz window (as seen in Figure 1.10). As a technology, EPROM is now rapidly
giving way to Flash, which follows shortly.
EEPROM (Electrically Erasable ProgrammableRead-Only Memory)
EEPROM also uses floating gate technology. Its dimensions are finer, so that it can exploit another means
of charging its floating gate. This is known as Nordheim Fowler tunnelling (NFT). With NFT, it is possible
to electrically erase the memory cell, as well as write to it. To allow this to happen, a number of switching
transistors need to be included around the memory element itself, so the high density of EPROM is lost.
Generally, EEPROM can be written to and erased on a byte-by-byte basis. This makes it especially useful
for storing single items of data, like television settings or mobile phone numbers. Both writing and erasing
take finite time, up to several milliseconds, although a read can be accomplished at normal semiconductor
memory access times, i.e. within microseconds or less. Again, like EPROM, because the charge on the
floating gate is totally trapped by the surrounding insulator, EEPROM is non-volatile. Because the EEPROM
structure is now so fine, it suffers from certain wear-out mechanisms. Manufacturers usually therefore define
a guaranteed minimum number of erase/write cycles that their memory can successfully undergo.
Flash
Flash represents a further evolution of floating gate technology. With a single transistor per memory cell, it
uses both HEI and NFT to allow electrical writing and erase. It does not include the extra switch transistors
that EEPROM has, so can only erase in blocks. It therefore returns to the exceptionally high density of
EPROM. Like EEPROM, it has wear-out mechanisms, so cannot be written and erased indefinitely.
Apart from its inability to erase byte by byte, Flash is an incredibly powerful technology. It is now a central
feature of a huge range of products, including digital cameras, ‘memory sticks’, laptop computers and
microcontroller program memory.