Schematic:

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


This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletePlease can you tell me how to compile this source (PIC18 SD WAV Audio) ? under PICC18 produces many errors.
ReplyDeleteas reported (confirmed), errors will occur when using other versions of Hi-Tech PICC18 compiler. I've used the v9.64 of PICC18 to compile the above projects with no problems encountered.
ReplyDeleteDear Yus. I could not find online the version v9.64, but I have found two versions one v9.63 and v9.66 and both are not working to compile this code. Please help me. Is there a way to convert the code to C18?, or maIf you can attach file here is my hotmail accnt is gbrovage.
ReplyDeletehi i didnt work this device :S
ReplyDeletepls can u tell me how to compile this source? under PICC18 produces many errors.
hi can u send me mmc file with sound for simulation in proteus. Thx
ReplyDeleteWhich kind of data i must set when i programer pic18f2550 in programator (osc,watchdog.....)
ReplyDeleteWhen 1 burn this PIC he doesnt work.
Thx.
Could you maybe post a full circuit with all resistors caps crystals and the LED?
ReplyDeleteThx