Go Down

Topic: EEPROM better than SD card for audio ? (Read 5500 times) previous topic - next topic


I have a project that uses up to 9 audio announcements of about 4 seconds duration.
At the moment I am using a SD card, and the waveHC library, but unless I use a SD card of 250Mb or less it is unreliable, and sometimes won't read the card.

Would it be better to use some EEPROMs ?    the audio tracks are between 250 and 850k, but I am sure i can reduce the sampling without hassles.

I just need some advise here..........


It seems that there are many people who have the same problem with the larger memory SD cards, and I havn't found any answers posted yet.
The real problem is that it is intermittent, the card just doesn't respond after a while, replacing it works again for a while.
Replacing the card with a 250Mb version ( when I can find them ) works fine every time.

I have tried changing the buffer chip to several different types, and decoupling caps right on the socket of the card, but not found the answer........


I think reading from a serial EEPROM would probably work for you.
Take a look here
See how many you'd need for the storage you're after.
They're in Bits, so divide by 8 or 12 or 16 or whatever width you're using for your DAC.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Thanks Bob
I think the first thing I must do is rerecord the anouncements with a view to making them smaller files - it didn't matter before with the SD cards.
Then I can see what size I must work on


OK I have broken the announcements into 14 slices of WAV files totalling 259k ( I could probably trim them a little more )

In an ideal world I could just swap the SD card for a pair of AT24C1024W EEPROMs that are available locally.

I don't really understand how the waveHC library interacts with the DAC and the SD card, presumably the FAT side would be a much simpler random address on the EEPROM for the various sound files ?

To record the WAV files on the EEPROM would presumably be a separate sketch to import each byte or batch of bytes of the WAV file from the PC, via the Arduino board, and store them on the EEPROM?

I would then plug the eeprom into a socket on the project board, which has a 328 chip to read from the eeprom and feed to the DAC or whatever ?

am I on the right track, or trying to reinvent the wheel?


Your description sounds exactly like I was thinking.
I wouldn't be using a library, would just be reading from the known start address and writing to the DAC.
But that's just me.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Maybe it is a problem with your code and the way it reads the files, as if it is loooking for something and searches the whole thing
I've been using 4gb sd cards for a while now datalogging and reading back the information and I've had no hassles regardless of the size of the file
id check your code first for a bug before changing the storage medium, especially as an sd card is very cheap and very simple to use,
if your code is funny, complicating it with serial eeprom probably wont help


The code I have been using is basically the example from the guy who writes the FAT libraries, and he reckons the wave HC is the one best suited to audio.
I have to have this project sorted out without the audio problem .  The audio part is just a small part of the project, which superimposes graphics on a HD LCD screen, which is working fine ...

I will try your idea with no libraries Bob, and start with a small example with just a couple of files, I think I can master the eeprom part, its similar to the RTC chip eeprom on the last project , which is working well.
I am not too sure about the DAC, but I have downloaded the datasheet and see what I can do.

The wavehc code is extremely complicated for us beginners, but I am hoping most of it is for the SD card side....


OK I have bought a 24C1024 eeprom, made up a little Mgyver shield, and studied the datasheet.

I have tried the benchmark example of http://www.arduino.cc/playground/Code/I2CEEPROM24C1024
but it gets to " writing data " and hangs.

I notice there is no "begin" in the setup, which I think should be the memory reset  from the datasheet ?

I just want to try writing to and receiving from the eeprom for now.

I will try through the night and see how I get on.

My next task will be to find how to download the WAV files in bytes and store them on the eeprom.


I eventually went back to the serial printout, which I thought was hung, and it reports:

Code: [Select]
E24C1024 Library Benchmark Sketch

Write By Byte Test:

Writing data:...........................DONE
Total Time (seconds): 722
Write operations per second: 181

Read By Byte Test:

Reading data:...........................DONE

Total Test Time (secs): 83
Read operations per second: 1579
Total errors: 0

If I cant get more than 1579 bytes ( or is it talking bits? ) I cant see it providing data fast enough to the DAC for the audio ???


That does seem slow.
How're you writing to the DAC?
If you figure an arduino with 16,000,000 clocks/second,
needs 8 clocks to read a byte serially in a burst mode,
so you're down to 2,000,000 reads/second,
and 8 clocks to write it out in a burst mode,
so you're down to 250,000 reads/writes/second,
and it takes 100 clocks for the instructions to move the data from input register to output register and other stuff,
so you're down to 2,500 reads/writes/second.
Doesn't leave much room for quality sound does it.
Doesn't sound like SD card with serial SPI would do much better.
If you could do byte reads/writes you could get back to ~40,000 reads/writes per seconds.
Or go with external hardware - load start address into a counter, have EEPROM data bus be same as DAC bus, address clock to counter be the data clock into the DAC kind of thing.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


For eproms, the read time is different than write time. It takes about 5ms for a byte or page to be written, and this makes for a maximum write rate of 200 bytes or pages (of 128 bytes) per second.


Yes, read times are much faster than write times, that was not an issue.
The issue is the time it takes for the serial transfers from EEPROM to the DAC. Overall it would seem too slow.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Sep 23, 2011, 05:05 am Last Edit: Sep 23, 2011, 05:20 am by Boffin1 Reason: 1
Of course the other thing is that this test addresses, then writes, to each byte in turn.

I will be random addressing approx 5 Kb at a time, so just need to send the start address once, then read a whole string of bytes.

I havnt even connected the DAC yet, this was just a speed test routine in the library

I am going to see if I can test writing a couple of bytes , then test the retrieve time.  I will not actually be writing to the eeprom at all once it is "recorded"  except for the dummy write before each random read ( as per data sheet for the 24C1024 )
This is all interesting new ground for me.

The DAC I am using at the moment  is connected as in the top right of


Can't you read an SD card like Openlog at 115kbps?  It's buffered so the code doesn't have to wait for each byte to arrive?  I've been going the other way at this speed, so mine is much more difficult.
If you fall... I'll be there for you!

Skype Brighteyes3333
(262) 696-9619

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131