Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Microcontroller + Extenal RAM Question

Status
Not open for further replies.

andy01

New Member
hi,

I have a little project that need to store and playback some kind of tone (like midi file) using the microcontroller. i am stuck on what type of RAM can i use to store audio file and play back. or is there any chip out there compatible with microcontroller that i can use to do this task.

thanks ahead


andy
 
Why RAM ? I would use I2C or SPI EEPROM.
They are small, inexpensive, and easy to interface to.

Do you need part numbers ?

3v0
hi,

I have a little project that need to store and playback some kind of tone (like midi file) using the microcontroller. i am stuck on what type of RAM can i use to store audio file and play back. or is there any chip out there compatible with microcontroller that i can use to do this task.

thanks ahead


andy
 
well, it doens't have to be RAM. if there is another chip that doest the same thing and cheaper. i would like to give it a try. do you have it part number? and also, how do they work?
 
can you give me a start on how can i store an audio to this EEPROM chip. and do i have to use a special microcontrol chip to use this this EEPROM. also, is there some kind of sample assemble code that i could start?

thanks ahead
 
andy, you cannot store "audio" in ram nor (ep)rom ... whatever connection you use (spi, i2c, parallel..) ... you can only store bit's, nibble's or byte's

in order to do so, you first need to perform AD conversion so you "digitize" the sound and then you store the array of values in the ram/(ep)rom...

lot of micro controllers have AD conversion unit embedded but most of those are not "fast" enough to sample sound (you need to have 44100 samples per second to get CD quality, around 4-8000 samples per second to get "usable" sound) so you might have to get either "high end" uC or some specialised AD chip.

in order to reproduce sound, again, you have to perform DA conversion which is bit easier to do (you can build simple resistor ladder DA converter quite easy or use specialised chip).

one thing to consider is bandwidth. in order to sample and store sound you need to be able to store it quickly enough or your buffer will overrun .. to explain, if you have 8000 samples per second, this means that you will have 8Kb of data to store every second. Some i2c eprom's cannot store data that fast (64KBps is lot of bandwidth) so you might have to go with some SPI or parallel storage device. You will fetch this data into uC and then store hence uC can use available ram to buffer the data before it is written to external storage. With slow storage, length of the sound sampled will be limited to the available ram on the uC (so with 8Kb available on uC with 8000 samples per sec, you will be able to store only 1sec of sound data)

note that there are specialised chips that do this for you (sample, store, retrieve, reproduce sound) and they are not expensive... IIRC the mp3 encoder/decoder chip with MMC card used for storage with SPI connection to uC was ~20$ (kit board with mp3 chip, mmc slot, sound out/in port, few elcos ...) maybe that would be better solution ?

example
**broken link removed** schematic: https://www.electro-tech-online.com/custompdfs/2008/09/easymp3_schematic_v101.pdf
**broken link removed** schematic: https://www.electro-tech-online.com/custompdfs/2008/09/smartmp3_schematic_v101.pdf
 
Last edited:
arhi said:
andy, you cannot store "audio" in ram nor (ep)rom ... whatever connection you use (spi, i2c, parallel..) ... you can only store bit's, nibble's or byte's
In the most technical sense you are right but in pratice we often store audio on various forms of media that use some method to encode the sound.

andy01 said:
can you give me a start on how can i store an audio to this EEPROM chip. and do i have to use a special microcontrol chip to use this this EEPROM. also, is there some kind of sample assemble code that i could start?
If you want a specific solution you need to be more specific about what you want to do. Do you want to build a unit that makes the same sound or sounds every time or do you want to be able to record sound with it. How about recording the sound with a PC and then downloading it to the device for playback. So may options.

As Arhi said there are purpose made chips for doing this that meke the job a lot easier.

At this point there is one question that has to be asked. Do you have the skills to pull this off. I not are you willing to put in a lot of hours to get there from here ?

3v0
 
Last edited:
3v0, the remark on "not storing audio in ram" was more on the side of, "you do not have audio in" then anything else .. if we talk about specialised chips then the story is bit different as they "store audio" and one does not have to worry "how they do it" :) (how they do AD conversion, how they encode/decode audio ...)

andy01, the easiest way is to go with some specialised chip, you will find many examples using http://www.vlsi.fi/en/products.html and also many kit boards with one of those chips ready to go (as chips are in those LQFP and/or BGA packages that are quite hard to solder if you are not experienced) ... some kit boards are pretty much complete (like the one I linked from mikroelektronika) and some are more basic ... check out following url's for the eval/breakout boards with VS1011 (mp3 playback) board
http://www.sparkfun.com/commerce/product_info.php?products_id=8819 (20$, spakfun)
**broken link removed**
**broken link removed**

or these with vs1053/vs1002 (Ogg Vorbis/MP3/AAC/WMA/MIDI record/playback)
**broken link removed**
http://www.sparkfun.com/commerce/product_info.php?products_id=7832

some other specialised chips:
**broken link removed**

If you want to diy you might consider dsPIC as it should be powerfull enough to do some good sampling and you can make sample resistor ladder DA for playback .. I do not have personal experience with dsPIC but many folks here do so you can surely get help, if, and only if, you are ready / willing to put in a lot of hours (as 3v0 already stated)
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top