Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speed comparison eeprom-flash-sram

Tags:

memory

avr

Currently coding for atmel tiny45 microcontroller and I use several lookup tables. Where is the best place to store them? Could you give me a general idea about the memory speed differences between sram-flash-eeprom?

like image 918
kostaspap Avatar asked Feb 06 '13 12:02

kostaspap


People also ask

Is flash memory faster than SRAM?

Compared to either type of RAM, flash memory speed is significantly slower. Because of its reduced power consumption, persistent nature and lower cost, flash is used for storage memory, in devices such as SD cards, USB drives and SSDs.

What is the difference between SRAM and EEPROM?

SRAM (static random access memory) is where the sketch creates and manipulates variables when it runs. EEPROM is memory space that programmers can use to store long-term information.

Is flash better than EEPROM?

Flash is block-wise erasable, while EEPROM is byte-wise erasable. Flash is constantly rewritten, while other EEPROMs are seldom rewritten. Flash is used when large amounts are needed, while EEPROM is used when only small amounts are needed.

How fast is an EEPROM?

The fastest through-hole EEPROM I can find is 70ns and 128K. At least from Mouser. 70ns seems to be it with EEPROMs. EPROMs are somewhat faster: 55ns for UV-erasable parts like those I used in my POC units, or 45ns for OTP parts, which I've also tried.


1 Answers

EEPROM is by far the slowest alternative, with write access times in the area of 10ms. Read access is about as fast as FLASH access, plus the overhead of address setup and triggering. Because there's no auto-increment in the EEPROM's address registers, every byte read will require at least four instructions.

SRAM access is the fastest possible (except for direct register access).

FLASH is a little slower than SRAM and needs indirect addressing in every case (Z-pointer), which may or may not be needed for SRAM access, depending on the structure and access pattern of your table.

For execution times of instructions see AVR Instruction Set, especially the LPM vs. the LDS, LD, and LDD instructions.

like image 95
JimmyB Avatar answered Oct 17 '22 18:10

JimmyB