Sunday, March 6, 2022

Sequencial Quad Sample/Hold

I've not had time to post to this blog lately; COVID stats are improving here in the Northwest US, and thus I am commuting to my day job again. 

This is good news I guess--the "health is improving" aspect, anyway? 

During the (hopefully) final few weeks of our collective two year COVID house arrest I find myself digging through my junk box of old audio IC's--trying to determine the puzzle to solve next.  

A chip that intrigues me is Curtis ElectroMusic System's CEM3394, an "all in one" synthesizer chip, used in the Sequential Multitrak, an instrument I owned and loved back in the late 90's 

I don't know what happened to the Multitrak.....I sold it? Loaned it out? Can't remember.....



I have four New Old Stock 3394's in my junk box. Can I make a single board, low parts count synth out of these IC's?  Where would I start?

Like the popular CEM3340 IC, the CEM3394 requires analog control voltages to function. It'd be nice to understand how the internal control voltages ("CV's") were implemented in early digital/analog synthesizers--and use that in a future 3394 project--since I want to stay true to the spirit of these venerable old designs.

I'd need a to pick an MCU for the project--the 3394 chips were designed to be microprocessor controlled. Some old synths used Z-80's, but will an Atmel328 work?

I started to research and came across this post. Short answer: yes, this will work!

(Aside: The post's final comment from "Grumpy Mike" makes me sad, it's the kind of fear and loathing and BS I really dislike; besides, he's wrong. Sequential CEM based gear from that era didn't use 16 or whatever DACs in a single synth, and when they worked correctly had internal CV's that didn't sag--you could hold a single chord for hours and it was solid). 

How did Sequential avoid putting several (expensive) digital to analog converters ("DACs") in every instrument? And how did they keep critical MCU controlled CV's, like oscillator V/octave, rock solid?

Turns out they used multiplexers, or MUXes (specifically for the Prophet 5, CD4051 IC's) and had a Z-80 processor refresh a DAC that in turn fed many MUX'd sample and hold capacitor + op amps circuit fragments, quickly, over and over--sequentially!

That way the SH's outputs would not droop, and very few MCU and DAC's--expensive parts at the time--I see just one of each in the Prophet 5, right?--were needed for a complete, complex micro processor controlled analog synth. 

Prophet-5--thing of beauty!

No Holds Barred

A good starting point to see how Sequential implemented their no-droop Sample and Hold's is the Prophet-5's service manual, get the PDF for that here; an excellent explanation of how the MPU > DAC > S/H mux's work is on page 29.

But!! As a curious DIWhy dude, why only read when you can also build? 

To motorize my pursuit I designed and laid out a simple quad sample and hold board, which I called, predictably, a "Sequential Quad SH". 

Coded it--built it. Hazzah! Worked first time!!!

MCU control was from a "Minimalist" Atmel328 C dev board; you can get that from my honorable sponsor PCBWay's project site, here.  

For the Digital to Analog Converter (DAC) I chose a SPI 12-bit Microchip MCP4921; download an embedded C library for it and its 10 bit cousin for AVR328 processors here

I used Eagle to lay out the PCB:

The PCB has provisions for an External DAC feeding the 4051 MUX, if you use the MCP4921 make sure to jumper the 2 "DACLINK" pins in the middle of the board; if you want to use a different DAC IC (for a CEM3394, an AD5792?), tie your external DAC's output to the right pin of DACLINK and omit the MCP4921.

The Eagle gerbers were uploaded to this blog's enthusiastic, burning-the-midnight-oil sponsor: PCBWAYPlease help support this blog and check 'em out.

Poof! That was fast, the PCB was back, so I built it....





Board, breadboard and minimal atmel 328 dev board....next, hook it all up....

Let's try some diffent caps....

Ready to test!


The board worked pretty much first time....I made a few dumb mistakes during fab--I forgot to solder on some caps (nice!) and missed the omission during initial testing, but overall, this was a win.

Code Me Up Scotty! 

Crafting the Embedded C firmware for the SeqSH was pretty easy. I used my usual toolchain: Atmel ICE and Atmel Studio 7.   I used my minimalist AVR board (here) for the brains of this proof of concept but most Arduinos with AVR processors should work with little to no modification to the code.

For the MUX, I wrote a simple CD4091 C library--get the .c and .h for that here; I can envision using shift registers to increase the Mux IC count (for more see the Sparkfun page here).

I had to experiment with timing--the Sequential manual says one should inhibit MUX operation whenever the DAC value changes, and I found that doing so got me the cleanest looking DC output on a scope.



Here's one of the 4 S-H outputs, with a 12 bit DAC value of decimal 4000:


And yes, the CV never sagged as long as the PCB and Dev board had stable DC power. I went away for coffee and came back a half hour later--spot on.   

Bust a Cap

I didn't know what type of capacitor to use for each sample and hold subcircuit; I have heard techs (passionately) discuss what is the best and most stable capacotor to hold Sample and Hold charges. 

I tried poly film, polystyrene axial, and mylar .01uF's. No significant difference was seen on my scope for any of these. 

I ended up using .01uF poly box film caps because I had a lot of them lying around.




Free Samples to Hold

If you want to play along at home, get the embedded C code, Eagle files, gerber, drawings and so on from Github (here). The project can also be found on a PCBWAY project page (here).  

Overall, this was a fun proof-of-concept to research then build. 

Once finished, the circuit provided a simple way to get a lot of horsepower out of a single inexpensive DAC. I figure with a reasonably fast MCU this idea can be expanded to accommodate 40 CV channels, maybe more; I can now see why MUXes were so critical to the Prophet-5's design as well as other classic computer controlled synthesizers: Muxes are inexpensive; DACs, not as much.

It would be pretty easy to turn this design into a Euro 4- or 8-channel "sagless" S/H Eurorack module, but I don't have time for that now, meaning right now, with my day job commute ramping back up. But in general, this MCU > DAC > MUX paradigm, I figure, will be find inclusion into upcoming audio DiWHY projects.

Hats off to Sequential for providing rock solid CVs that don't sag, in a manner that doesn't break the bank, presented in a the service manual is clearly written--even I can follow it!

So--Sample and hold well, Luke--don't breathe the "ME MUX". See ya next time! 

No comments:

Post a Comment

Son of Anything To Clock--LM311, Lower Parts Count

Readers:  If you want to build the project featured in today's post, please go to  PCBWAY's  Community pages --a gerber ready to dow...