IC advice to create a regolable oscillator from 0 to 500kHz - Page 1
Forum section: electronics / projects

author: Yaroooo
author_rank: Regular Contributor
timestamp: March 29, 2019, 11:17:42 am
content: Hello,I'm looking to create a circuit that allow me a square clock generator that is regolable. I've found 555, but max. clock is 100kHz, AD654 but seems not suitable.What I'm looking for is 2 selectable Potenziometers that allow 1 clock output regulation. First, if selected, an output from 0-100Hz and another that goes from 10kHz to 500kHz.Best regards!

author: Zero999
author_rank: Super Contributor
timestamp: March 29, 2019, 12:17:24 pm
content: The ordinary 555 can go up to 500kHz, the ICM7555 1MHz and the TLC555 2MHz.https://www.st.com/resource/en/datasheet/cd00000479.pdfhttps://www.renesas.com/eu/en/www/doc/datasheet/icm7555-56.pdfhttp://www.ti.com/lit/ds/symlink/tlc555.pdfLogic gates such as the 74HC14 can work at even higher frequencies, but are less accurate.What are your tolerance/accuracy requirements?

author: Yaroooo
author_rank: Regular Contributor
timestamp: March 29, 2019, 02:06:05 pm
content: I'd like to generate a 50% duty cycle, any particular tolerance or accuracy. It's just for debug propuses so, if it's not a perfect 50% duty or frequency is not stable, it's not a problem.That's why I'm looking for a simple solution. I've seen NE555 from ST have a good documentation.To be able to generate a 500kHz as example, I should look at4.5 50% duty cycle oscillator, where is written:t1 = 0.693*RA*Cf=1/(t1*2)I calculate t1 = 0.693*180ohm*0.01uF = 1.25uS than a freq. of 400kHz?Seems strange to me since small resistors. Can you kindly check if my logic is correct?

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 29, 2019, 03:38:32 pm
content: One simple option to get an accurate 50% duty cycle is to put a D-type flip flop (such as the 74HC74) after the oscillator to divide the output frequency by 2, which would give you a 50% duty cycle with no effort. As said above, you can find 555's that can work up to 2MHz, so getting 500kHz would be no problem, or build an oscillator around a Schmitt trigger inverter.The tricky part will be the wide frequency range you're targetting. Doing that with just one simple RC oscillator will be challenging. If you want your oscillator to be able to switch seemlessly between the two ranges it may not be that simple. Now if you can accept glitches during the switching, that's just a matter of using a switch and switching between two capacitors for instance.

author: Zero999
author_rank: Super Contributor
timestamp: March 29, 2019, 04:43:49 pm
content: Quote from: Yaroooo on March 29, 2019, 02:06:05 pmTry reducing C by a factor of 10.That circuit will not give a stable duty cycle, if a variable resistor is used, because the duty cycle is dependant on the ratio of two resistors.Quote from: SiliconWizard on March 29, 2019, 03:38:32 pmIf you're going to do that, you might as well use one half of the 74HC74 as an astable. Here's a circuit I whipped up in another thread. Change the resistor and capacitor values to alter the frequency.https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2155480/#msg2155480

author: coppercone2
author_rank: Super Contributor
timestamp: March 29, 2019, 05:00:57 pm
content: what is regolable? i never heard that term

author: Marco
author_rank: Super Contributor
timestamp: March 29, 2019, 05:44:11 pm
content: A synonym for adjustated.

author: soldar
author_rank: Super Contributor
timestamp: March 29, 2019, 07:52:45 pm
content: I knew a guy who adjustated synonyms for a living.

author: Zero999
author_rank: Super Contributor
timestamp: March 29, 2019, 08:15:53 pm
content: Quote from: coppercone2 on March 29, 2019, 05:00:57 pmQuote from: Marco on March 29, 2019, 05:44:11 pmThere's no such word in English. I did try Googling it, but guessed the OP meant adjustable by their context.

author: ogden
author_rank: Super Contributor
timestamp: March 29, 2019, 08:37:55 pm
content: Seriously? Only two guys who did not get English typos are from US and UKBack to the subject.. There are many programmable clock IC's around, such as CDCE913, Si5351 and more.  Not to mention nearly every microcontroller with and without timer.https://www.adafruit.com/product/2045

author: coromonadalix
author_rank: Super Contributor
timestamp: March 29, 2019, 09:35:49 pm
content: does this could help ?https://www.ebay.com/itm/1KHz-to-33MHz-Adjustable-Oscillator-Module-LTC1799/400292172818

