Simple sound via PWM problem...

Dear group, I need to play 8-bit, 11kHz, mono .wav files using an MCU. The sound quality doesn't have to be great. The idea is to generate a 11 kHz PWM with a varying duty cycle proportional to the current sample's amplitude.

A friend of mine proposed such a circuit:

formatting link

I am not sure what should be the values of caps and the resistor. Any help here?

Reply to
Loading thread data ...

Too complex!

Just do e.g. 8 Khz 8 bit, but play it out using a PWM channel on a very high PWM frequency (e.g. > 50 KHz). (sample freq =/= PWM freq!)

The (buffered, of course) PWM output can be offered directly to the speaker. For more power invert the PWM and feed the speaker in bridge.

The speaker will offer a high impedance towards the > 50 Khz pwm, and just reproduce the sound. No analog filtering / amplification required. No Hifi - but good enough for speech.

This how al those talking toys are doing it...ultimate cheapness!

Just be sure to filter the input sound loww pass below 4 KHz (or ~ half the sample freq)

 - René
Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.