[sdiy] Control voltages for digital modules

rsdio at audiobanshee.com rsdio at audiobanshee.com
Fri Jul 14 12:52:08 CEST 2017


On Jul 14, 2017, at 3:11 AM, Elaine Klopke <functionofform at gmail.com> wrote:
> Here's the problem: how do I get a pitch CV from a sequencer or other module converted to the 0-5 volt input necessary for the microcontroller ADC.
There are many options, but I would recommend an external ADC that handles 0-to-5V analog inputs. This is probably going to be a serial ADC, but there might be some good parallel options. Using an external chip allows you to isolate the conversion from the excessive digital noise inside a processor (although it's terribly tempting to use the internal ADC just because it's there). For pitch CV, I wouldn't take the chance because noise performance and precision will be important.

For 1V/octave pitch CV over 5V, this gets you 5 octaves. You then just need to protect against out-of-range voltages. Some ADC chips have clamping diodes built in, so that all you need is a series resistor to limit the current. Be wary, though, because successive approximation ADC work very poorly with series resistance on their input - you'll want a good op-amp buffer ahead of those kinds of ADC. With a buffer stage, you can just clamp the input so that the output is limited to 0-to-5V. A rail-to-rail op-amp running at 5V is tempting, but it probably won't have enough headroom to reach all the way to the extremes. I would recommend voltage followers for the op-amp stage, because if you try to use gain at all then you'll be stuck buying precision resistors and calibrating the thing.

Look for an ADC with a built-in reference that is accurate. Some of them are accurate enough to make a Voltage meter, which is perfect for 1V/octave pitch CV.

If your processor only handles 3.3V GPIO, then you'll need an ADC that allows a different supply voltage for the analog reference versus the digital I/O. There are quite a few ADC chips that are like this, but double-check the data sheet (I've been burned after many chips that worked well, only to find that other chips didn't have quite all the features I was used to). Note that you could pick a processor that runs on 5V, and then you wouldn't have to worry about the analog and digital supplies being different. The PIC is popular for 5V, but it's not the fanciest processor in the neighborhood.


> And what sort of DAC should be used to make proper CVs out of the digital signals?
Whatever you do, don't try using an audio rate DAC that runs at 24 bits. Those DAC chips only handle a stream of contiguous samples, have digital filtering, introduce latency, and are not appropriate for S/H multiplexing.

This means you're limited to 8-bit to 16-bit, maybe as much as 20-bit. There are a number of parallel interface DAC chips, but you might find serial easier to design circuitry for.

CV usually updates fairly slowly, so in some sense it doesn't really matter what the technology is. But if you want to run the CV outputs via DMA, then you might want to check that the DAC commands can be driven via DMA. Some DAC chips have no commands at all, just the sample value and at least one strobe pin to start the conversion. Other DAC chips have fancy commands that are basically like programming registers in a peripheral to change various settings (like signed versus unsigned, or other converter business).

As with the ADC, you'll have to think about analog and digital supplies unless you design around a main processor that also runs on 5V.

I've worked with incredibly fast DAC chips that can handle 150 MHz sample rates (yes, that's MHz, not kHz) at 14-bit, but these are often current output DAC designs instead of voltage output. That just means you'll need a current to voltage stage on the output. You can also combine an analog mux and sample-and-hold stages to get as many CV outputs as you want, although that can make DMA tricky.


Considering both ADC and DAC, you'll want to select a main processor that has at least two fancy serial ports. These are probably going to be SPI serial with clock, data, and chip select pins on each one. You could potentially share a single SPI across both external chips, but that might slow your sample rate. Another thing to consider is the word length of the ADC/DAC commands versus the word length of the SPI peripheral. Most small processors only handle 8-bit SPI, and you need to trick them into sending a 16-bit or 24-bit command without toggling the chip select - this can be challenging if you want DMA to operate the SPI without CPU interaction. High end processors like DSP chips will actually be able to handle 24-bit and 32-bit words on the SPI, making it much easier to communicate with the converter chips.


Sorry if this seems like an excessively long response with no specific part numbers. I find that everything I design ends up working best with a totally different ADC and/or DAC than I've used before. There are so many to choose from, and Mouser makes it almost fun to dial in the search parameters until you start to see what's available that fits your needs.

As for brands, I like Texas Instruments, Analog Devices, MAXIM, and even Microchip.

Brian Willoughby
Sound Consulting





More information about the Synth-diy mailing list