author: David Hess
author_rank: Super Contributor
timestamp: March 29, 2019, 11:10:37 pm
content: Voltage-to-frequency converters commonly cover that range easily and with the addition of an output flip-flop, will produce a square wave.

author: Yaroooo
author_rank: Regular Contributor
timestamp: April 01, 2019, 07:55:49 am
content: Quote from: Zero999 on March 29, 2019, 04:43:49 pmI don't really need a 50% duty cycle, as I said it's just for test purposes, so will never feed something that require particular clock parameters.About 555, so, if I place small Res like 150 and 1.5k, with a 0.001uF , this will be a good choice of resistors and capacitor for this IC? I'll able to generate about 400kHz.Than I'll regulate my frequency with a POT in series to 1.5k. Theoretically, since R1 is very small (150 R), I'll able to get between 50.5% and 53% duty cycle.I'm right with this assumptions?I'd liked your version with D-FF, I've tried to simulate it but I've got some problems.https://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.000005+14.235633750745258+74+5+43%0Ac+80+112+128+112+0+3.3000000000000004e-8+-2.508638357675748%0Ac+80+176+128+176+0+0.000001+-2.5001005324319188%0Ac+80+368+128+368+0+0.0000010000000000000002+-2.4956407383303683%0A155+240+208+304+208+6+5%0A155+400+176+464+176+6+5%0Aw+496+240+512+240+0%0Aw+512+240+512+256+0%0Aw+400+240+384+240+0%0Aw+384+240+384+256+0%0Ag+512+256+512+272+0%0Ag+384+256+384+272+0%0Aw+400+176+384+176+0%0Aw+496+208+512+208+0%0Aw+512+208+512+144+0%0Aw+512+144+384+144+0%0Aw+384+144+384+176+0%0Aw+496+176+528+176+0%0AO+528+176+544+176+0%0Aw+400+208+336+208+0%0Aw+240+240+208+240+0%0Aw+240+208+208+208+0%0Aw+208+208+208+240+0%0Aw+208+240+208+256+0%0Ag+208+256+208+272+0%0Ar+176+112+256+112+0+22000%0Ar+352+368+416+368+0+470%0As+128+336+128+272+0+0+false%0A174+272+368+320+368+0+1000+0.1733+Resistance%0Ag+64+400+64+416+0%0Aw+80+112+80+176+0%0Aw+80+176+80+368+0%0Aw+80+368+64+368+0%0Aw+64+368+64+384+0%0Aw+64+384+64+400+0%0Aw+128+368+128+336+0%0Aw+128+208+128+176+0%0Aw+128+112+160+112+0%0Aw+160+112+160+320+0%0Aw+160+320+336+320+0%0Aw+336+272+336+320+0%0Aw+160+112+176+112+0%0Aw+256+112+336+112+0%0Aw+336+112+336+208+0%0Aw+224+368+192+368+0%0Aw+240+272+240+304+0%0Aw+240+304+240+368+0%0Aw+272+368+240+368+0%0Aw+240+368+224+368+0%0Aw+192+368+128+368+0%0Aw+352+368+336+368+0%0Aw+336+240+352+240+0%0Aw+352+240+352+320+0%0Aw+352+320+432+320+0%0Aw+432+320+432+368+0%0Aw+416+368+432+368+0%0Ar+128+208+128+272+0+100%0Ao+17+1+0+4106+5+0.1+0+1%0ASeems not able to regolate it with POT, also sometimes it freeze. Something wrong?Quote from: coppercone2 on March 29, 2019, 05:00:57 pmAdj. is the correct word. Sometimes due my language some words seems also correct in english.I'd like to use something simple and cheap. I know there's micro and advanced regulators but it's something I don't want to use.

author: Circlotron
author_rank: Super Contributor
timestamp: April 01, 2019, 08:02:06 am
content: The VCO section of a 4046 might be good enough. Very simple to use.https://www.google.com/search?q=4046+vco&rlz=1C9BKJA_enAU745AU745&hl=en-GB&prmd=imsvn&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiGppXjtq7hAhURAXIKHc6mBt4Q_AUoAXoECAwQAQ&biw=1024&bih=659

author: Zero999
author_rank: Super Contributor
timestamp: April 01, 2019, 08:10:08 am
content: Quote from: Yaroooo on April 01, 2019, 07:55:49 amYes, but 150R is a little on the low side. I'd probably go for C = 330pF, R1 = 390R and a 4k7 potentiometer.QuoteThat means nothing. Simulators are notoriously bad at modelling digital logic chips. I've built it before and it worked perfectly, although I admit I used the CD4013, not 74HC74, but it should work with that too.

