Somebody help me How to store 500kbytes of audio data (EEPROMs aren't large enough) ?

I am using a dsPIC33EP512MU810 bought from

formatting link
to read audio data (PCM, 8-bit mono, 44.1k Hz) from a 25LC1024 EEPROM. The problem is I have ~500kbytes of audio data I need to store to the EEPROM. I realise now that the 25LC1024 EEPROM is actually 1 mega "bits", not 1 meg a "bytes" ! So thats a lame 131,072 kbytes ! Which is pathetic in this day and age where mobiles have 128Gb of flash and USB sticks and SSD cards of

64Gb+ are common. The largest EEPROM I can find is only 2Mbits. Each of my sound samples is ~20Kbytes to ~30Kbytes and I have 15 samples wh ich I need to store. The PCM audio is stored on the EEPROM as 8-bit mono w ith a 44.1kHz sample rate (this is the sample rate the I2S is configured fo r on the dsPIC) .

Is the only alternative an SSD card ? My frustration is that this means wr iting a new driver to read from an SSD card instead of the EEPROM and I hav e spent time and effort to get it working with the EEPROM until I ran out o f storage space ! I tried to reply to my previous post but the forum keeps crashing (it's so 'flakey'). Below is the the reply I tried to post: I have now got this working, there was actually nothing wrong with the code . First of all, I didnt have any optimisation for the compiler (level was set to 0) so I changed this to level 3, although it only made a slight imp rovement and still fell over. Then I changed the size of the SPI and I2S buffers. Because of the way my code transfers the SPI buffers to the I2S buffers, the I2S buffer are alway s 4 times bigger than the SPI2 buffer. Originally I had an SPI2 buffer size of 4 and therefore an I2S buffer size of 16. I increased this to an SPI2 buffer size of 16 and therefore an I2S buffer size of 64 and it works !!!!!! So I assume the SPI overflow was dow n to there not being enough processing time available ? But now I've hit yet another hurdle. I have 4 sound clips which are read a nd played from the EEPROM every 5 seconds, with speech counting "15", "14", "13" and "12" in a loop. However, the EEPROM is now full with only these 4 samples ! I realise now that the 25LC1024 EEPROM is actually 1 mega "bits", not 1 mega "bytes" ! S o thats a lame 131,072 kbytes ! Which is pathetic in this day and age wher e mobiles have 128Gb of flash and USB sticks and SSD cards of 64Gb+ are com mon. Each of my sound samples is between 20Kbytes to 30Kbytes, its only 8-bit mo no with a 44.1kHz sample rate (this is the sample rate the I2S is configure d for). I need about 500kbytes to store all my sound samples. So now need to look at another way to store these sound samples, the bigges t EEPROM I can find is only 2Mbit so that's no good either.

Reply to
xiao46260
Loading thread data ...

ha scritto:

1kHz) from a 25LC1024 EEPROM. The problem is I have ~500kbytes of audio da ta I need to store to the EEPROM.

ega "bytes" ! So thats a lame 131,072 kbytes ! Which is pathetic in this d ay and age where mobiles have 128Gb of flash and USB sticks and SSD cards o f 64Gb+ are common. The largest EEPROM I can find is only 2Mbits.

If you don't plan to change the data a lot you can use some SPI Flash, for example the SST25VF016B (16Mbit, 2 MByte), that it seems pin compatible wit h the EEPROM you want to use.

Or you can use more that one chip of EEPROM, for 25LC1024 you can share the SI, SO, SCK signals and use a different CS for every chip.

Reply to
jack4747

What about using serial Flash chips instead of eeprom? Flash is cheaper and greater storage capacity. E.g. Microchip SST25WF080B is 8 Mbit (1Mbyte) and

Reply to
piglet

If it doesn't need to be hifi quality then why not filter the audio down to 5kHz bandwidth then drop the sample rate to 11kHz and accept that cymbals and dog whistles will not be adequately reproduced.

Otherwise you could use MP3 audio compression but the decoder for that will be a lot more work. That will get you a factor of 10x smaller file with almost no perceptable loss (or 5x if you are very discerning).

Regards, Martin Brown

Reply to
Martin Brown

1kHz) from a 25LC1024 EEPROM. The problem is I have ~500kbytes of audio da ta I need to store to the EEPROM.

ega "bytes" ! So thats a lame 131,072 kbytes ! Which is pathetic in this d ay and age where mobiles have 128Gb of flash and USB sticks and SSD cards o f 64Gb+ are common. The largest EEPROM I can find is only 2Mbits.

which I need to store. The PCM audio is stored on the EEPROM as 8-bit mono with a 44.1kHz sample rate (this is the sample rate the I2S is configured for on the dsPIC) .

writing a new driver to read from an SSD card instead of the EEPROM and I h ave spent time and effort to get it working with the EEPROM until I ran out of storage space !

o 'flakey'). Below is the the reply I tried to post:

de. First of all, I didnt have any optimisation for the compiler (level w as set to 0) so I changed this to level 3, although it only made a slight i mprovement and still fell over.

y code transfers the SPI buffers to the I2S buffers, the I2S buffer are alw ays 4 times bigger than the SPI2 buffer.

