Author Topic: switch between 2 oscillators?  (Read 9752 times)

0 Members and 1 Guest are viewing this topic.

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
switch between 2 oscillators?
« on: March 26, 2016, 09:50:30 am »

 Say you have 2 555 timers. One output at 50khz, the other at 100khz.
 How can one switch between these outputs every millisecond?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: switch between 2 oscillators?
« Reply #1 on: March 26, 2016, 10:19:26 am »
A CMOS switch but why?

You could have one 555 timer and just change the value of the resistor/capacitor. There are other possibilities such as a voltage controlled oscillator or microcontroler.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: switch between 2 oscillators?
« Reply #2 on: March 26, 2016, 10:44:15 am »
There is also the issue of synchronous switching, so no fore shortened or expanded
period occurs. Each cycle is one or the optehr period. Do you care ? If not then switching
caps or timing components would be OK.

Regards, Dana.

Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: switch between 2 oscillators?
« Reply #3 on: March 26, 2016, 02:41:12 pm »
Use a MOSFET to switch an additional capacitor into the RC circuit. When the MOSFET is on, C2 is switched into the circuit which roughly halves the frequency. C1 is slightly smaller than normally required because the MOSFET has some additional capacitance.

V2 represents the control signal which changes the frequency.

It works fine in LTSPICE but I haven't built it in real life.
 

Offline KM4FER

  • Regular Contributor
  • *
  • Posts: 81
  • Country: us
Re: switch between 2 oscillators?
« Reply #4 on: March 26, 2016, 03:40:28 pm »
If you want an exact 2:1 ratio I would run the 555 at the highest rate and follow it with a D flip-flop to divide by two.  Now you have both frequencies and you can switch between them with a couple of nand gates and a 1KHz square wave.
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1275
  • Country: gb
    • bitdynamics
Re: switch between 2 oscillators?
« Reply #5 on: March 26, 2016, 05:48:14 pm »
Any small microcontroller (ATTINY etc) with a double buffered Timer Compare Counter would do this easily, although it depends on the accuracy and drift you need for your clock signals?
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #6 on: March 26, 2016, 06:10:35 pm »
Anything involving programing is much like sourcery to my archaic mind.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: switch between 2 oscillators?
« Reply #7 on: March 26, 2016, 06:38:52 pm »
If you want an exact 2:1 ratio I would run the 555 at the highest rate and follow it with a D flip-flop to divide by two.  Now you have both frequencies and you can switch between them with a couple of nand gates and a 1KHz square wave.
I'd omit the 555 altogether and go for the HEF4060 or 74HC4060 and use a 12.8MHz crystal.
http://www.nxp.com/documents/data_sheet/HEF4060B.pdf
http://www.nxp.com/documents/data_sheet/74HC_HCT4060_Q100.pdf

Q7 will then give exactly 100kHz and Q8 50kHz.

I'll probably need 25khz and 38khz oscillations. Hopefully very square, and as near 50% duty as possible.
Have your requirements changed because that's totally different. A 555 and MOSFET to switch a capacitor in/out of the circuit would work but it isn't as accurate as a crystal. The divider method won't work for 25kHz &38kHz because they're not even multiples of one another.
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #8 on: March 26, 2016, 07:43:42 pm »
I'll probably need 25khz and 38khz oscillations. Hopefully very square, and as near 50% duty as possible.
Have your requirements changed because that's totally different. A 555 and MOSFET to switch a capacitor in/out of the circuit would work but it isn't as accurate as a crystal. The divider method won't work for 25kHz &38kHz because they're not even multiples of one another.

 Can't... That's the actual output I need!
 

Offline bson

  • Supporter
  • ****
  • Posts: 2269
  • Country: us
Re: switch between 2 oscillators?
« Reply #9 on: March 26, 2016, 08:26:08 pm »
If you need accuracy and stability better than what a 555 can offer, then because 25 and 38 don't have a common divisor, the easiest is to build two separate XOs and either switch between them using a mux, or design them to have tri-state outputs and complementary OE's so only one outputs at a time.  The XO's could produce say N*25kHz and N*38kHz, then you divide the selected output by N.  (Crystals and oscillators in the MHz are a lot more common than tens of kHz.)  Find an N that will work.  At these frequencies the oscillators can simply be based on a couple of inverters each from the same 'HC04 plus a pair of load caps per XO.
 

Online edavid

  • Super Contributor
  • ***
  • Posts: 3381
  • Country: us
Re: switch between 2 oscillators?
« Reply #10 on: March 26, 2016, 08:33:03 pm »
7.6MHz crystals are readily available...
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #11 on: March 26, 2016, 08:39:32 pm »
If you need accuracy and stability better than what a 555 can offer, then because 25 and 38 don't have a common divisor, the easiest is to build two separate XOs and either switch between them using a mux, or design them to have tri-state outputs and complementary OE's so only one outputs at a time.  The XO's could produce say N*25kHz and N*38kHz, then you divide the selected output by N.  (Crystals and oscillators in the MHz are a lot more common than tens of kHz.)  Find an N that will work.  At these frequencies the oscillators can simply be based on a couple of inverters each from the same 'HC04 plus a pair of load caps per XO.

 Been into electronics for a couple days! You speak mad science! My grasp lacks thoroughly!
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: switch between 2 oscillators?
« Reply #12 on: March 26, 2016, 09:02:24 pm »
I'll probably need 25khz and 38khz oscillations. Hopefully very square, and as near 50% duty as possible.
Have your requirements changed because that's totally different. A 555 and MOSFET to switch a capacitor in/out of the circuit would work but it isn't as accurate as a crystal. The divider method won't work for 25kHz &38kHz because they're not even multiples of one another.

 Can't... That's the actual output I need!
