Use this tag for questions about memory usage on the Arduino.

There are three types of memory on an Arduino:

  • EEPROM
  • RAM
  • PROGMEM (Flash Memory - where your program goes)

On an Arduino Uno you have 1 KB of EEPROM, 2 KB of RAM, and 32 KB of program memory.


EEPROM

Electrically Erasable Programming Read Only Memory

This retains its value after power-off, so it can be used to retain configuration parameters, serial numbers, and similar things, even while the device is powered down.

EEPROM has a limited erase/rewrite life-span. It is typically quoted as 100,000 erase/write cycles. This is still a lot for things like serial numbers, which would change rarely. It can be read an indefinite number of times without wearing out.


RAM

Random Access Memory

This memory is lost at power-down, and has undefined values when the chip is powered up. It can be read from, and written to, an indefinite number of times. Your program variables are stored in RAM.


PROGMEM

Program Memory

Otherwise known as "flash memory". This is where your program code is stored. It has a separate address space to RAM (variables) due to the Arduino AVR range being Harvard Architecture.

PROGMEM has a limited erase/rewrite life-span. It is typically quoted as 10,000 erase/write cycles.

During normal program operation PROGMEM is only read from (to read program instructions) - this can be done an unlimited number of times.

The program memory is normally changed when "uploading" a new program, either by using the bootloader, or an ICSP programmer.

See also

history | excerpt history