Basic 166 KHz square wave oscillator - Page 1
Forum section: electronics / projects

author: MauroAntivero
author_rank: Newbie
timestamp: October 06, 2015, 11:39:57 pm
content: Hello to all again. This time I'm facing the following problem:I'm trying to make a simple square wave oscillator, preferably using CMOS gates. I need a 166 KHz stable (but not "super duper mega stable") square wave signal, preferably from 0 to 15V, but 0 to 5V would be fine.I tested with a basic CD4011 (nand gate based oscillator) and with a basic SN74HC14 (inverter Schmitt trigger based oscillator) but the results are far from acceptable, I have a lot of jitter in the frequency in both cases. I attach four files:SN74HC14 Oscillator - Basic Schmitt trigger based oscillator (the circuit from the video capture below)CD4011 Oscillator - Basic NAND gate based oscillatorSN74HC14 Oscillator Video Cap 1/6 - Captures from a video of my oscilloscope screen where you can see the jitterI suspect that the breadboard is not the problem because I'm working only at 166 KHz, but I really don't have idea what is happening. Searching in Internet found a lot of circuits but all of these are the same basic circuit and in any of these sites mention something about "jitter" or "frequency instability".I am a bit disappointed with myself for not being able to function properly such a simple circuit, but always in electronics, things are more complicated than they seem at first glance. So, I really appreciate your help to solve this issue. Thanks a lot and best regards!Mauro.

author: tautech
author_rank: Super Contributor
timestamp: October 06, 2015, 11:46:00 pm
content: Quote from: MauroAntivero on October 06, 2015, 11:39:57 pmDead bug the circuit for proof.

author: rfeecs
author_rank: Frequent Contributor
timestamp: October 07, 2015, 12:51:01 am
content: How clean is your power supply? Any ripple or noise?Is there any improvement if you just power it with a battery (which should be free of ripple and noise)?An alternative would be using a high Q resonator like a crystal.

author: singapol
author_rank: Frequent Contributor
timestamp: October 07, 2015, 01:34:45 am
content: The answer is notallof the inputs of 4011 (3/4) and 74HC14 (1/6) are used sounused inputsmust be terminated properly due to their high input impedance and therefore should not be left floating or unconnected causing unexpected outputs. Whether to connect to ground or power supply or even to other inputs depend on the type of cmos logic. A proper explanation can be found in this pdf:Designing with logic. See page 6.http://www.ti.com/lit/an/sdya009c/sdya009c.pdf

author: w2aew
author_rank: Super Contributor
timestamp: October 07, 2015, 02:19:35 am
content: Most common problems:- lack of power supply decoupling caps- not tying unused inputs somewhere- excessive lead lengths and poor supply filtering on breadboardNote that 74HCxx outputs are pretty fast - a few ns or less - so that puts a lot of high frequency energy in your signals, supplies, etc. which can cause all sorts of problems like this unless you proper decouple/filter the supplies, keep leads short, etc.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: October 07, 2015, 02:26:04 am
content: All of the above.1. Ditch the breadboard and assemble the circuit with short leads and soldered connections ("dead bug").2. Tie unused inputs of the chip's gates to Ground or Positive rail as appropriate.3. Use a stable, voltage regulated power supply.and also don't forget4. Install decoupling capacitor between the Vcc and ground pins of the chip, as close to the chip as possible.You could also try using the VCO that is built into the CD4046 PLL chip, with the appropriate timing R and C, instead of the 4011 or 7414. But hardwire and decouple as before.

author: dan3460
author_rank: Frequent Contributor
timestamp: October 07, 2015, 05:00:04 pm
content: I had similar problem (see NOT gate functionality), I was not able to get the appropriate signal. It seems to me that you are getting the correct signal. Listen to this guys, the jitter is probably picked up but lengthy cables and breadboard setup.

author: mij59
author_rank: Frequent Contributor
timestamp: October 07, 2015, 05:35:50 pm
content: What are the values of the resistors and capacitor in the CD4011 oscillator ?The 10k resistor to the input of the 74HC11 oscillator is not needed.

author: MauroAntivero
author_rank: Newbie
timestamp: October 08, 2015, 05:09:45 am
content: First of all thanks a lot to all of you!1_ Yes, I was about to do, but first wanted to achieve the best possible stability in the breadboard (really it worked very badly and could not be solely due to the breadboard, it had to be something else... And then...)2_ And that was my key problem!!! When I do that (all unused inputs to GND) the oscillation becomes pretty stable, even in the breadboard with relatively long cables! Thanks to all again for this suggestion.3 & 4_ Yes, I'm always do that, but off course thank for this suggestion4046: Yes yes, I'm very interested in that option. I need to look the 4046 datasheet to realize how to do it, but if you have a simple schematic I really appreciate it.Quote from: alsetalokin4017 on October 07, 2015, 02:26:04 am