Sunday, December 20, 2020

Muliplexed evelopes

I've dreaded doing the envelopes for a long time, mostly because there is always something crazy happening that takes a long time to debug. But now I have a very good working prototype.

I looked at my previous post here: http://atosynth.blogspot.com/2015/02/sample-and-hold-acquisition-time.html

Using 10nF sample and hold caps I wrote (5 years ago...) that an update time of 25uF seems appropriate. I have, however, not shown the original circuit, I have to go back and check if I buffered the op amp or not - because when I redid it now I could not get the desired speed. I had to run updates for at least 50uS. When I added an opamp after the dac however, things changed. I can't see any difference even when I run updates at 16uS. 

So, I've written an arduino program that updates a dac every 25uS. This is multiplexed to as many channels as possible, and the overall refresh rate is 1kHz.  I had a lot of issues related to starting/stopping the various times and ended up with a 25uS timer running all the time, just turning off the DAC update when all channels have been updated.

The output chain goes like this:

DAC8830 -> TL07x buffer -> CD4051 mux -> output buffer, 10nF cap + TL07x 

The mux is controlled by aCD4520 clock (only two pins needed for clock, one for next and one for reset-to-zero). Before an update, the inhibit signal of the mux is raised, turning off the outputs. The clock is progressed, switching to the next output. The DAC is updated and settles in 1uS, then inhibit is turned off and the output turned on. It is left to charge the cap for the remainder of the time between DAC updates, approximately 16uS. Rinse and repeat.

I tried updating a square wave at 1kHz too, it looks surprisingly good. The edges are slightly rounded, but that seems to be an artefact of the caps as increasing the charge time does not affect it.

DAC control. 1: chip select, 2: SPI clock. 3: DAC data, 4: mux inhibit

1kHz square wave on one of the outputs

Envelope output, 1kHz sample rate

Closeup of steps. Each step is held by the sample and hold cap, the DAC is disconnected right after the start of each step



No comments:

Post a Comment