Author Topic: Simplist sqaure wave clock circuit.  (Read 4882 times)

0 Members and 1 Guest are viewing this topic.

Offline nbrittonTopic starter

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: us
Simplist sqaure wave clock circuit.
« on: September 20, 2015, 12:14:53 am »
What is the simplest way (least amount of jellybean components) to implement a square wave generator that goes high when it's input sine wave is positive and goes low when its input sine wave is negative? I want to implement the following function: y = x / ( x + 0^sin(x))

Lets assume I have a 50 ~ 100 MHz sine wave output coming in from an signal generator. It seems like you could get this done with one transistor, but I'm not sure what transistor selection I should use for this.
 

Online John_ITIC

  • Frequent Contributor
  • **
  • Posts: 510
  • Country: us
  • ITIC Protocol Analyzers
    • International Test Instruments Corporation
Re: Simplist sqaure wave clock circuit.
« Reply #1 on: September 20, 2015, 12:48:05 am »
How about using an op-amp? GND negative input and feed your sine wave to positive input. When input goes positive, the op-amp goes full-rail positive. Vice-versa for negative. If your sine wave has a non-zero DC offset then set the negative input to the same offset via a resistor voltage divider. Or simply remove the DC offset via a series capacitor. Seems classical...
https://www.google.com/?gws_rd=ssl#q=op+amp+comparator+sine+square+wave+
« Last Edit: September 20, 2015, 01:07:39 am by John_ITIC »
Pocket-Sized USB 2.0 LS/FS/HS Protocol Analyzer Model 1480A with OTG decoding.
Pocket-sized PCI Express 1.1 Protocol Analyzer Model 2500A. 2.5 Gbps with x1, x2 and x4 lane widths.
https://www.internationaltestinstruments.com
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Simplist sqaure wave clock circuit.
« Reply #2 on: September 20, 2015, 01:11:45 am »


 :popcorn:
The easiest person to fool is yourself. -- Richard Feynman
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12852
Re: Simplist sqaure wave clock circuit.
« Reply #3 on: September 20, 2015, 03:00:08 am »
@John:  jellybean OPAMP at 50 - 100 MHz? ROTFLMAO
« Last Edit: September 20, 2015, 03:02:59 am by Ian.M »
 

Online John_ITIC

  • Frequent Contributor
  • **
  • Posts: 510
  • Country: us
  • ITIC Protocol Analyzers
    • International Test Instruments Corporation
Re: Simplist sqaure wave clock circuit.
« Reply #4 on: September 20, 2015, 04:21:11 am »
@John:  jellybean OPAMP at 50 - 100 MHz? ROTFLMAO

Is this a problem? Digikey has five pages of them; stocked and starting from $2.
http://www.digikey.com/product-search/en?pv658=22&FV=fff40027%2Cfff800dd&k=op-amp&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25

Then perhaps the slew rate that causes trouble... Must check...

Well, I just picked one that had slew rate of 2000V/us. This is 0.5ns/V. Or about 1.5ns rise time for a 3.3V signal. A 100 MHz signal has a 10ns period so would work.
http://www.ti.com/lit/ds/snos823b/snos823b.pdf

The OP did not mention anything about rise time of the square wave so the above solution should work.

Disclaimer; I don't normally do much analog design but what I recall from college, this should work. No?

Edit: Digikey has even better; these have slew rate of over 3000V/us. Costs about $3 in single-quantity.
http://www.digikey.com/product-search/en?pv511=260&pv511=264&FV=fff40027%2Cfff800dd%2Ca480016&k=op-amp&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25]
[url]http://www.digikey.com/product-search/en?pv511=260&pv511=264&FV=fff40027%2Cfff800dd%2Ca480016&k=op-amp&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25
[/url]
« Last Edit: September 20, 2015, 04:31:48 am by John_ITIC »
Pocket-Sized USB 2.0 LS/FS/HS Protocol Analyzer Model 1480A with OTG decoding.
Pocket-sized PCI Express 1.1 Protocol Analyzer Model 2500A. 2.5 Gbps with x1, x2 and x4 lane widths.
https://www.internationaltestinstruments.com
 

