- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Understanding memory types in Arduino Uno
Arduino Uno, or any other microcontroller for that matter, generally has 3 types of memory −
This is where Arduino sketch is stored.
Any variable defined using PROGMEM or the F() macro is also stored here. Note that such variables are immutable by default, i.e., their values can't be changed at runtime.
Flash memory is non-volatile (i.e., the stored content is not lost even after power is turned off)
It is slower to access than SRAM, but since it is much larger in size than SRAM, some immutable strings/ arrays can be stored here to avoid overflow of SRAM.
It generally has 10,000 read/write cycles.
This is where the normal variables of the sketch are created, stored and manipulated.
SRAM is volatile, i.e., the stored content is lost as soon as the power is turned off
SRAM is very quick to access.
It has practically unlimited read/write access.
Like Flash, EEPROM is also a non-volatile memory.
EEPROM can be used to store long term information irrespective of the sketch in the Flash (like some config variables to be used across sketches)
EEPROM is the slowest to access among all three memory types.
It generally has 100,000 read/write cycles
Arduino Uno has ATmega328P, which has the following specifications −
Flash − 32 kb
SRAM − 2 kb
EEPROM − 1 kb
- Understanding Arduino Uno pinout
- Arduino Uno vs Arduino Leonardo
- Arduino Uno vs Arduino Micro
- Arduino Uno vs Arduino Mega
- Arduino Uno vs Arduino Nano
- Arduino Uno vs Arduino Due
- Timers in Arduino Uno
- SPI in Arduino Uno
- Arduino Uno vs ESP32
- Arduino Uno vs Teensy
- I2C/Wire in Arduino Uno
- Components of Arduino Uno board
- Arduino Uno vs Raspberry Pi
- Timer1 based PWM in Arduino Uno
- Arduino Uno vs STM32duino (Blue Pill)