There is some success in attempting to build wav player with pic microcontroller. The core of the system is powerful dsPIC30F3012 clocked on 80MHz. Wav file is read from SD card. It is famous Croatia'n song "Ostala si ista" by band "Maslina". Wav is 8 bit resolution, sampled at 44100Hz.The code is written in MikroC for dsPIC by Mikroelektronika. At the beginning of the main program the buffer is initially filled with data from file then the interrupt is enabled. Interrupt routine reads the data from the buffer in PIC ram and put the data in PWM duty cycle register OCRS every about 22us (1/fsample). Due to the fact the data in wav file is 8 bit it is necessary for PRx register to be 0xFF to obtain the good resolution.
So with 80MHz clock the pwm frequency is 78125Hz.
The program is capable for now to play only one song so there is plenty of room for improvements...
Any comments are well come...
6 Comments
9/30/2010 01:09:46 am
This blog is wonderful, really nice!!! , i stay impressive with the whole information here. I really like know about everything because i usually like to answer very well when a person ask me something. I Think the most important thing is to know about several information, and you look smarter all the time.
Reply
12/25/2010 10:16:27 am
I am grateful to you for sharing this information.
Reply
Tom
6/4/2012 06:35:25 am
Please, contact me on PM
Reply
Can you send me the code for dsPIC Wave Player to [email protected]?
Reply
10/11/2013 06:47:54 am
We must have a theme, a goal, a purpose in our lives.
Reply
Leave a Reply. |
Archives
June 2014
Categories |