e of 16. I increased this to an SPI2 buffer size of 16 and therefore an I2 S buffer size of 64 and it works !!!!!! So I assume the SPI overflow was d own to there not being enough processing time available ?

and played from the EEPROM every 5 seconds, with speech counting "15", "14 ", "13" and "12" in a loop.

w that the 25LC1024 EEPROM is actually 1 mega "bits", not 1 mega "bytes" ! So thats a lame 131,072 kbytes ! Which is pathetic in this day and age wh ere mobiles have 128Gb of flash and USB sticks and SSD cards of 64Gb+ are c ommon.

mono with a 44.1kHz sample rate (this is the sample rate the I2S is configu red for). I need about 500kbytes to store all my sound samples.

est EEPROM I can find is only 2Mbit so that's no good either.

Data compression, lower data rate, snipping out duplicated sounds or larger store. What other answers are there?

NT

Reply to
tabbypurr

SPANSION S25FL127SABMFI101 is 128 Mbits for about $1.50.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

Two suggestions:

First, there are FAT file systems out there that come with SD card drivers as examples, and come recommended by people on the comp.arch.embedded group. I've looked at a few, I've even got one coded into a hobby project of mine, but because it's a hobby project I haven't actually tested it.

Second, what sort of sound quality do you need? If you could stand "telephone" quality then storing things as A- or mu-law companded audio at 8kHz sampling should reduce your storage needs by a factor of five or so (two for 16 bits to 8, 2.5 for 20kHz to 8kHz). I know from long-ago experience that you can do even better, with little loss in sound quality (from telephony quality, at least) if you use ADPCM compression. Or, you could probably do better than ADPCM by using some more modern audio compression/decompression algorithm.

I can't give you any details. -- you'll have to go a-Googling. The DSPIC should be able to keep up, is all I can say.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com 

I'm looking for work -- see my website!
Reply to
Tim Wescott

What exactly are you trying to store ?

8 bit (linear?)PCM at 44.1 kHz sounds a quite bad selection at least for audio recorded by a microphone. At least use some floating point format like the telephone A or u-law (1 bit sign, 3 bit exponent and 4 bit mantissa).

Alternatively, use some differential PCM format, which makes it possible to store low frequencies with higher fidelity.

How often are you going to record new samples ?

The use of EEPROM would suggest that new samples are recorded rarely, perhaps only once ? Is the recording done with the same device or is it downloaded from a larger system ?

If the recording is done by a different device, much compression can be applied and the small uC just needs to do the decompression, thus saving a huge amount of storage.

Reply to
upsidedown

Since you already use some SPI, realise that most SD cards can be used directly in SPI mode. So its pretty easy to just use them. You may not even need much of a filesystem, although there are plenty of DOS-like filesystems around for cards too. Depends on what language support you have for your processor.

--
Regards, 

Adrian Jansen
Reply to
Adrian Jansen

1kHz) from a 25LC1024 EEPROM. The problem is I have ~500kbytes of audio da ta I need to store to the EEPROM.

ega "bytes" ! So thats a lame 131,072 kbytes ! Which is pathetic in this d ay and age where mobiles have 128Gb of flash and USB sticks and SSD cards o f 64Gb+ are common. The largest EEPROM I can find is only 2Mbits.

which I need to store. The PCM audio is stored on the EEPROM as 8-bit mono with a 44.1kHz sample rate (this is the sample rate the I2S is configured for on the dsPIC) .

writing a new driver to read from an SSD card instead of the EEPROM and I h ave spent time and effort to get it working with the EEPROM until I ran out of storage space !

o 'flakey'). Below is the the reply I tried to post:

de. First of all, I didnt have any optimisation for the compiler (level w as set to 0) so I changed this to level 3, although it only made a slight i mprovement and still fell over.

y code transfers the SPI buffers to the I2S buffers, the I2S buffer are alw ays 4 times bigger than the SPI2 buffer.

e of 16. I increased this to an SPI2 buffer size of 16 and therefore an I2 S buffer size of 64 and it works !!!!!! So I assume the SPI overflow was d own to there not being enough processing time available ?

and played from the EEPROM every 5 seconds, with speech counting "15", "14 ", "13" and "12" in a loop.

w that the 25LC1024 EEPROM is actually 1 mega "bits", not 1 mega "bytes" ! So thats a lame 131,072 kbytes ! Which is pathetic in this day and age wh ere mobiles have 128Gb of flash and USB sticks and SSD cards of 64Gb+ are c ommon.

mono with a 44.1kHz sample rate (this is the sample rate the I2S is configu red for). I need about 500kbytes to store all my sound samples.

est EEPROM I can find is only 2Mbit so that's no good either.

Six-teen, fif-teen, four-teen, thir-teen, 6, 4... lots of redundancy there.

This is a newsgroup not a forum. Sounds like you just need software that wo rks. Lots of modern OSes come with it already installed.

NT

Reply to
tabbypurr

You don't need a 44.1 kHz sample rate for speech.

Microchip provide a version of Speex for the dsPIC which supports sample rates of 8 kHz or 16 kHz with compressed data rates of 8-12.8 kbits/sec.

If you want better quality, you might be able to get the low-memory version of Tremor (fixed-point Vorbis decoder) working on a dsPIC.

Reply to
Nobody

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.