Skip to content

Achieving (mock) Analogue

Rory Allen edited this page Apr 10, 2021 · 4 revisions

The Pico board does not have a native DAC (Digital to analogue converter), so without using up limited I2C channels (and large cost) for dedicated DAC boards, another solution was required.

The way that I've managed this is by using the PWM channels of the Pico which are abundant (16 channels available), and then using simple RC (resistor capacitor) low pass filtering to convert this pulse width into a DC voltage. The result is that by changing the pulse width in code, crude 16 bit analogue can be achieved.

rc

However, this method has some big limitations, the first being that it's not even close to capable of reproducing audio. The reason for this is that the capacitor required to smooth the PWM creates a slew on the signal. This means that although the change in voltage seems immediate when operating at CV rates, once it reaches audio the slew effectively prevents the signal from changing fast enough for audio to be produced.

The second limitation is almost the same as the first, and relates to the slew rate. It is that FM synthesis CV outputs are very difficult to achieve if they are anywhere near audio rates.

Despite these drawbacks, they do allow an incredibly cheap board to allow users to output CV (with careful tuning even 1V/Oct) from a microcontroller that would otherwise be incapable, and of course if you really need audio DAC, you can still use an I2C device on one of the expansion headers

board