1

I am considering buying an external EEPROM storage module for my microcontroller. However, it only has 32 kilobytes storage capacity.

I'm using this to store records where each record is basically 4 separate numbers ranging between 0 - 180.

How many records do you think 32 kilobytes could handle?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Joe
  • 1,762
  • 9
  • 43
  • 60

2 Answers2

1

A single record is an element out of a range of 181^4 possible elements, giving an information entropy of log(181^4)/log(2) = 29.999 bits. So you can, with some effort, encode one element in 30 bits.

This means you have floor(32 * 1024 * 8 / 30) = 8738 elements you can store. If you choose to encode using 32 bits - 4 bytes - for a significant simplification in your encoding logic, then it's 32 * 1024 * 8 / 32 = 8192 elements.

This analysis does not count any additional overhead for metadata such as validity bits, or flags to indicate which element is the newest, etc.

bdonlan
  • 224,562
  • 31
  • 268
  • 324
0

Besides the fact that you can store 8k elements using 4 bytes for each record in the EEPROM, have you considered using an SD card instead of an EEPROM? There are quite cheap SD card shields available for the Arduino, and, in addition, SD cards are very cheap and you won't have any space problems. You can access the SD card by SPI.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
phlogratos
  • 13,234
  • 1
  • 32
  • 37
  • 1
    I actually tried the SD method but the problem is it's basically only good for storing log files. With the eeprom method I can quickly find any record stored by simply calling the address number. Whereas with a log file I have to loop through the file to get to the line number. The other downfall with sd is arduino can't delete lines or overwrite in a text file (at least I couldn't find any info on it). – Joe Jul 16 '11 at 20:03
  • Can't you have files of records on SD-cards? – Thorbjørn Ravn Andersen Jul 26 '11 at 23:17