[sdiy] sin/cos pot

rsdio at audiobanshee.com rsdio at audiobanshee.com
Tue Jul 11 01:35:30 CEST 2017


On Jul 10, 2017, at 11:28 AM, Bruno Afonso <bafonso at gmail.com> wrote:
> Could we easily mux 6 pots into one ADC? I've never done it. I have a teensy 3.6 based prototype to send out dmx where I currently have 6 encoders. But I'd love to upgrade this to elektron like encoders/endless pots.. :) this is exactly why a while ago I asked about it. Others were interested as well.

You can always mux any number of pots into one ADC. On chips that have many Analog GPIO pins, there is an internal mux that must be programmed separately from the ADC (or maybe the peripheral registers combine both the mux and ADC into the same register). If you need more analog channels than your chip allows, it's sometimes more efficient to just defeat the internal mux (using only one Analog GPIO) and then focus on adding an external mux that can handle all of your channels.

There are 16-to-1 analog mux chips, and you can even use multiples of those in parallel with proper address decoding and Enable pin management to expand the channel count.


The caveat, of course, is that your ADC will have a maximum sample rate and, the more channels you cram in, the lower your sample rate will be for each channel. There's also the overhead of changing the mux address, but that's often the same overhead as with an embedded mux unless the designers have factored in some sort of automatic sequencing. For audio signals, you usually want a continuous stream of samples and the DMA peripheral can automate this without using any CPU instructions, but for reading pots you might want the ability to choose a random sequence order which makes it difficult to use DMA. There are some smart CPU designs out there which will automatically sequence through the channels on its internal mux. A few chips actually have 2 or 3 ADC units instead of just one. In that case, you can have more than one conversion happening at the same time without sharing signals one at a time through a mux.

Given the grounding (and shielding) issues with reading pots, sometimes it's better to just dedicate an external ADC to each pot board and use digital communications with your main board. In that case, you might just select a serial ADC with enough inputs for your pot board, but you can still add an external mux if you need more. The Texas Instruments ADS7950 through ADS7961 have four GPIO pins that you could use to run an external 16-channel mux, and this is clever because the same serial command that reads the ADC also sets the GPIO pins. The ADS79xx also have a bit mask that allows you to enable or disable channels so that the chip will automatically sequence through the active channels without your code calculating the specific command.

Brian

p.s. I'm sure you realize that changing from 6 encoders to 6 pots would require changing from digital GPIO to analog. At a minimum, you need one Analog input pin free. Depending upon various factors, you might use an on-chip mux or add one externally. And, as I mentioned above, don't rule out adding an external ADC (with optional discrete mux) because that often has many advantages for certain designs.





More information about the Synth-diy mailing list