But you haven't given any indication of the desired tolerance, accuracy or stability which is pretty important for selecting an oscillator.
7.6MHz crystals are readily available...

Yes, you're better off going higher and dividing down.

The CD4060 could be used with a 7.6MHz crystal would give 950kHz on the Q3 output, which could then be divided by 38 or 25, to get 25KHz or 38kHz respectively.
If you need accuracy and stability better than what a 555 can offer, then because 25 and 38 don't have a common divisor, the easiest is to build two separate XOs and either switch between them using a mux, or design them to have tri-state outputs and complementary OE's so only one outputs at a time.  The XO's could produce say N*25kHz and N*38kHz, then you divide the selected output by N.  (Crystals and oscillators in the MHz are a lot more common than tens of kHz.)  Find an N that will work.  At these frequencies the oscillators can simply be based on a couple of inverters each from the same 'HC04 plus a pair of load caps per XO.

 Been into electronics for a couple days! You speak mad science! My grasp lacks thoroughly!
The idea is to generate a higher frequency, then divider it by a fixed number, using a counter.

A counter can be used to divide the frequency of a train of pulses. For example, if a counter circuit is designed to be reset when the total reaches 25, then the it will go to zero every 25 pulses and the output will be 1/25 of the input frequency.
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #13 on: March 27, 2016, 07:36:00 am »
I'll look into all the options you guys mentioned. That ltc1799 is looking good!
At this point I can only guess my tolerances. From the few tests I was able to do, 3% out of spec seems to still work!
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: switch between 2 oscillators?
« Reply #14 on: March 27, 2016, 10:45:17 pm »
I'll look into all the options you guys mentioned. That ltc1799 is looking good!
At this point I can only guess my tolerances. From the few tests I was able to do, 3% out of spec seems to still work!
Can we see the bigger picture? What are you trying to do with the 25kHz and 50kHz squarewaves?
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #15 on: March 28, 2016, 11:40:47 am »
I'll look into all the options you guys mentioned. That ltc1799 is looking good!
At this point I can only guess my tolerances. From the few tests I was able to do, 3% out of spec seems to still work!
Can we see the bigger picture? What are you trying to do with the 25kHz and 50kHz squarewaves?

 That would be 25khz and 38khz (possibly up to 56khz if it turns out to be required). I'd like to drive ir leds. If possible, high powered ones, with some sort of mosfet amp.
 Nonetheless, I'm very interested in learning different approaches!
Right now, the harware part feels very enticing. Brings me back 25 years, when legos where the best thing ever! So, I ordered most of the parts you guys mentioned, to try later on.
There's probably a simpler way to output these oscillations with arduino or something similar. But I can't even start to understand a thing about programming.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: switch between 2 oscillators?
« Reply #16 on: March 29, 2016, 07:42:47 pm »
What do you want to do with the IR LEDs?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: switch between 2 oscillators?
« Reply #17 on: March 29, 2016, 09:49:47 pm »
Let me guess, TV remote jammer? lol
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #18 on: March 31, 2016, 01:46:56 am »
Not rly... A jammer, yes, but for a very different system, at a very different scale.
 

Offline grouchobyte

  • Regular Contributor
  • *
  • Posts: 244
  • Country: cn
Re: switch between 2 oscillators?
« Reply #19 on: March 31, 2016, 02:36:06 am »
Simplicity is the best solution

A 30 cent PIC, 10 lines of code,  no external parts. SOT23 5 pin smt package

@grouchobyte
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #20 on: March 31, 2016, 05:11:14 am »
Simplicity is the best solution

A 30 cent PIC, 10 lines of code,  no external parts. SOT23 5 pin smt package

@grouchobyte

 Absolutely. But I don't know how to program... Yet!
 I'm not just interested in making this specific device. This is a gateway for me into the electronics world. After I get this done the old fashioned way, learning some C++ is next on the list.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16276
  • Country: za
Re: switch between 2 oscillators?
« Reply #21 on: March 31, 2016, 07:23:45 pm »
Not rly... A jammer, yes, but for a very different system, at a very different scale.

Making a camera blanking hat then? To make surveillance cameras not show your image at all by swamping the video image with the light, and the switching to cover both IR lamp drive rates.
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #22 on: April 01, 2016, 08:48:18 pm »
Not rly... A jammer, yes, but for a very different system, at a very different scale.

Making a camera blanking hat then? To make surveillance cameras not show your image at all by swamping the video image with the light, and the switching to cover both IR lamp drive rates.

Now I am!

 It's a sort of jammer for an industrial site. But I must figure out a way to inject other codes in between jamming pulses. If I know how to switch between 2 oscillators, then I'll know how to switch between good, and corrupt data.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16276
  • Country: za
Re: switch between 2 oscillators?
« Reply #23 on: April 02, 2016, 07:11:53 am »
So a robustness test for an IR crane remote control then.
 

Offline nandoanalogTopic starter

  • Contributor
  • Posts: 26
Re: switch between 2 oscillators?
« Reply #24 on: April 03, 2016, 10:48:57 am »
So a robustness test for an IR crane remote control then.

Something of the sort..
I can't say exactly what it is for. Trade secrets and whatnot...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf