08 Oct 2013: 2nd revision, DAC Audio prototype PCB: success

Status update at the PCB page). After considerable experimentation a decision was made not to use PWM for the audio output, and to use the two 12-bit DACs instead. The primary reason was concern over how the TDA2822D (which is a 0.5W Class B amplifier) would react to high frequency edges of PWM output.

So instead, after finding an STM32 application note which outlined how simple it is to use an STM32F to read from an SD Card and play back WAV files using DMA, a decision to try that out was made. The first experiment showed huge clipping: the DACs output 3.3V peak-to-peak. Ramping the DAC output back to 1/25th of its dynamic range fixed that, and gave a sine wave on the output. Further experimentation with a resistor bridge (200k - 2.4k) gained back the full 12-bit dynamic range of the DAC.

As the TDA2822D is a 0.5 Watt amplifier, and the speakers are 8mm x 18mm the volume is not exactly spectacularly loud, especially at low frequencies. A larger capacitor (470uF instead of 100uF) will help slightly at the low end, however for voice this solution is perfectly adequate, and there will also be a headphone option. Video demonstrating the circuit and explaining the software is here: