Wednesday, January 7, 2015

Stereo audio player using the PIC32, MCP4822, microSD card and the MDDFS library

Oscilloscope screen capture of output from the audio player
Top - left channel
Bottom - right channel

Using the PIC32MX250F128B, I decided to make a simple audio player. I wanted to play back good quality audio from a large memory space - a microSD card. So, I made this WAV player that can play back 16-bit 44.1kHz WAV files with 12-bit stereo audio output. Of course that's not all it can play back. It is programmed for automatic period configuration so that the period is set on the fly based on the song sample rate. It can play back both 8-bit and 16-bit mono and stereo audio files and I have tested from 8kHz 8-bit mono to 44.1kHz 16-bit stereo. The player itself does not include an audio amplifier to drive speakers but can drive earphones. I've used an external stereo speaker for testing.

The hardware is fairly simple! Using the Microchip Memory Disk Drive File System (MDDFS) library, and my previous work using the MCP4822 dual 12-bit DAC, integrating these components to make a working audio player was quite fun and a good learning experience.

Here I share all my project files and source code, along with documentation regarding this project. Let me know what you think!
Schematic of PIC32-based audio player





Running demo of the audio player:



All project files and schematic can be downloaded from:
https://drive.google.com/file/d/0B4SoPFPRNziHRGE0bVNZYV9uVjQ/view?usp=sharing

Documentation can be downloaded from:
https://drive.google.com/file/d/0B4SoPFPRNziHaWpIWFQ3RkJFVzQ/view?usp=sharing

10 comments:

  1. Tahmid, amazing! this is the point like i want work on a PIC32MX440F128H - you give me much teaching construction in it, thank you very much! i will study yours and try to build - i will combine with an ESP8266 for air music. you have save my week ;-) have a nice time with your's next.
    many greetings from germany, rudi ;-) will come back again. cheers ;-)

    ReplyDelete
  2. tahmid i need help regarding your push-pull converter circuit using sg3525, i am unable to run its simulation on proteus. please respond asap

    ReplyDelete
  3. I’m curious to discover out what weblog system you happen to be working with? Naturally I like your web-site. Also your web internet site loads up quick. I have seen many marketplace websites for microjobs, logo makers, business card designers, graphic designer like www.gicree.com, www.zopgraphics.com, www.elance.com and many other top good sites.

    ReplyDelete
  4. I was suggested this site by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my trouble. You are fantastic! Thanks!Good weblog here! Also your web internet site loads up quick! What web host are you making use of? I wish my internet site loaded up as quickly as yours lol. Hey I have also came across while surfing other blogs on net sites for freelancers like http://www.gicree.com. http://www.zopthemes.com and many others.

    ReplyDelete
  5. The player itself does not include an audio amplifier to drive speakers but can drive earphones. I've used an external stereo speaker for testing. Odyofil

    ReplyDelete
  6. wiithout using a DAC separately, can I use OCMP module of PIC32mx250F128B for PWM audio data out

    ReplyDelete
  7. Hi, I've a question. Which program are you use for Schematic and has this program run simulation for pic32?
    Besides congragulations, I've read your many posts. And you're very clever also sharer person. Knowledge is most expensive thing in the world. But your soul is very rich. Thanks for your shares.

    ReplyDelete
  8. Can anyone tell me which compiler version tu use to comppile this project? I tried with MPLAB X IDE 3.15 but always get kind of k=code compatibility issues.

    Thank you

    ReplyDelete
    Replies
    1. Forget about this, I found the answer in the documentation...

      Delete