Pages: [1] 2 3   Go Down
Author Topic: EEPROM better than SD card for audio ?  (Read 2121 times)
0 Members and 1 Guest are viewing this topic.
Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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..........
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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........
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23725
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

John,
I think reading from a serial EEPROM would probably work for you.
Take a look here
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=80
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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23725
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Edison Member
*
Karma: 4
Posts: 1725
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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....
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
 
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
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 ???
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23725
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23725
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
 http://www.ladyada.net/media/wavshield/waveshield10schem.png
« Last Edit: September 22, 2011, 10:20:33 pm by Boffin1 » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pages: [1] 2 3   Go Up
Jump to: