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
|
Archives
June 2014
Categories |