“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination”
There are 3 types of memories in an Arduino :
- It is where the Arduino sketch image is stored.
- Non-Volatile , i.e. , information persists after the power is turned off.
- It has a finite lifetime of about 100,000 write cycles. So, if you upload 10 programs a day for the next 27 years, you might wear it out.
- The values in the Flash cannot be changed after the program has started running.
- Takes 32Kb, 1Kb reserved for the Bootloader. The Bootloader is the little program that runs when the Arduino is turned on; its main function is to wait for the IDE to send a new program. Normally, a special device is needed to program the Arduino. It helps to program it with just USB cable.
- Bootloading the Arduino refers to a special device, ISP (In- System Programmer) to replace bootloader software. Reasons for doing the same are :
- No Bootloader on the Arduino.
- Replace with another Bootloader that is fast and eliminates delays.
- When you want to use ISP.
- Existing Bootloader is corrupted.
- Static RAM
- It is where the sketch creates and manipulates variables when it runs.
- Takes 2K / 2048 Bytes
- If you write “Hi You” ; it occupies 6 bytes which is not a lot in a pool of 2048 bytes. To solve this problem, use ‘Serial.println(F(“Hi You”));’ to store it in Flash memory.
- It is volatile.
- It is used to store long term information.
- 1K / 1024 Bytes.
- Slower than SRAM.
- It can only be read byte-to-byte.
Arduino Memory Comparison
The following chart shows the amounts of each type of memory for several Arduino and Arduino compatible boards.
The compiler measures Flash memory for you every time you compile!
I hope you found this guide useful. If you have any doubt, feel free to ask.