Hello! Welcome to Embedic!
This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > Embedded Events > From Flash to SRAM: Exploring the Memory of Microcontrollers (Video attached)

From Flash to SRAM: Exploring the Memory of Microcontrollers (Video attached)

Date: 29-03-2023 ClickCount: 448

Microcontroller is a highly integrated microprocessor, which is widely used in embedded systems due to its small size and flexibility, low power consumption and other characteristics. The microcontroller memory is one of its core components, which is the place to store data and programs inside the microcontroller.

 

 

In this paper, we will introduce the types, structure, features and storage functions of microcontroller memory in detail, hoping to help readers understand and apply microcontroller memory.

 

The Three Main Functions of Microcontroller

 

The three main functions of microcontroller are input/output control, computational processing and memory management.

 

Input/Output Control: The microcontroller communicates with the outside world through the input/output ports. The input port can receive signals from external sensors or switches, and the output port can control the operating status of peripheral devices such as motors, lights, and buzzers. Microcontroller through the input / output control, to achieve monitoring and control of the outside world.

 

Calculation and processing: The microcontroller has a special internal calculation processor, which can carry out various algorithms of calculation and processing. For example, the microcontroller can be used to realize the timing, counting, display and other functions of the digital tube, as well as the processing of various digital signals, filtering and other operations.

 

Storage management: There are various memories inside the microcontroller, including program memory, data memory and special function registers. Program memory is used to store program code, data memory is used to store variables and intermediate results in the program, and special function registers are used to store configuration and status information of the microcontroller. The microcontroller implements the storage and management of program and data through memory management.

 

What Types of Memory are Available for Microcontrollers

 

The memory of a microcontroller is divided into two types: program memory and data memory.

 program memory and data memory

Program memory: also known as program memory or ROM (Read-Only Memory), is used to store program code. According to the storage content and usage, it can be divided into the following types:

 

  • Read-Only Memory (ROM): Once a program is burned, it cannot be changed, it can only be read, and is often used to store the program's cured data.
  • Programmable Read-Only Memory (PROM): can be programmed as ROM, but once programmed, it also cannot be modified.
  • Erasable Programmable Read-Only Memory (EPROM): ROM that can be erased and reprogrammed.
  • Electronically Erasable Programmable Read-Only Memory (EEPROM): ROM that can be electronically erased and reprogrammed.

 

Data Memory: Also known as RAM (Random Access Memory), used to store program variables and intermediate results. Depending on the storage medium and the method of use, it can be divided into the following types:

 

  • Static Random Memory (SRAM): Uses a storage capacitor to store data, does not require refreshing, and is fast but costly.
  • Dynamic random memory (DRAM): uses a storage capacitor to store data, requires regular refreshing, slow but low cost.
  • Flash memory (Flash): similar to EEPROM, can be electronically erased and reprogrammed, but the number of erasures is limited.
  • FRAM memory (Ferroelectric RAM): a non-volatile memory, similar to SRAM, fast and unlimited number of erasures, but high cost.

 

In microcontroller design, both program memory and data memory are crucial components. Different application scenarios require different types and capacities of memory to be selected to meet the needs.

 

How Does a Microcontroller Save Data?

 

Microcontrollers save data mainly through data memory (RAM) and non-volatile memory (such as EEPROM, Flash, etc.).

 how mcu save data

Data memory (RAM): RAM in the microcontroller is used to store the variables and intermediate results of the program, it is volatile memory and needs external power supply. During the program operation, data can be stored temporarily in RAM, and when the program execution is finished, the data will be emptied and need to be stored again. Therefore, if data needs to be stored for a long time, it needs to be read out from RAM and saved to non-volatile memory.

 

Non-volatile memory: Non-volatile memories in microcontrollers include EEPROM, Flash, etc. They are capable of saving data even if power is lost. Data can be stored in EEPROM or Flash by specific instructions of the microcontroller. When the program needs to read data, it can read data from EEPROM or Flash and then store it in RAM. Since EEPROM and Flash have a limited number of reads and writes, you need to pay attention to the number of data reads and writes.

 

