Schematic:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrGRfs6JlgJ9IL3s1Mav_tmfnVFnJD3LzLg-u_uM1LNi5GopTJ1vKH_ucxW4n4NuqzFvYYtwrUX1IktlH4Qor4__FMoc-88udT2vp1bQop89QT-o_ljZdCRJOLJuGa8cIq4pJhkI5QZL_H/s320/PIC18F2550+WAV+Player.jpg)
Due to PIC's peripheral limitations, I only set the PWM frequency to 187.5kHz and not the 250kHz carrier frequency originally used by ChaN, because it's the maximum PWM frequency than can still get an 8-bit resolution of the duty cycles (=48MHz/256). It is also possible to use R-2R ladder in stead of (low-pass) filtering the PWM output since there still enough unused digital output pins for this approach.
On the software part, I wasn't able to make a good data buffering as good as what ChaN did. It's noticeable with WAVE files with higher bit-rates (=SampleRate*NumChannels*BitsPerSample). Nevertheless, it can still support up to 48kHz sampling rate, but with only Mono channel and 8-bits/sample resolution.
demo video:
Source code(PICC-18) with and without LCD: PIC18 SD WAV Audio Player
My on-going project: currently porting the code to STM32F103RB for additional features.
Some useful software (shareware) tools:
TextAloud - Text to Speech software
Switch Sound File Converter-multi format audio file converters