- Home
- Blogs
- Semiconductor
- The difference between RAM ROM FLASH
The difference between RAM ROM FLASH

As a beginner of microcontrollers, I am often confused by the words ROM, RAM, FLASH. From this, write down this C note.

ROM program memory
1. The full name of ROM is Read Only Memory, which is translated as read-only memory. As the name suggests, it is a solid-state semiconductor memory that can only read previously stored data. The data stored in ROM is stable. Once the data is stored, it can no longer be changed or deleted, and the stored data will not disappear after a power outage. Its structure is simple, so it is often used to store various firmware programs and data.
2. Used to store program data, variables and constants in microcontrollers.
3. For ease of use and mass production, programmable read-only memory (PROM) and erasable programmable read-only memory (EPROM) have been further developed. EPROM needs to be irradiated with ultraviolet light for a long time to erase, which is very inconvenient to use. In the 1980s, electrically erasable programmable read-only memory (EEPROM) appeared again, which overcomes the shortcomings of EPROM, but is not highly integrated and expensive. As a result, a new type of flash memory (FLASH MEMORY) with a memory cell structure similar to EPROM was developed. FLASH has high integration, low power consumption, small size, and can be quickly erased online, so it has developed rapidly.
Flash memory
Flash memory (Flash EEPROM) is also called flash memory. It is a type of EEPROM. It combines the strengths of ROM and RAM. Not only does it have the performance of electronically erasable and editable (EEPROM), it will not lose data due to power outage and can read data quickly. The biggest difference between it and EEPROM is that FLASH operates on a sector (block) basis, while EEPROM operates on a byte basis. The circuit structure of FLASH is relatively simple, the same capacity occupies a smaller chip area, and the cost is naturally lower than that of EEPROM, so it is suitable for use as program memory.
RAM random access memory
RAM (Random Access Memory) is also called random access memory. The contents of the storage unit can be randomly taken out or stored as needed, and the access speed has nothing to do with the location of the storage unit. This kind of memory will lose its storage content when the power is turned off, so it is mainly used to store programs that are used for a short period of time.
The difference between the three
Regarding the difference between RAM, ROM and FLASH, simply speaking, in computers, RAM and ROM are both data memories. RAM is random access memory, which is characterized by its volatility, that is, it loses its memory when it is powered off. ROM usually refers to solid memory (write once, read repeatedly), which has the opposite characteristics of RAM. ROM is divided into two types: one-time curing, optical erasure and electrical erasure and rewriting.
In applications, ROM is generally used to store firmware, and RAM is used to store data. Because FLASH ROM reads and writes faster than ordinary ROM and is easy to erase and write, it is generally used to store user programs and data that need to be permanently saved. For example, the core of the current household electronic electricity meter is a single-chip computer, and the program of the single-chip computer is stored in ROM. During the working process, the electric meter needs to calculate data, collect voltage and current, and calculate the electric energy based on the voltage and current. Voltage and current are timely data that the user does not care about. It is only used to calculate the electricity. After the calculation, the data collected this time is used up, and then the next collection is collected. Therefore, there is no need to store these values permanently. Put it in RAM. However, the calculated electricity consumption needs to be saved permanently. The microcontroller will store the electricity consumption into FLASH regularly or at the moment of power outage.
Articles you may also like
Characteristics of CPU, GPU, and FPGA
Silicon controlled rectifier (SCR) and switch control circuit explained
Accurately measure resistor value using ADC
What is a GPU? What is the relationship between GPU and graphics card?
-
stmicroelectronics
Pressure Sensor 3.77PSI ~ 18.27PSI (26kPa ~ 126kPa) Absolute 24 b 10-WFLGA
