2
\$\begingroup\$

I know that both are non volatile. Flash is used to store my code and EEPROM stores long lasting values (like a hard drive on PC).

My question is why are they of different types? Why can't both be flash or both be EEPROM? Is one cheaper than the other?

\$\endgroup\$
4
  • \$\begingroup\$ Which Arduino are we talking about here exactly? \$\endgroup\$
    – Ron Beyer
    Jun 5, 2020 at 14:51
  • \$\begingroup\$ Uno in this case. \$\endgroup\$
    – Dave
    Jun 5, 2020 at 14:53
  • \$\begingroup\$ Confounding variable: Flash and EEPROM are fundamentally the same thing, just with different control circuitry. \$\endgroup\$
    – Hearth
    Jun 5, 2020 at 14:57
  • \$\begingroup\$ That's not something general for Arduino. Arduino is only the platform. You are talking about the Atmega controller that is used on that board. \$\endgroup\$
    – jusaca
    Jun 5, 2020 at 14:58

2 Answers 2

2
\$\begingroup\$

Flash is cheaper but can only be erased block by block.

EEPROM can be erased byte by byte and has better write endurance but costs more. It's also safer and easier to write and manage things when you aren't writing to the same memory that your program is running from and if it can be erased by byte instead of by block.

\$\endgroup\$
2
\$\begingroup\$

Flash memory (NAND structure) is quite dense, and is used to get the largest amount of code onto a given die size. So yes, the cost per bit in terms of chip area is quite small.

EEPROM (NOR structure) is significantly less dense, mainly because it can be erased and rewritten byte by byte, and also because larger structures are used to increase the number of usable write cycles. The cost per bit is a couple of orders of magnitude greater. Therefore, the capacity of this memory is small, and it is used only for essential data that MUST be nonvolatile.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.