Read Only Memory
(ROM)
Read Only Memory (ROM) is
a type of memory used to permanently save the program being executed. The size
of the program that can be written depends on the size of this memory. ROM can
be built in the microcontroller or added as an external chip, which depends on
the type of the microcontroller. Both options have some disadvantages. If ROM
is added as an external chip, the microcontroller is cheaper and the program
can be considerably longer. At the same time, a number of available pins is
reduced as the microcontroller uses its own input/output ports for connection
to the chip. The internal ROM is usually smaller and more expensive, but leaves
more pins available for connecting to peripheral environment. The size of ROM
ranges from 512B to 64KB.
Random Access Memory (RAM)
Random Access Memory
(RAM) is a type of memory used for temporary storing data and intermediate
results created and used during the operation of the microcontrollers. The
content of this memory is cleared once the power supply is off. For example, if
the program performs an addition, it is necessary to have a register standing
for what in everyday life is called the “sum” . For that purpose, one of the
registers in RAM is called the "sum" and used for storing results of
addition. The size of RAM goes up to a few KBs.
Electrically Erasable Programmable ROM (EEPROM)
The EEPROM is a special type of memory not contained
in all microcontrollers. Its contents may be changed during program execution
(similar to RAM ), but remains permanently saved even after the loss of power
(similar to ROM). It is often used to store values, created and used during
operation (such as calibration values, codes, values to count up to etc.),
which must be saved after turning the power supply off. A disadvantage of this
memory is that the process of programming is relatively slow. It is measured in
milliseconds.