Offline Quarlo Klobrigney

  • Frequent Contributor
  • **
  • Posts: 967
  • Country: pt
  • This Space For Rent
Re: Simplist sqaure wave clock circuit.
« Reply #5 on: September 20, 2015, 05:33:43 am »
Voltage does not flow, nor does voltage go.
 

Online John_ITIC

  • Frequent Contributor
  • **
  • Posts: 510
  • Country: us
  • ITIC Protocol Analyzers
    • International Test Instruments Corporation
Re: Simplist sqaure wave clock circuit.
« Reply #6 on: September 20, 2015, 05:43:28 am »
http://www.allsyllabus.com/aj/note/ECE/LINEAR_ICs_and_APPLICATIONS/unit2/Comparator.php#.Vf5EzIIfAmg
3. Zero Crossing Detector: [ Sine wave to Square wave converter] :-+

Yes, this is what I meant. However, what is the reason to use the opamp in inverting mode? What are the bandwidth limitation? I tried to simulate in Multisim but could not get it to work after a little while. My naïve approach was to filter out any DC offset of the input signal via a capacitor, then raise the bias level to some 1V via a voltage divider on both + and - inputs. The idea was to have the opamp hit its rails as the AC input swings around the 1V bias voltage.

However, the output doesn't switch properly for higher frequencies. Clearly, I'm missing something but it's been 20 years since basic op-amp training.

Edit: It seems the answer is here: OP-AMPs are useless at higher frequencies since it takes too much time to get it out of saturation after having been driven into one of the rails; use a dedicated comparator IC instead:
http://electronics.stackexchange.com/questions/84990/how-to-use-op-amps-as-comparator-in-high-frequencies

My simulations seemed to confirm this; when increasing the input frequency to 10 MHz+ the output didn't switch properly. The duty-cycle became less and less until the output got stuck low. Good use of the evening; something new learned...

Edit: More explanations here: http://www.learnabout-electronics.org/Amplifiers/amplifiers62.php

Anyways: it would be interesting to know what the op-amp gurus have to say...
« Last Edit: September 20, 2015, 06:15:44 am by John_ITIC »
Pocket-Sized USB 2.0 LS/FS/HS Protocol Analyzer Model 1480A with OTG decoding.
Pocket-sized PCI Express 1.1 Protocol Analyzer Model 2500A. 2.5 Gbps with x1, x2 and x4 lane widths.
https://www.internationaltestinstruments.com
 

Offline Quarlo Klobrigney

  • Frequent Contributor
  • **
  • Posts: 967
  • Country: pt
  • This Space For Rent
Re: Simplist sqaure wave clock circuit.
« Reply #7 on: September 20, 2015, 06:18:02 am »
Don't know. Does it matter what is the op-amp being simulated? Must be a high speed type in the sim? I don't use simulators for analog. Perhaps one like the CLC430 or others as posted in the previous links. I usually just build it and try. As far as the inverting circuit that's what Google is for as far as determining how to do it on the non-inverting input. I'm like you, haven't designed with op-amps in a while. Being in radio I know that you can clip a sinewave with diodes and have a pseudo-square signal.
Voltage does not flow, nor does voltage go.
 

Online John_ITIC

  • Frequent Contributor
  • **
  • Posts: 510
  • Country: us
  • ITIC Protocol Analyzers
    • International Test Instruments Corporation
Re: Simplist sqaure wave clock circuit.
« Reply #8 on: September 20, 2015, 06:23:50 am »
The problem is that an op-amp is intended for high gain and high slew rate within it's linear operation range and not intended to be driven into its rails. When this is done, it takes much too long to get it out of saturation resulting that it appears 'stuck' at one of its rails. My simulations confirm this. This is independent behavior from slew rate specs. See the below links for details.
https://www.google.com/?gws_rd=ssl#q=time+to+pull+op-amp+out+of+saturation

