Arduino

As I have been exploring the Arduino hardware platforms for my TBD project, I find myself forgetting the memory options available.  I'm recording here my findings so I can reference it later.

Arduino

Chip

Flash

SRAM

EEPROM

Nano 2.3

ATmega168

16K bytes

1024 bytes

512 bytes

Nano 3.0

ATmega328

32K bytes

2048 bytes

1024 bytes

Uno

ATmega328

32K bytes

2048 bytes

1024 bytes

Mega 2560

ATmega2560

256K bytes

8192 bytes

4096 bytes

  • SRAM (Static Random Access Memory) is where the sketch creates and manipulates variables when it runs.
  • EEPROM (Electrically Erasable Programmable Read-Only Memory) is memory space that programmers can use to store long-term information.
  • Flash memory is where the Arduino sketch is stored (program space).  The bootloader takes about 2 KB of flash memory and remaining space is for the sketch.
  • The Arduino IDE will tell you exactly how much Flash is being used after each compile/upload.  EEPROM is an older, more reliable technology. It is somewhat slower than Flash.  In Flash, a large block is erased all at once, much faster than the EEPROM method of going cell-by-cell.

    If you don't need to modify the strings or data while your sketch is running, you can store them in Flash (program) memory instead of SRAM; to do this, use the PROGMEM keyword.

    Part of my interest in the Arduino's memory is my concern about how much memory a sketch uses.  Here are some sites that provide insight and algorithms for calculating the memory:


    Comments

    comments powered by Disqus