author: Yaroooo
author_rank: Regular Contributor
timestamp: April 01, 2019, 08:21:58 am
content: Quote from: Zero999 on April 01, 2019, 08:10:08 amThanks for your advise.Anyway, about D-FF circuit, how can I simulate it using a valid simulator? I admit Falstad seems an entry level simulator and may fail.

author: Zero999
author_rank: Super Contributor
timestamp: April 01, 2019, 11:37:13 am
content: Quote from: Yaroooo on April 01, 2019, 08:21:58 amWhy do you want to simulate it? There's little point in doing so. It won't actually prove whether it works or not. The simulator will only be as good or bad as the component models.You could try LTSpice, but it's a lot of effort, because it doesn't come with the CD4013/74HC74 in the default model library.Try building it on a piece of breadboard. Start with larger capacitors to give a lower frequency, which will be easier to work with on a breadboard, which is not ideal for high frequencies.

author: iMo
author_rank: Super Contributor
timestamp: April 01, 2019, 12:00:59 pm
content: You cannot get 50% duty off a 555. The math does not allow it.You may use the wiring with two diodes in the lower resistor, that works well (tested in hw).See below the 555 with regolable duty and frequency/

author: Zero999
author_rank: Super Contributor
timestamp: April 01, 2019, 12:35:08 pm
content: The 7555 will theoretically give 50% duty cycle, with the timing resistor connected to the output.However in practise, it won't give exactly 50% duty cycle. I've built it before and it's slightly off, depending on the value of R and the power supply voltage. Generally, it gives better results with as higher power supply voltage and value of R, as possible, but it's dependant on the device, which is pot luck. See the thread linked below.https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2167870/#msg2167870This is why simulation is not the answer. If you tried simulating the above circuit, it will no doubt give exactly 50% duty cycle, but it doesn't in reality. Indeed the default LTSpice model for the NE555 gives 50% duty, with this circuit, but a real 555 timer won't. The simulator is wrong, because it doesn't model the 555's output stage properly.

author: ogden
author_rank: Super Contributor
timestamp: April 01, 2019, 01:10:28 pm
content: To get 50% duty cycle, build 0..1MHz clock and divide it by two:https://www.electronics-tutorials.ws/counter/count_1.html

author: Zero999
author_rank: Super Contributor
timestamp: April 01, 2019, 04:21:03 pm
content: Quote from: ogden on April 01, 2019, 01:10:28 pmThat's what thecircuit I posted abovedoes, but the original poster appears to lack confidence in it, because it doesn't work with a simulation program.There are lots of circuits like that which won't work in simulation very well. What's worse is there are circuits which will work in a simulator, but not in real life. Here's an example of a circuit which is supposed to both generate an inverting and non-inverting output, with a gain of 10. A simulator will show it works, but it doesn't in real life,

author: Kleinstein
author_rank: Super Contributor
timestamp: April 01, 2019, 07:58:09 pm
content: The 74HC4060 could be suitable. A simple RC oscillator that could be adjusted with a pot, and quite a few divider stages to select for the lower frequency. because it's a ripple counter the outputs are near perfect 50% PWM.The stability is not great, but could be a little better than HC14 type. As the analog range would be only about 1:4 the adjustment could be relatively fine. Overall range could be something like 1 MHz .... 1 Hz or a little larger.

author: Yaroooo
author_rank: Regular Contributor
timestamp: April 02, 2019, 07:29:43 am
content: Quote from: Zero999 on April 01, 2019, 04:21:03 pmNo wait. I've just asked to learning purposes. What I've asked is why is not working and I can't simulate it, to understand what's happening. But I had interesting answers to make me understand better.

author: iMo
author_rank: Super Contributor
timestamp: April 02, 2019, 07:50:41 am
content: If you want to learn something useful, download the LTspice and you will get a tool which works..

author: Zero999
author_rank: Super Contributor
timestamp: April 02, 2019, 09:05:17 am
content: Quote from: imo on April 02, 2019, 07:50:41 amDoes the astable with the 74HC74 work though?Quote from: Yaroooo on April 02, 2019, 07:29:43 amOh did you try building it and it didn't work? If the 74HC74 didn't work, try the CD4013, I've build it with that IC and it worked perfectly. I didn't try the 74HC74, although it should work with that too.The link you posted to the simulation doesn't work. Try link

