Simple CMOS Sq Wave Osc?? (OT?)

Started by Jaicen_solo, May 27, 2006, 03:46:44 PM

Previous topic - Next topic

Jaicen_solo

Hey guys,
i'm working on a bit of a circuit bending project tonight and I need a bit of assistance. I'm looking for a super simple square wave oscillator in the range of 20-40kHz or thereabouts. I'd normally just reach for a 555, but since I don't have any I was hoping someone could come up with a schem that uses a 40106 Schmitt or something, since I have a few of those about. I've tried the simple astable multivibrator designs, but I can't get them to oscillate, let alone get near 20kHz. Can anyone point me in the right direction? If not it's no big deal i'll just pick up a couple of 555's tomorrow. That said, I like the idea of having a number of oscillators on one chip.
Any ideas guys??

R.G.

Easy as pie.

Put a capacitor to ground from the input of your inverting schmitt trigger gate. 40106 works fine.

Then put a resistor from output of the gate to the input.

At startup, the capacitor holds the input low as the power supply rises, so the output is high. The high output ramps the cap up at tau=1/R*C. When the cap voltage gets up to 2/3 Vcc, the gate sees a high on the input and flips its output low. The low output now ramps the cap down by tau=1/R*C until the cap reaches the lower threshold.

An approximate square wave issues from the output, at a frequency of about 1/RC. Gate thresholds, tolerances, etc. mean that it will always need some adjustment, but it will oscillate!

All inverting schmitt triggers will do this.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Jaicen_solo

R.G, as always you are correct!
In this case it was simply me being an utter moron. The oscillator I was working on was exactly how you'd explained, unfortunately this didn't take into account my own stupidity! I was just working with the wrong pinout. As soon as I shifted everything one pin to the right it was all fine.
But since you're here, is there any value in using a second inverter to buffer the signal to give a true square wave output? It seems to work fine as it is and i'd like to keep to just one IC for the sake of space.

R.G.

QuoteI was just working with the wrong pinout.
You're not the only one ever to get pinouts wrong. How come do you think I rant about it here? It's from pure, sad experience.

Quoteis there any value in using a second inverter to buffer the signal to give a true square wave output?
Depends entirely on what you're driving with it.

First, it is ... almost... a square wave, typically between 45% and 55%. The unloaded squareness depends on the symmetry of the schmitt trigger thresholds. They are usually 1/3 and 2/3 of Vcc, but that does vary some. Note that other schmitt gates, notably the 4584, does not have the same thresholds as the 40106.

If the basic wave is square enough, then yes, buffering it from loading can help if the loading is such that it affects the pull up or down of the gate. For many loads it won't matter. I'd have to look at the datasheet to see but I suspect that loads over 10K will not cause problems. Heavier loads, like 1K to ground or less, might. In that case, buffering the output that creates the feedback will help with squareness. 

If the basic squareness is not good enough, and you want true, real, no-fooling, high precision 50% duty cycle, there is only one good answer - use a flip flop to divide the output by by two.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Jaicen_solo

I guess a little experience goes a long way ;)

From the tests i've been doing, it seems that the square wave output from one inverter is sufficient to drive the digital gate array it's connected to, and I suspect it's internally buffered anyway. It's certainly square enough to allow it to clock a PCM ROM, although I don't necessarily want it to be 100% stable! Basically, this chip does everything I need so i'm pretty happy (can you tell?  ::) ).