EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: Yaroooo on March 29, 2019, 11:17:42 am
-
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!
-
The ordinary 555 can go up to 500kHz, the ICM7555 1MHz and the TLC555 2MHz.
https://www.st.com/resource/en/datasheet/cd00000479.pdf (https://www.st.com/resource/en/datasheet/cd00000479.pdf)
https://www.renesas.com/eu/en/www/doc/datasheet/icm7555-56.pdf (https://www.renesas.com/eu/en/www/doc/datasheet/icm7555-56.pdf)
http://www.ti.com/lit/ds/symlink/tlc555.pdf (http://www.ti.com/lit/ds/symlink/tlc555.pdf)
Logic gates such as the 74HC14 can work at even higher frequencies, but are less accurate.
What are your tolerance/accuracy requirements?
-
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 at 4.5 50% duty cycle oscillator, where is written:
t1 = 0.693*RA*C
f=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?
-
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.
-
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 at 4.5 50% duty cycle oscillator, where is written:
t1 = 0.693*RA*C
f=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?
Try 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.
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.
If 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/?action=dlattach;attach=636382;image)
https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2155480/#msg2155480 (https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2155480/#msg2155480)
-
what is regolable? i never heard that term
-
A synonym for adjustated.
-
I knew a guy who adjustated synonyms for a living.
-
what is regolable? i never heard that term
A synonym for adjustated.
There's no such word in English. I did try Googling it, but guessed the OP meant adjustable by their context.
-
Seriously? Only two guys who did not get English typos are from US and UK :-DD [kidding]
Back to the subject.. There are many programmable clock IC's around, such as CDCE913, Si5351 and more. [edit] Not to mention nearly every microcontroller with and without timer.
https://www.adafruit.com/product/2045 (https://www.adafruit.com/product/2045)
-
does this could help ?
https://www.ebay.com/itm/1KHz-to-33MHz-Adjustable-Oscillator-Module-LTC1799/400292172818 (https://www.ebay.com/itm/1KHz-to-33MHz-Adjustable-Oscillator-Module-LTC1799/400292172818)
-
Voltage-to-frequency converters commonly cover that range easily and with the addition of an output flip-flop, will produce a square wave.
-
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 at 4.5 50% duty cycle oscillator, where is written:
t1 = 0.693*RA*C
f=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?
Try 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.
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.
If 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/?action=dlattach;attach=636382;image)
https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2155480/#msg2155480 (https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2155480/#msg2155480)
I 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= (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%0A
Seems not able to regolate it with POT, also sometimes it freeze. Something wrong?
what is regolable? i never heard that term
Adj. 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.
-
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 (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)
-
I 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?
Yes, but 150R is a little on the low side. I'd probably go for C = 330pF, R1 = 390R and a 4k7 potentiometer.
I'd liked your version with D-FF, I've tried to simulate it but I've got some problems.
That 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.
-
I 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?
Yes, but 150R is a little on the low side. I'd probably go for C = 330pF, R1 = 390R and a 4k7 potentiometer.
I'd liked your version with D-FF, I've tried to simulate it but I've got some problems.
That 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.
Thanks 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.
-
I 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?
Yes, but 150R is a little on the low side. I'd probably go for C = 330pF, R1 = 390R and a 4k7 potentiometer.
I'd liked your version with D-FF, I've tried to simulate it but I've got some problems.
That 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.
Thanks 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.
Why 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.
-
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/
-
The 7555 will theoretically give 50% duty cycle, with the timing resistor connected to the output.
(https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/?action=dlattach;attach=640378;image)
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/#msg2167870 (https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2167870/#msg2167870)
This 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.
-
To get 50% duty cycle, build 0..1MHz clock and divide it by two:
(https://www.electronics-tutorials.ws/counter/cou1.gif)
https://www.electronics-tutorials.ws/counter/count_1.html (https://www.electronics-tutorials.ws/counter/count_1.html)
-
To get 50% duty cycle, build 0..1MHz clock and divide it by two:
(https://www.electronics-tutorials.ws/counter/cou1.gif)
https://www.electronics-tutorials.ws/counter/count_1.html (https://www.electronics-tutorials.ws/counter/count_1.html)
That's what the circuit I posted above (https://www.eevblog.com/forum/projects/ic-advice-to-create-a-regolable-oscillator-from-0-to-500khz/msg2305839/#msg2305839) does, 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,
(https://www.eevblog.com/forum/projects/unstable-dc-opamp-sinusoidal-signal-centering/?action=dlattach;attach=487961;image)
-
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.
-
To get 50% duty cycle, build 0..1MHz clock and divide it by two:
(https://www.electronics-tutorials.ws/counter/cou1.gif)
https://www.electronics-tutorials.ws/counter/count_1.html (https://www.electronics-tutorials.ws/counter/count_1.html)
That's what the circuit I posted above (https://www.eevblog.com/forum/projects/ic-advice-to-create-a-regolable-oscillator-from-0-to-500khz/msg2305839/#msg2305839) does, but the original poster appears to lack confidence in it, because it doesn't work with a simulation program.
No 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.
-
If you want to learn something useful, download the LTspice and you will get a tool which works..
-
If you want to learn something useful, download the LTspice and you will get a tool which works..
Does the astable with the 74HC74 work though?
To get 50% duty cycle, build 0..1MHz clock and divide it by two:
(https://www.electronics-tutorials.ws/counter/cou1.gif)
https://www.electronics-tutorials.ws/counter/count_1.html (https://www.electronics-tutorials.ws/counter/count_1.html)
That's what the circuit I posted above (https://www.eevblog.com/forum/projects/ic-advice-to-create-a-regolable-oscillator-from-0-to-500khz/msg2305839/#msg2305839) does, but the original poster appears to lack confidence in it, because it doesn't work with a simulation program.
No 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.
Oh 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 [url]link[/url]
-
If you want to learn something useful, download the LTspice and you will get a tool which works..
Does the astable with the 74HC74 work though?
Sure, you would need a '74 model with real transistors in it.
-
If you want to learn something useful, download the LTspice and you will get a tool which works..
Does the astable with the 74HC74 work though?
Sure, you would need a '74 model with real transistors in it.
I 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.
-
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 Synthesizer module (~$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
-
That low-cost AD9833 DDS can really deliver (0.1 Hz resolution) from 0 to 12.5 MHz, especially in a Square wave output.
Square wave output of this DDS is just MSB of the DAC - far from DDS resolution with 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. (https://www.analog.com/media/en/technical-documentation/application-notes/475354741144165304775709740692131461831AN823_0.pdf)
-
Square wave output of this DDS is just MSB of the DAC - far from DDS resolution. AD9851 have built-in comparator for proper square wave output, yet it is huge overkill for 0..500KHz application.
Nope. 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.
-
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.
Yes you are so right. My bad :P
It is output jitter up-to 1/FCLK for 9833 that differs between two.
-
Square wave output of this DDS is just MSB of the DAC - far from DDS resolution. AD9851 have built-in comparator for proper square wave output, yet it is huge overkill for 0..500KHz application.
Hi. 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. :)
-
Hi. Well, I don't think the OP specified things like jitter or settling time -- but I may have missed it.
He did not. Knowledge may be useful for others who read this.
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.
It 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.
[edit] Ups. I talk about non-integer divisors, yet use round number, 3 :palm: Fixed to FCLK/2.5
-
It is hard to notice on low output frequencies. FCLK/4 have no jitter but FCLK/3 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/3. It will be eye-opening on itself.
I 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.