Basic Stamp MP3 player...
delboy
Posts: 6
Hi guys,
I've been playing around with my BOE & Basic Stamp 2IC for a while now and although I'd still class myself as a novice, I feel reasonably comfortable attempting a more ambitious project and want to bounce it off the experts here to see if I'm being optimistically naive (which I suspect I may be!).
Long story short, I want to attempt a project similar to the Quadravox Pet Trainer project (www.parallax.com/dl/docs/cols/nv/vol2/col/nv65.pdf) but want to use an MP3 decoder and MP3 files instead of the Quadravox ChipCorder and low-quality WAVs.
Breaking the project down into manageable chunks, here's my current 3-phase approach:
Phase 1 - Based on what I've learnt in the following two Nuts & Volts columns, develop PBASIC / Visual Basic apps to save a small (say 50k) MP3 file into a 24LC256 256k EEPROM:
www.parallax.com/dl/docs/cols/nv/vol3/col/nv88.pdf
www.parallax.com/dl/docs/cols/nv/vol3/col/nv89.pdf
Phase 2 - Acquire an STA013 MP3 decoder and a CS4334 Digital to Analog Converter and following the high-level instructions here: www.pjrc.com/tech/mp3/sta013.html attempt to pull the MP3 data from the 256k EEPROM and run it through the STA013 MP3 decoder via my Basic Stamp.
Phase 3 - Assuming the above two phases actually work, acquire either an ALFAT-SD board (www.ghielectronics.com/ALFAT-SD.htm) or the Spark Fun SD breakout board (www.sparkfun.com/shop/index.php?shop=1&cart=213632&cat=1&itemid=331&) and read the MP3 data directly from an SD/MMC card into the STA013.
I realise this is all pretty ambitious, but is it even realistic? I know the Basic Stamp is considered "slow" relative to chips like the SX - is it capable of streaming the data from an EEPROM to the MP3 decoder fast enough? Should I perhaps consider the SX instead?
Any advice / pointers would be most appreciated guys!
Del.
I've been playing around with my BOE & Basic Stamp 2IC for a while now and although I'd still class myself as a novice, I feel reasonably comfortable attempting a more ambitious project and want to bounce it off the experts here to see if I'm being optimistically naive (which I suspect I may be!).
Long story short, I want to attempt a project similar to the Quadravox Pet Trainer project (www.parallax.com/dl/docs/cols/nv/vol2/col/nv65.pdf) but want to use an MP3 decoder and MP3 files instead of the Quadravox ChipCorder and low-quality WAVs.
Breaking the project down into manageable chunks, here's my current 3-phase approach:
Phase 1 - Based on what I've learnt in the following two Nuts & Volts columns, develop PBASIC / Visual Basic apps to save a small (say 50k) MP3 file into a 24LC256 256k EEPROM:
www.parallax.com/dl/docs/cols/nv/vol3/col/nv88.pdf
www.parallax.com/dl/docs/cols/nv/vol3/col/nv89.pdf
Phase 2 - Acquire an STA013 MP3 decoder and a CS4334 Digital to Analog Converter and following the high-level instructions here: www.pjrc.com/tech/mp3/sta013.html attempt to pull the MP3 data from the 256k EEPROM and run it through the STA013 MP3 decoder via my Basic Stamp.
Phase 3 - Assuming the above two phases actually work, acquire either an ALFAT-SD board (www.ghielectronics.com/ALFAT-SD.htm) or the Spark Fun SD breakout board (www.sparkfun.com/shop/index.php?shop=1&cart=213632&cat=1&itemid=331&) and read the MP3 data directly from an SD/MMC card into the STA013.
I realise this is all pretty ambitious, but is it even realistic? I know the Basic Stamp is considered "slow" relative to chips like the SX - is it capable of streaming the data from an EEPROM to the MP3 decoder fast enough? Should I perhaps consider the SX instead?
Any advice / pointers would be most appreciated guys!
Del.
Comments
So as long as you can establish a separate control methodology that allows the actual data to bypass the BS2, this can work.
1. The 24LC256 holds 32 kilobytes - so the maximum file you can load is 32 KB
2. The 24LC256 is a faily slow device - 400 KHz serial data
3. The STA013 is a fast device - and can accept data up to 20 Mbps
4. The BS2 has 26 bytes of RAM and runs can process 4000 instructions per second
You should 'do the math' before building this project - because right now it doesn't add up! You'll probably need to switch to a faster memory chip and switch to a faster CPU.
Forrest - thanks for the detailed breakdown - I should've really researched that prior to asking the question here. The following is my understanding of the maths behind this:
Forgetting the EEPROM speed for a moment...
If I use the BS2p24-IC, I can theoretically run at 12,000 instructions a second. If I take 2 instructions to Read from EEPROM and write to STA013A, theoretically could I pump ~6000 bytes a second to the STA013A? If I use a 32kbps MP3 file assuming a fixed bit rate, I would need to pump at least 4000 bytes a second into the ST013A to get smooth playback - so based on my novice understanding does this mean I could theoretically achieve low-quality MP3 output using the fastest Basic Stamp?
Del.
To nutshell, the stamp doesn't have enough power to directly drive your system, you'll need significant glue logic to get CD quality sound (generating addresses etc), but this system's overall control can still be directed through a stamp (Play, Stop, Fast Forward, Reverse, etc).
12,000 instructions per·second·for the BS2P vs 50,000,000 instructions per·secondfor an SX·at 50MHz.· Only thing is the extrenal memory the SX would be using would need to be fairly·fast.
Anyway thats just my 2 cents.
Chris