<html><head></head><body>As long as you don't mind variable step sizes.<br>
<br>
-Dave <br><br><div class="gmail_quote">On September 21, 2017 11:02:45 AM PDT, Tom Wiltshire <tom@electricdruid.net> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Yeah, using a 4922 with one driving the other’s Vref is a good idea. That saves doing the weighting of the two DAcs at the VCO’s summing CV input. Thanks Paula. <br /><br />Tom<br /><br />==================<br /> Electric Druid<br />Synth & Stompbox DIY<br />==================<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> On 21 Sep 2017, at 11:56, paula@synth.net wrote:<br /> <br /> Tom,<br /> <br /> for 008 we used an analog devices 14bit DAC, which is beautiful, but is SMD and quite pricey (but SUPER linear and stable).<br /> <br /> If you want more bit depth/resolution, why not use two DACs and have one driving the Vref of the other?<br /> A single MCP4922 should do the trick (available in Through hole too), 12 bit, dual channel external Vref for each DAC.<br /> <br /> Paula<br /> <br /> <br /> On 2017-09-20 13:19, Tom Wiltshire wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Hi all,<br /> A little while ago I was asking about setting the lowest frequency on<br /> a V3340 oscillator, because I was struggling a bit. In the end, it<br /> seemed to be only prototype woes, and the board has been fine since.<br /> Since then, I’ve been experimenting with autotuning the VCO using a<br /> PIC (a 16F1778), and I thought some of you might be interested to hear<br /> a progress report.<br /> I have the PIC receiving a MIDI input and producing control voltages<br /> for the VCO via both channels of a MCP4822 dual 12-bit DAC. The pulse<br /> output of the VCO drives a NPN transistor to pull down one of the<br /> PIC’s input pins to act as a tuning input.<br /> Tuning the VCO isn’t too difficult, except at the very low end (I’ll<br /> come to that in a mo). I’m using the typical “successive<br /> approximation” method, which is described nicely in the Prophet T8<br /> service manual. In short, you set the highest bit of the DAC, then<br /> measure the waveform period. If the waveform period is too short, you<br /> clear the bit, and otherwise you leave it set. Then you move to the<br /> next bit down, and set that and repeat the test. When you get down to<br /> the lowest bit, you have the DAC value that gives you the nearest<br /> frequency below your required frequency. Note any errors are always on<br /> the low side because of the algorithm.<br /> There have been some quirks. One is that I’m running the PIC at 32MHz,<br /> and consequently have 32MHz or 8MHz available as 16-bit timer clock<br /> frequencies. Even with prescale settings of /2, /4, or /8, this is too<br /> fast to measure frequencies below 16Hz. I got around this by keeping<br /> track of timer overflow, which effectively gives me a 17-bit counter,<br /> which is *just* long enough for the job. To be honest, no-one will<br /> notice tuning errors way down there anyway - it’s on the border of<br /> sub-audio.<br /> Another quirk is using a cheap SPI DAC with only 12-bit resolution.<br /> There are some nice TI 16-bit DACs available in 8-pin DIP, but they<br /> cost £10/unit, unlike the one I’m using. Obviously I could go SMD, but<br /> I’m avoiding that.<br /> Twelve bits isn’t enough to produce a good CV over the full MIDI note<br /> range. 4096 / 128 notes = 32 sub-semitone steps, or about 3 cents -<br /> not audible, but borderline. So I’d thought to produce an fairly<br /> general “Octave CV” on one channel and a more detailed “Note CV” on<br /> the other, which would cover only a part of the full range - say four<br /> octaves (4096/48 = 85 steps, much better). This seems to work pretty<br /> well, as far as it goes. I can’t decide how wide to have the Note CV.<br /> Would it make sense for it to only cover a single octave? That’s the<br /> most efficient in some ways, but by making it wider, I can do larger<br /> pitch shifts without having to change the Octave CV. That makes<br /> updates quicker and also removes the risk of a glitch at the moment<br /> the octave switches. It’s “six of one and half a dozen of the other”,<br /> as we say in English.<br /> Another problem is the SPI interface. Since I have to send two bytes<br /> to program a 12-bit variable into the DAC (so four bytes for the two<br /> CVs) there is a limit to how fast the DAC can be updated. You can then<br /> reduce that theoretical maximum another chunk to allow for actual<br /> calculation time. This is a problem for something like MIDI pitch<br /> bend, where the data needs filtering (e.g. more calculation time) and<br /> also needs sending out frequently enough no steps are audible. Adding<br /> smoothing to the analog CV would be one solution, but if the steps in<br /> the Pitch Bend are heavily smoothed by analog filtering, then no rapid<br /> changes in Note CV are possible. Unless you change things around and<br /> use a separate channel for Pitch Bend CV, with the Bend CV filtered<br /> and the Note CV not - but then that’s three DAC channels for one note!<br /> Not very efficient!<br /> The advantage of that is that *only* the Pitch Bend CV has to update<br /> rapidly. The Note and Octave CVs can change only when a new note is<br /> played - much simpler.<br /> Finding the best way to do this with low-cost and easily-available<br /> chips is proving not entirely straightforward. There are a lot of<br /> possible ways to arrange things in terms of the range of the various<br /> CV channels and the distribution of different data to the CV channels,<br /> and I’m experimenting to see what gives a decent result.<br /> Hope this is of interest,<br /> Tom<br /> ==================<br /> Electric Druid<br /> Synth & Stompbox DIY<br /> ==================<br /><hr /><br /> Synth-diy mailing list<br /> Synth-diy@synth-diy.org<br /> <a href="http://synth-diy.org/mailman/listinfo/synth-diy">http://synth-diy.org/mailman/listinfo/synth-diy</a><br /></blockquote></blockquote><br /><br /><hr /><br />Synth-diy mailing list<br />Synth-diy@synth-diy.org<br /><a href="http://synth-diy.org/mailman/listinfo/synth-diy">http://synth-diy.org/mailman/listinfo/synth-diy</a><br /><br /></pre></blockquote></div></body></html>