Someone Electro
New Member
This is a little project i did in a few days. What is basically dose is it plays WAV files from a SD memory card. To interface the card i used microchips free file system lib.Here it is run on a dsPIC30F4013.
The audio output is done using PWM at over 100Khz. I didn't really expect much from it but the sound quality was amazingly good.It sounded as good as a real sound card. Because of that i didn't even think of using a real DAC.The player can play uncompressed WAV files with stanard sample rates from 8Khz to 48Khz. Since the output PWM could only do 8bit precision at such a high freq. the LSB of 16bit WAVs is ignored and stereo WAVs only play the left channel since i only used a single PWM channel. Also if the file is bouth 16 bit and stereo it canot play it at the higher sample rates because the bitrate becomes enormus and the pic cant read the card fast enugh anymore.(48Khz needs 1.5Mbit/s)
As i found it really difficult to find a proper SD card slot i quickly turned a peace of prefboard and a male header in to one and it makes a perfectly good contact with the card and allows the card to be simply pulled out.
The LEDs ware used for debugging, the pretty colorful flat cable is from the programmer and the big black one is the com port cable with a MAX232 in it. So where are the buttons and stuff? Well i was too lazy to give it some UI and just used the com port that was firstly used as debug and now to controll the player.
Oh and if you are wondering it is not possible to play a MP3 with a dsPIC because it is just not fast enugh to decode it in real time, so for that a MP3 decoder chip must be used. I have one of those around and will meaby try it out.
The audio output is done using PWM at over 100Khz. I didn't really expect much from it but the sound quality was amazingly good.It sounded as good as a real sound card. Because of that i didn't even think of using a real DAC.The player can play uncompressed WAV files with stanard sample rates from 8Khz to 48Khz. Since the output PWM could only do 8bit precision at such a high freq. the LSB of 16bit WAVs is ignored and stereo WAVs only play the left channel since i only used a single PWM channel. Also if the file is bouth 16 bit and stereo it canot play it at the higher sample rates because the bitrate becomes enormus and the pic cant read the card fast enugh anymore.(48Khz needs 1.5Mbit/s)
As i found it really difficult to find a proper SD card slot i quickly turned a peace of prefboard and a male header in to one and it makes a perfectly good contact with the card and allows the card to be simply pulled out.
The LEDs ware used for debugging, the pretty colorful flat cable is from the programmer and the big black one is the com port cable with a MAX232 in it. So where are the buttons and stuff? Well i was too lazy to give it some UI and just used the com port that was firstly used as debug and now to controll the player.
Oh and if you are wondering it is not possible to play a MP3 with a dsPIC because it is just not fast enugh to decode it in real time, so for that a MP3 decoder chip must be used. I have one of those around and will meaby try it out.