PDA

View Full Version : Play Music (MP3, WAV,...) for greeting card



flotulopex
- 9th January 2007, 11:05
Hello,

Is there any way to play music (MP3, WAV, ..) using a PIC as the "player's" controller?

I have to make a greeting-card with text (LCD display) and sound (music). LCD is simple, music else than a buzzer....

I found some special IC lioke the "STA013" from PJRC.COM and the "Melody MP3" from ANALOG.COM (can't find tech infos on this one) but they seem quite complicated... at lest to me.

Any idea is welcome.

skimask
- 9th January 2007, 13:49
Hello,

Is there any way to play music (MP3, WAV, ..) using a PIC as the "player's" controller?

I have to make a greeting-card with text (LCD display) and sound (music). LCD is simple, music else than a buzzer....

I found some special IC lioke the "STA013" from PJRC.COM and the "Melody MP3" from ANALOG.COM (can't find tech infos on this one) but they seem quite complicated... at lest to me.

Any idea is welcome.

Read all the info from PJRC and my site on the STA013. It's a bit of a pain to use. Might be better off going with a VS1001k, not sure haven't used it. Once I got the STA013 working, I stuck with it. I use it in my own mp3 player.

flotulopex
- 9th January 2007, 16:23
Hi Skimask,

Thanks for your reply.

Would you have a code sample for me?

In your opinion, on a scale from 1 to 5 (1=lowest/5=highest), what would be the technical level needed to achieve this type of circuit (need a circuit playing 1 music file continously)?

skimask
- 9th January 2007, 16:37
Hi Skimask,

Thanks for your reply.

Would you have a code sample for me?

In your opinion, on a scale from 1 to 5 (1=lowest/5=highest), what would be the technical level needed to achieve this type of circuit (need a circuit playing 1 music file continously)?

STA013 - I2C controlled, you have to 'load' a 4K boot file to the STA013 thru I2C before it'll do anything (ST Micro claims it's a security mechanism, I think it's a patch file for the internal DSP). After that, it's a 'simple' matter of getting music file from eeprom (or wherever) and shifting it out the a couple of SPI pins to the STA013.

My opinion? I don't know how good you are (i.e. what you've done already). It's a piece of cake for me now that I've done it a few times.

Code - I've got a bunch of stuff, I don't know whether or not you'll be able to make use of it since I designed the code to fit around my hardware (keys, LCD, hard drive, STA013, eeprom, FTDI245AM USB chip, etc.etc.) and I don't have it here with me at the moment. Did you check PJRC and my site for hints? PJRC has a really good writeup on how to run the STA013, http://www.pjrc.com/tech/mp3/sta013.html .


I just attached my personal mp3 player PBP code. This is first anybody else will have ever seen the complete code, not that it's secret or anything like that, but quite frankly, what is anybody else going to do with the code that doesn't have the hardware to go with it?

It's got a lot of stuff in it, as mentioned above, IR receiver (w/ Sony IR code handling in it), some string handling/sorting routines, hard drive access/formatting/reading/writing/etc, eeprom, LCD, keypad handling, my own file system handling, STA013 control and use (the STA013 patch code mentioned above is actually located in an off chip eeprom at the top of the eeprom's memory space, if you really wanted to, I could read the eeprom back into a hex file and you could use that to do the patch code, basic read byte, write byte.), hard drive buffering (along with an optional compact flash card as a slave set up as a huge buffer to save battery power), scrolling filename display, analog battery voltage monitoring, keypad polling, IR led receiver polling, timed interrupts,

I'm sure if some of the more experienced people read thru the code a bit (i.e. Melanie, Darrel, mister_e, etc), they'd probably get a bit of a kick out of it. Hey, I didn't know any better at the time :) but it worked for me! The only reason I put the player away permanently is because there was a bolt inside that came loose and that bolt and a washer ended up underneath the power supply. I let all the smoke out of the power supply and a few other parts....and we all know that these pieces/parts come pre-packaged from the factory with a certain amount of smoke placed in them. If you let the smoke out, they quit working!!!

skimask
- 10th January 2007, 02:47
Forgot to add the code :)

mister_e
- 10th January 2007, 05:02
LMAO!.. really liked this one

...and we all know that these pieces/parts come pre-packaged from the factory with a certain amount of smoke placed in them.

I thought it was normal at the firsts use as they are brand new ;)

flotulopex
- 10th January 2007, 09:40
Well,

After having a first look at your code, the isn't "a piece of cake" to me. It's more a piece of cheese filled with lots of holes...

On the other hand, the hardware looks rather simple.

If y can find one of these chips here, I'll go for a try.

Thanks a lot.

skimask
- 10th January 2007, 13:42
Well,

After having a first look at your code, the isn't "a piece of cake" to me. It's more a piece of cheese filled with lots of holes...

On the other hand, the hardware looks rather simple.

If y can find one of these chips here, I'll go for a try.

Thanks a lot.

Mouser sells the STA013 in a BGA49 package. I might have a couple extras laying around already on a SOIC-28->DIP28 converter package. I'll check if you really want to mess with this.

skimask
- 10th January 2007, 13:45
LMAO!.. really liked this one


I thought it was normal at the firsts use as they are brand new ;)

Well, ya know, cars engines are the same way. They burn off the smoke installed at the factory at a certain rate. We keep adding smoke to the back of them at the fuel station. Eventually, the car burns smoke at a faster rate than we can add it back in we have to rebuild the engine with new smoke.

flotulopex
- 10th January 2007, 15:14
Okay.

Let me know if you can put a hand on it!