author: iMo
author_rank: Super Contributor
timestamp: April 02, 2019, 10:19:59 am
content: Quote from: Zero999 on April 02, 2019, 09:05:17 amSure, you would need a '74 model with real transistors in it.

author: Zero999
author_rank: Super Contributor
timestamp: April 02, 2019, 11:26:59 am
content: Quote from: imo on April 02, 2019, 10:19:59 amI take that as a no then. How about using slightly different values of R or C, for each side of the timing circuit? It might work then. Simulators often struggle with a perfectly symmetrical astable multivibrator, which doesn't represent reality. I would do it myself, but can't download the 74HC74 model at the moment.

author: stockvu
author_rank: Newbie
timestamp: April 02, 2019, 12:55:41 pm
content: Your spec of 0 to 500 kHz is pretty tough for a discrete circuit to realize (in a repeatable fashion) such that you know what the current frequency (and perhaps duty-cycle).I'd suggest buying a good bench-top frequency generator as one solution ~$100-200.Another way is to buy a AD9833 Direct Digital Synthesizermodule(~$5 on eBay) and run it using a PIC or Arduino micro-controller board.That low-cost AD9833 DDS can really deliver (0.1 Hz resolution) from 0 to 12.5 MHz, especially in a Square wave output. I use them for my projects with an Arduino 2560.I realize this approach is way beyond using a few discrete chips. However, if you what you need MUST be repeatable and accurate, its likely worth considering.hth

author: ogden
author_rank: Super Contributor
timestamp: April 02, 2019, 02:55:32 pm
content: Quote from: stockvu on April 02, 2019, 12:55:41 pmSquare wave output of this DDS is just MSB of the DAC -far from DDS resolutionwith jitter for most (noninteger) frequencies. AD9851 have built-in comparator for proper square wave output, yet it is huge overkill for 0..500KHz application.Further reading.

author: iMo
author_rank: Super Contributor
timestamp: April 02, 2019, 05:00:27 pm
content: Quote from: ogden on April 02, 2019, 02:55:32 pmNope. The 9833's "MSB" is with 28bit resolution. Therefore the square wave too.It is the same situation as with the 9851 and its comparator.

author: ogden
author_rank: Super Contributor
timestamp: April 02, 2019, 05:27:01 pm
content: Quote from: imo on April 02, 2019, 05:00:27 pmYes you are so right. My badIt is output jitter up-to 1/FCLK for 9833 that differs between two.

author: stockvu
author_rank: Newbie
timestamp: April 03, 2019, 03:28:14 am
content: QuoteHi. Well, I don't think the OP specified things like jitter or settling time -- but I may have missed it. I don't have a Jitter Test Set or a Spectrum Analyzer to evaluate these 9833 circuits. On my low cost scope, the outputs seem stable and agree well with freq counter.I run one DDS 100x higher in frequency and then pipe it into the 2560 Timer-5 input. There its divided by 100 and T5's Output-Compare generates selectable duty cycle from 5-95% (no comparator needed). An added benefit is 0.1 Hz resolution now becomes .001 Hz.So I admit its overkill -- but I like overkill when its cheap.

author: ogden
author_rank: Super Contributor
timestamp: April 03, 2019, 07:37:18 am
content: Quote from: stockvu on April 03, 2019, 03:28:14 amHe did not. Knowledge may be useful for others who read this.QuoteIt is hard to notice on low output frequencies. FCLK/4 have no jitter but FCLK/2.5 is worst case. Look at > 4 periods on scope and you will see. BTW you don't even have to put DDS into MSB mode - just look at DDS DAC output w/o LP filter at FCLK/2.5. It will be eye-opening on itself. Then you start to realize how critical is output low pass filter especially for high freq output of DDS, why sometimes it is designed to be steep 7-th order or even better, filter. Disclaimer: all noninteger (relating to FCLK) frequencies have this behavior, FCLK/2.5 was just simple worst case pick. Ups. I talk about non-integer divisors, yet use round number, 3Fixed to FCLK/2.5

author: stockvu
author_rank: Newbie
timestamp: April 03, 2019, 01:58:56 pm
content: QuoteI take output off the DAC MSB. I don't need the triangle or sine outputs. My use of this circuitry never sees an RF channel, it doesn't get low-passed since it feeds digital chips downstream.Thanks for the tip on looking >4 periods, that's good to know. If I do have some jitter, its not a problem for my application.I just threw in the DDS idea as another option for the OP to consider.