I have found dedicated comparators that appears to work up to 150 MHz and more. That could be the solution to the OP's problem.
« Last Edit: September 20, 2015, 06:26:47 am by John_ITIC »
Pocket-Sized USB 2.0 LS/FS/HS Protocol Analyzer Model 1480A with OTG decoding.
Pocket-sized PCI Express 1.1 Protocol Analyzer Model 2500A. 2.5 Gbps with x1, x2 and x4 lane widths.
https://www.internationaltestinstruments.com
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: Simplist sqaure wave clock circuit.
« Reply #9 on: September 20, 2015, 06:34:40 am »
The problem is that an op-amp is intended for high gain and not intended to be driven into its rails. When this is done, it takes much too long to get it out of saturation resulting that it appears 'stuck' at one of its rails. My simulations confirm this. This is independent behavior from slew rate specs.

+1.  The time to get out of saturation is typically the amount of time the op-amp spent at the rail, up to a limit of a few us.

You may actually still manage to get a square wave out, but best-case it will be phase shifted 90° from the input.  Better to just use the proper part, a comparator.
 

Offline knks

  • Regular Contributor
  • *
  • Posts: 51
  • Country: au
Re: Simplist sqaure wave clock circuit.
« Reply #10 on: September 29, 2015, 01:07:41 am »
schmitt trigger?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: Simplist sqaure wave clock circuit.
« Reply #11 on: September 29, 2015, 10:00:21 am »
Why on earth would you use an op-amp for this?

Yes, a Schmitt trigger is much better suited. Try the 74AC14.
 

Offline Flenser

  • Regular Contributor
  • *
  • Posts: 60
Re: Simplist sqaure wave clock circuit.
« Reply #12 on: September 30, 2015, 04:01:32 am »
A comparator, like the LM393, would make a 1-chip solution with no external components.

Op Amps are not ideal as comparators. See http://www.analog.com/media/en/technical-documentation/application-notes/AN-849.pdf

You will need to have V+, V- and GND available (but you will need these if you decide you want to use an op amp anyway).
 

Offline knks

  • Regular Contributor
  • *
  • Posts: 51
  • Country: au
Re: Simplist sqaure wave clock circuit.
« Reply #13 on: September 30, 2015, 05:21:34 am »
A comparator, like the LM393, would make a 1-chip solution with no external components.
At 100MHZ?
 

Offline RoadRunner

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Re: Simplist sqaure wave clock circuit.
« Reply #14 on: September 30, 2015, 05:50:37 am »
just put any high speed Schmitt trigger buffer or inverter on the output.
 

Offline ONETEN

  • Contributor
  • Posts: 17
Re: Simplist sqaure wave clock circuit.
« Reply #15 on: September 30, 2015, 04:08:49 pm »
FWIW I have done similar in automotive applications using an LM1815 IC which works very well, however the IC has an fmax of 2khz or similar.
Is 50-100mhz what you really need or just an example? Cause the solution is much simpler if you are only working with low frequencies.
 

Online John_ITIC

  • Frequent Contributor
  • **
  • Posts: 510
  • Country: us
  • ITIC Protocol Analyzers
    • International Test Instruments Corporation
Re: Simplist sqaure wave clock circuit.
« Reply #16 on: September 30, 2015, 08:03:31 pm »
Why on earth would you use an op-amp for this?

Yes, a Schmitt trigger is much better suited. Try the 74AC14.

This simulates ok in Multisim so should work okay. I simulated with a HC14 up to 100 MHz. One caveat is that you would need to bias the input such that the input signal swings around the middle of the hysteresis curve or else the duty cycle of the output square wave would be something else than 50/50. A resistor divider and AC input cap would do the job.
Pocket-Sized USB 2.0 LS/FS/HS Protocol Analyzer Model 1480A with OTG decoding.
Pocket-sized PCI Express 1.1 Protocol Analyzer Model 2500A. 2.5 Gbps with x1, x2 and x4 lane widths.
https://www.internationaltestinstruments.com
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf