Memory unit in Microcontroller || Embedded basics || Embedded Interview Questions

Memory is part of the microcontroller used for data storage. The easiest way to explain it is to compare it with a filing cabinet with many drawers. Suppose, the drawers are clearly marked so that it is easy to access any of them. It is easy enough to find out the contents of the drawer by reading the label on the front of the drawer.



Each memory address corresponds to one memory location. The content of any location becomes known by its addressing. Memory can either be written to or read from. There are several types of memory within the microcontroller.

Read Only Memory (ROM)

ROM (Read Only Memory) is used to permanently save the program being executed. The size of a program that can be written depends on the size of this memory. Today’s microcontrollers commonly use 16-bit addressing, which means that they are able to address up to 64 Kb of memory, i.e. 65535 locations. As a novice, your program will rarely exceed the limit of several hundred instructions. There are several types of ROM.


Masked ROM

Microcontrollers containing this ROM are reserved for the great manufacturers. Program is loaded into the chip by the manufacturer


One Time Programmable ROM (OTP ROM)

If the microcontroller contains this memory, you can download a program into this memory, but the process of program downloading is a “one-way ticket”, meaning that it can be done only once. If an error is detected after downloading, the only thing you can do is to download the corrected program to another chip.


UV Erasable Programmable ROM (UV EPROM)

Both the manufacturing process and characteristics of this memory are completely identical to OTP ROM. However, the package of this microcontroller has a recognizable “window” on the upper side. It enables the surface of the silicon chip inside to be lit by an UV lamp, which effectively erases and program from the ROM. Installation of this window is very complicated, which normally affects the price. From our point of view, unfortunately- negative...


Flash memory

This type of memory was invented in the 80s in the laboratories of INTEL and were represented as the successor to the UV EPROM. Since the contents of this memory can be written and cleared practically an unlimited number of times, the microcontrollers with Flash ROM are ideal for learning, experimentation and small-scale manufacture. Because of its popularity, the most microcontrollers are manufactured in flash versions today. So, if you are going to buy a microcontroller, the type to look for is definitely Flash!

Random Access Memory (RAM)

Once the power supply is off the contents of RAM (Random Access Memory) is cleared. It is used for temporary storing data and intermediate results created and used during the operation of the microcontroller. For example, if the program performs an addition (of whatever), it is necessary to have a register representing 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.

Electrically Erasable Programmable ROM (EEPROM)

The contents of the EEPROM may be changed during operation (similar to RAM), but remains permanently saved even upon the power supply goes off (similar to ROM). Accordingly, an EEPROM is often used to store values, created during operation, which must be permanently saved. For example, if you design an electronic lock or an alarm, it would be great to enable the user to create and enter a password, but useless if it is lost every time the power supply goes off. The ideal solution is the microcontroller with an embedded EEPROM.



Cheers!!!!
-> Let Us Embed <-