In microcontroller applications, in order to ensure the integrity and security of the data, the backup battery or external memory is usually used to ensure that the data can be saved even in case of power failure. Also, when storing and reading data, attention needs to be paid to the format and storage location of the data to ensure the correctness of the data.

 

Common Microcontroller Memory Chip Models [HOT!]

 

ATMEL's AT25 series: This is a SPI interface serial Flash memory with high speed and large storage capacity, which is suitable for some applications that require large storage space.

atmel's at25

WINBOND's W25Q series: This is also an SPI-interfaced serial Flash memory with high speed and large storage capacity, suitable for storing program code and data.

WINBOND's W25Q

Microchip's EEPROM and FRAM series: Microchip offers a wide range of EEPROM and FRAM memory chips suitable for storing small amounts of data and for applications requiring high-speed read and write.

 

SD card from Samsung: SD card is a general-purpose memory card suitable for applications that require large amounts of storage space. The microcontroller can communicate with the SD card through the SD card reader and SPI interface, and can use the file system to manage the data.

 

These memory chips are just a few of the common ones, and the specific choice needs to be determined by application requirements and microcontroller compatibility.

 

Conclusion

 

Microcontroller memory is an indispensable part of microcontroller, which has various types, different characteristics and application scenarios. When designing embedded systems, the correct selection and reasonable use of microcontroller memory can greatly improve the performance and reliability of the system. I hope this paper can provide readers with a comprehensive understanding of the perspective of microcontroller memory and can play a role in guiding practical applications.

 

  • [2023] Will the 8-bit MCU Market Extinct? Here are the Answers!
  • The Differences between STM8 and STM32 and the Keil Programming

FAQ

  • How much memory do microcontrollers typically have?
  • The amount of memory in a microcontroller can vary widely depending on the specific model and application. Some microcontrollers may have only a few kilobytes of ROM and RAM, while others may have several megabytes of flash memory and hundreds of kilobytes of RAM.
  • How is memory accessed in a microcontroller?
  • Memory in a microcontroller is typically accessed through specific memory-mapped registers or by using pointers in the program code. The microcontroller's instruction set will include specific instructions for accessing memory locations and manipulating data stored in memory.
  • Can the memory in a microcontroller be expanded?
  • In some cases, the memory in a microcontroller can be expanded through the use of external memory chips or modules. However, this will depend on the specific microcontroller and the availability of compatible memory expansion options.

Author

Kristina Moyes is an experienced writer who has been working in the electronics industry for the past five years. With a deep passion for electronics and the industry as a whole, she has written numerous articles on a wide range of topics related to electronic products and their development. Kristina's knowledge and expertise in the field have earned her a reputation as a trusted and reliable source of information for readers interested in the latest advancements in electronics.

Hot Products

  • TMS320C6745CPTPA3

    Manufacturer: Texas Instruments

    IC DSP FIX/FLOAT POINT 176HLQFP

    Product Categories: DSP

    Lifecycle:

    RoHS:

  • TMS320C6670CYPA2

    Manufacturer: Texas Instruments

    IC DSP FIX/FLOAT POINT 841FCBGA

    Product Categories: DSP

    Lifecycle:

    RoHS:

  • TMS320C6670XCYPA2

    Manufacturer: Texas Instruments

    IC DSP FIX/FLOAT POINT 841FCBGA

    Product Categories: DSP

    Lifecycle:

    RoHS:

  • TMS320C6743CPTPT3

    Manufacturer: Texas Instruments

    IC DSP FIX/FLOAT POINT 176HLQFP

    Product Categories: DSP

    Lifecycle:

    RoHS:

Customer Comments

  • Looking forward to your comment

  • Comment

    Verification Code * 

Compare products

Compare Empty