| Author |
Message |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
Posted: Fri May 20, 2011 2:21 am Post subject:
Linear CMOS Subject description: analog from digital |
 |
|
I'd like to open a thread about linear CMOS, which is the technique of making digital chips behave in an analog way. The topic is well known, so perhaps someone might want to contribute some documents or links on the topic. Myself, I'd rather experiment and create in most cases. Anyway, I'll be doing some prototyping and reporting my results here. As always your input is welcomed and appreciated!
Les _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
Posted: Sat May 21, 2011 12:51 am Post subject:
|
 |
|
Last night I made no progress, however tonight I got back to basics and learned some things.
The first thing is really obvious but it should be stated for your awareness, which is that you only want to use inverting gates with Linear CMOS. Non-inverting gates have positive feedback which acts like hysteresis in comparator circuits.
The next thing I learned is that Linear CMOS works at DC but you need to compensate it. At some values (many really) the gate will oscillate, so what I did was put a cap to ground on the input node of the gate. I used 0.1uF caps and they worked just fine. The result was that the output was an inverted version of the input, with an artificial ground built-in at Vdd/2 approximately.
I tested a NAND gate with both inputs tied together (forming an inverter) first with a gain of one and it properly inverted the signal. Then I tested a NAND gate without connecting the two inputs, which is pretty cool IMHO. You just use two feedback resistors, two input resistors, and two compensation capacitors - should be easy to visualize so I won't draw it out. This made a nifty sort of summing amp with unusual characteristics.
Those characteristics are that if one input is held near ground and the other input is swept, you get a full range of output (and vice versa due to symmetry). However if you sweep both inputs together you do not get a gain of two, the gain is still one.
To properly characterize that I'd have to plot about 100 data points or so, and I don't feel like doing that especially without a voltmeter (mine broke, I'm working with a scope only). Then the data plot would be either a family of curves or a 3D plot or both. Maybe I'll get around to doing that sometime.
Oh yes, I should also mention that even with compensation, the output tends to oscillate when both inputs are near Vdd/2. I'm not sure what can be done about that.
So in summary, Linear CMOS NAND gates work in both single and double (and most likely more) input configurations, just hook them up properly and compensate them to make them work well. More to follow later, enjoy!
Les _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Psyingo

Joined: Jun 11, 2009 Posts: 242 Location: Canada
|
Posted: Sat May 21, 2011 8:47 am Post subject:
|
 |
|
in my fiddling i have found that 4011 nands and 4001 nors do oscillate quite a bit, but 4049 and 4069 do not oscillate nearly as much. you can also put a cap in the feedback path to minimize oscillations.
i have had some trouble doing CV stuff that didnt have the bias voltage... I believe its possible, cus i've seen envelope followers and stuff be made, which go from zero to whatever +V using inverters. ill have to do more fiddling in that regard. |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
Posted: Sat May 21, 2011 4:18 pm Post subject:
|
 |
|
Do the other parts without the oscillation have hysteresis? that would explain it. Of course, you might either want or not want that oscillation in a music circuit, depending on that you are trying to create.
Les _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
Posted: Sun May 22, 2011 12:17 am Post subject:
|
 |
|
Well it's 3am and i don't feel like prototyping any more tonight so I'll update you on my progress. I made four linear CMOS gates which I hooked into a self-oscillating structure that didn't work at all. When I fail, i fail spectacularly or not at all, haha. Then tonight i made some good progress.
I built a pair of oscillators, one ten times slower than the other one, out of NAND gates. The each have a kill switch and the NAND gates have a feedback resistor so they will oscillate properly even with no Schmidt trigger on them. Got lucky there. They sound squareish and look it on the scope, though rather distorted looking.
I saved the four linear CMOS gates when I ripped out their interconnect so now I can hook them up to the oscillators for really weird sounds. I put capacitors in the feedback path of the linear gates to act as a single pole low-pass filter, with different capacitor values on the different inputs. The gain of the gates is two.
JovianPyx in chat pointed out that the gate transfer functions should be sigmoidal, which I feel is correct. In fact, you can visualize the transfer functions. They are plateaus with smooth sigmoidal transitions between them. This represents a two-dimentional distortion function so the sound should have some of the audio qualities of guitar distortion pedals. cool, huh?
Well that's all for now.
Les _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 17337 Location: Allentown, PA
Audio files: 107
G2 patch files: 60
|
Posted: Sun May 22, 2011 3:01 pm Post subject:
|
 |
|
Great topic, lets see some schematics, please.
Trying to make "good" circuits is going to be very difficult, but making fun ones should be, well, fun.  _________________ --Howard
my music and other stuff |
|
|
Back to top
|
|
 |
slacker
Joined: Nov 18, 2007 Posts: 301 Location: England
Audio files: 11
G2 patch files: 1
|
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1079 Location: West Red Spot, Jupiter
Audio files: 123
|
Posted: Wed May 25, 2011 8:30 am Post subject:
|
 |
|
One of my favorite subjects... Two parts mentioned in previous posts are the 4069 (or 4069UB) and 4049. Both ICs are hex inverters.
The 4049 was designed as a way to drive TTL from CMOS. As such, it has different transistors in it's output "totem pole" such that it can sink much more current than it sources. There is also an unbuffered version of the 4049 (4049UB), but it also has the same asymmetrical output transistor configuration. When used in a linear circuit, this will cause the distortion to be different for the negative and positive half cycles of waveforms. That can be good or bad depending on exactly what you want.
The 4069UB is different in that it has symmetrical output transistors such that sink and source current is the same.
Note that both 4069UB and 4049UB will distort an input signal when used as a linear amplifier because the gain of the little two transistor amplifier is not consistent with respect to the input voltage. When the input voltage is (Vdd-Vss)/2, the gain is highest. As the input voltage moves away from this point, the gain reduces. This sigmoid gain transfer function causes some distortion that is similar to the way vacuum tubes distort. I've personally used this distortion to make a triangle to "sine" converter. I put sine in quotes because it's not a precise sine, but to my ears, it's very close.
While standard CMOS 4xxx series parts are spec'd at 15 volts power supply, most are also spec'd at 18 volts absolute maximum. (see the datasheet for the part per manufacturer to make sure). You can use 4xxx parts with a dual supply, but be careful, for example, if you try to power from +15 and -15, the IC will very likely release the magic smoke. I mention dual supply because most modular synths have them and it's convenient when you're trying to make a linear CMOS amplifier emulate an opamp - you don't need to make a virtual ground with dual supply, but as I mentioned, the maximum ratings should be followed if you expect reliability. Because of the supply voltage limitation, if you want to use a dual supply it's best to make a separate one for the CMOS stuff. +6 and -6 is easy enough and one can mess with diodes to push those a bit higher (assuming fixed voltage regulators). I've had very good results with +5 and -5. Because many mfrs spec absolute maximum at 18 volts, you can try +9 and -9, but at your own risk.
Note also that CMOS that is run in linear amplifier mode tends to draw a bit of current, more than an opamp. The CMOS gate will draw the most current when the input voltage is at (Vdd-Vss)/2 which is often when the system is at rest. Because of this, CMOS linear amps can run warm or even hot. Others have suggested to me that it's wise not to use more than 3 of the 6 gates in a package as linear amplifiers to keep the IC from heating up too much.
Last but not least, I'd like to mention the 4007. It's internal structure is somewhat like the 4069UB in that it's transistors are symmetrical and sink as much current as they source. This is one of my favorite ICs because it is really a kind of CMOS transistor array. It can become 3 linear amplifiers or some of the transistors can be used as single NMOS or single PMOS transistors. Lots of interesting things can be done with these and there are some ideas in some of the datasheets. I've not seen linear amplification mentioned in the datasheets, but I know it works because I've used them that way.
Also, take note of the part numbers of 4049 and 4069. I believe that 4069 is the same as 4069UB. The UB means "unbuffered". 4049 however has two versions, one is buffered, the other, 4049UB is unbuffered. The unbuffered gates are just two MOS transistors in a totem pole with the gates connected together to form the input. Output is taken from the connection between the two MOS transistors. The difference is the presence of extra buffer transistors which drastically increase the gain. The buffered 4049 has 6 transistors per inverter gate, basically, it is 3 inverter stages cascaded. It is my opinion that the UB or unbuffered parts make better linear action than the buffered parts - but your milage may vary. _________________ FPGA Synth Stuff
FatMan Mods
dsPIC Synth Stuff I am formerly known as ScottG here Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?
|
|
|
Back to top
|
|
 |
Top Top
Joined: Feb 02, 2010 Posts: 182 Location: California
|
Posted: Fri May 27, 2011 1:35 pm Post subject:
|
 |
|
I've been looking at this a little bit over the last couple days. I can't understand how the 4066 is working as the cuttoff control for the filter. There is an HF oscillator on the switch control? How does that work?
I'd also like to see some of the circuits you mention in schematic form inventor. NAND gate in linear mode is interesting to me. _________________ ∆ A. MAGIC PULSEWAVE ELECTRONICS ∆ A MAGIC WHISTLE ∆ |
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1079 Location: West Red Spot, Jupiter
Audio files: 123
|
Posted: Fri May 27, 2011 1:51 pm Post subject:
|
 |
|
I'll take a stab - looking at the MXR env filt schematic, gate A1D (which is NOT running in linear mode, so will have an output of either logic high or logic low) drives the 4066 control inputs.. It appears to be fed by the sum of the output of two circuits, the line of gates below the filter (the envelope generator) and a little "ring" of gates below that. That ring of gates looks to me like an oscillator, probably pseudo sine or triangle. This would mean that at least for part of the time, the gate A1D outputs a rectangular wave with duty cycle controlled by the envelope generator - this is then fed to the control inputs of the 4066 gates controlling the filter. The on-off-on-off action will control the cutoff because the effective input resistance to each of the integrators varies with the duty cycle of the rectangular wave created by the little oscillator. The input resistance regulates the charging current into the integrating capacitor, thus the cutoff frequency is controlled by the duty cycle applied to the 4066 control inputs. I didn't calculate the oscillator frequency, but I'll bet it's above human hearing, so it won't be audible. It looks to me like the envelope changes the switching threshold of gate A1D and that is what changes the duty cycle the gate A1D sees.
This technique of controlling a filter is known as "switched capacitor".
Note that this analysis was done without owning one, without having heard one and without being able to probe the circuit with an oscilloscope. If this is wrong - someone please correct... _________________ FPGA Synth Stuff
FatMan Mods
dsPIC Synth Stuff I am formerly known as ScottG here Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?
|
|
|
Back to top
|
|
 |
richardc64

Joined: Jun 01, 2006 Posts: 577 Location: NYC
Audio files: 25
|
Posted: Fri May 27, 2011 3:20 pm Post subject:
|
 |
|
| JovianPyx wrote: | | That ring of gates looks to me like an oscillator, probably pseudo sine or triangle. |
Flip it vertically AND horizontally and it's your 4069 LFO with slight changes, at a higher frequency.
| Quote: | | Note that this analysis was done without owning one, without having heard one and without being able to probe the circuit with an oscilloscope. If this is wrong - someone please correct... |
It all seems plausible to me. Rube Goldberg would be proud. _________________ "It's quite OK to make music with tea spoons and rubber bands!" -- Blue Hell |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
Posted: Fri May 27, 2011 3:38 pm Post subject:
|
 |
|
I'd like to take a moment to thank each of you for your contributions to this thread, it has generated more interest than I imagined and more tech than I can understand without extensive study. Also thanks to all our lurkers for reading our aimless jaberwocky. Some thoughts about linear CMOS:
You can make artificial intelligence with it! I realized this while rethinking JovianPyx's description of the NAND and NOR transfer functions. They are basically shaped into four quadrants, each with a logic value of 0 or 1 and a sigmoidal transition between these regions. Imagine a 3D plot with four plateaus and smooth hilly terrain between.
Well, those transfer functions are basically just fuzzy logic control surfaces. This topic is also well known as a google search produced entire books on the subject!
Going in another direction, we have a sigmoidal transfer function which spells neural net to me. With multiple inputs and a sigmoidal decider, we have a neuron.
Also, since there is a request for a schematic of the NAND amplifier, I'll go run off and draw one up right now. Be back soon.
Les _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
Posted: Fri May 27, 2011 4:10 pm Post subject:
|
 |
|
I am going to provide you with some excitement and a little bit of very cool, very fun circuit imaginations / imagineering by saying just one word in the context of this thread: piggyback!
Les _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 17337 Location: Allentown, PA
Audio files: 107
G2 patch files: 60
|
Posted: Fri May 27, 2011 4:23 pm Post subject:
A word of caution |
 |
|
A word of caution from a veteran IC designer. CMOS logic is standardized only in function, and to some degree in the specs. But CMOS logic does not have linear specs. The fact that they can be used in linear mode is a fortunate accident, so to speak.
It is possible that a given CMOS logic chip will not even have the same internal circuit as one from another company with the same number, for example, 4011B. There are many ways to skin a cat. Also, the circuit diagrams of the internal circuits of ICs that sometimes appear on application notes or spec sheets are not guaranteed to be accurate. They are often simplified for illustrative purposes.
Thus, if you analyze the linear characteristics of one part, it may not correspond to one from another company, or even from the same company. This is especially true if you use the device in the linear mode for which there are no specs, of factory test programs.
Just keep this in mind when you experiment. It could get frustrating when you have a neat circuit that works just the way you want, but it won't work when you swap out a device. Thus, I suggest keep your circuits simple. If you want to design linear (analog) circuits, it might be best to use parts intended for that purpose.
PS: This is also true of linear ICs. Most reputable equipment manufacturers will independently test incoming parts to be sure they meet their criteria for use, before they install them on their boards. _________________ --Howard
my music and other stuff |
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1079 Location: West Red Spot, Jupiter
Audio files: 123
|
Posted: Fri May 27, 2011 4:53 pm Post subject:
|
 |
|
Wow, I didn't know you designed ICs mosc! awesome!
I can echo a tiny bit of what you expressed - a friend of mine, Rene Schmitz, had designed a nice sawtooth oscillator using 3 gates of a 4069UB. He posted his schematic, so I tried to build the circuit, but it went all crazy with weird "oscillations" (hash) in the waveform that was horribly wrong. Emails back and forth revealed that I was using the exact same manufacturer, but I was using different gates within the device than Rene did for different bits of that oscillator. When I got is pin-mapping and made mine identical to his, it worked correctly. Apparently, he had gotten lucky enough to stumble upon the pin connections that worked properly, but didn't include the pin numbers on his schematic.
So as an addendum to what mosc just wrote, it might be nice that if we make linear circuits with CMOS, we should probably document the manufacturer of the chips we use and the pins that are used for each function so that others trying to replicate these circuits have a better chance of success. _________________ FPGA Synth Stuff
FatMan Mods
dsPIC Synth Stuff I am formerly known as ScottG here Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?
|
|
|
Back to top
|
|
 |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 17337 Location: Allentown, PA
Audio files: 107
G2 patch files: 60
|
Posted: Fri May 27, 2011 5:06 pm Post subject:
|
 |
|
Good comment. I can appreciate your frustration. That's why I posted this heads up. If you have a tricky logic circuit, sometimes you can run into similar problems.
When you start designing very fancy analog circuits, the capacitors can be a problem too. 20 pf is an approximation, you know. Rob Hordijk has some fascinating horror stories about capacitors. He has a special cache of caps that are made for medical electronics he uses.
Yes, I designed everything from CMOS Op Amps for very low voltage applications to 32 bit floating point DSPs. At one time I was the expert on CMOS op amps with very good power supply rejection ratios. Not anymore. The DSP work was as part of a huge team. I was also involved in a lot of early experimental HDTV circuits. I'm retired from that now. electro-music.com is more fun...
 _________________ --Howard
my music and other stuff |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
|
|
Back to top
|
|
 |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 17337 Location: Allentown, PA
Audio files: 107
G2 patch files: 60
|
Posted: Sat May 28, 2011 8:48 pm Post subject:
|
 |
|
Very cool, Les. Thanks for sharing. Food for thought, for sure. _________________ --Howard
my music and other stuff |
|
|
Back to top
|
|
 |
ezekiel
Joined: Oct 17, 2009 Posts: 29 Location: Columbus Ohio
|
Posted: Mon May 30, 2011 9:46 am Post subject:
|
 |
|
While awaiting my Goldmine bag o' chips, I have been experimenting with and trying to understand the linear CMOS and FET world. As usual, I learn a little and make a few mistakes and end up with something interesting.
Here is a schematic of something not entirely unlike a VCA. I drew it as an inverter, but it seems to work with all the boolean 4000-series logic chips I have. More inputs and other gates on the chip lead to more unpredictable fun.
Feed in an analog audio signal and a slow triangle LFO CV and you see the audio signal fade up and fade down, albeit usually with a some distortion of the analog input signal. Strangely, in different situations I saw different kinds of results making Audio Output 1 better sometimes and Audio Output 2 better other times. But Audio Output 2 tended to be more square off--but not always.
I guess the FET transistors inside the chip vary between pulling down (and squelching) the audio and passing it as-is, controlled by the logic input pin.
With unpredictabilities of linear CMOS, I should mention I fed this the output from standard 40106/4093 oscillators, from PICs, and from buffered LM324 pseudo-triangle LFOs. I outputted into a voltage divider, then through a capacitor, into my mixer.
In contrast: The YAVCO VCO uses a CV input to the power pin on an oscillator and the result is a change in frequency, thus it is FM. The Hex VCA on the 4049UB uses inputs on each side of an inverter and gets its output through Vcc and GND connected together.
Please comment with other similar circuits and other variations on these ideas.
| Description: |
|
| Filesize: |
19.58 KB |
| Viewed: |
7143 Time(s) |

|
|
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1079 Location: West Red Spot, Jupiter
Audio files: 123
|
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1079 Location: West Red Spot, Jupiter
Audio files: 123
|
Posted: Wed Jun 01, 2011 10:38 am Post subject:
|
 |
|
A note about this kind of VCA - it will distort. That may not be bad, but it should be understood. The reason is that the gain of the little 2 transistor amps is not constant. Gain is highest when the input is (Vdd-Vss)/2 and reduces as the input gets higher or lower than that. Noting that the input is a variable voltage applied as Vdd, the distortion will change as the signal changes. It won't matter much if the input is a rectangular waveform and the output may sound just like the input in that case. If the input is some other waveform, it will definately be distorted.
Again - distortion may be what you want! _________________ FPGA Synth Stuff
FatMan Mods
dsPIC Synth Stuff I am formerly known as ScottG here Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?
|
|
|
Back to top
|
|
 |
deadbeat
Joined: Feb 21, 2010 Posts: 127 Location: france
|
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 5948 Location: San Antonio, Tx, USA
Audio files: 256
|
Posted: Mon Jun 06, 2011 3:38 pm Post subject:
|
 |
|
| deadbeat wrote: | thanks for this awesome thread... i don't have the knowledge you hzve guys, but it gives me many good ideas for working at home !!
thanks !! |
Hey deadbeat, reading such a comment makes all the effort worthwile. rock on!
Les _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
|