Author Topic: From 10MHz sine to square via comparator. Can you help?  (Read 1211 times)

0 Members and 1 Guest are viewing this topic.

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
From 10MHz sine to square via comparator. Can you help?
« on: April 22, 2021, 12:17:40 pm »
Hello,
I'm currently experimenting with my GPSLDO and counters and I'm trying to transform it in a square wave of the same 10MHz frequency.
I currently have a TLV3501 conveniently mounted on an adapter, a breadboard, and a PSU. I would like to use a single 5V supply voltage.
The cable is 50 Ohms. The problem is that I'm ignorant, so here is what I tried (fumbling around).
First I tried terminating the cable and feeding that into the comparator. The problem is that I don't know how to precisely achieve the perfect reference voltage, without trimming a resistor divider by hand.

I managed to obtain a somewhat "ok" result, by "magic", ie: I put the unterminated 10MHz in series with a cap and a 1k resistor and the input. then with two 10k I obtained ~50% of VCC fed into the reference input of the comparator.

On the output I obtain (second case) some kind of square wave but it has a lot of ringing and looks kinda ugly especially for 10MHz.

So, am I doing something horribly wrong? What should I learn to do this "properly"? Is the divider the best choice or is there anything else?

Thanks a lot.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1637
  • Country: is
Re: From 10MHz sine to square via comparator. Can you help?
« Reply #1 on: April 22, 2021, 02:15:01 pm »
I would probably try driving something like a 7414 schmitt device which cleans up the input by the hysteresis effect and then since there are multiple gates in the package take the output of the first gate and drive the remaining gates paralleled up for good solid output current drive and waveshape. Your ringing is probably due to long ground leads and breadboarding. It doesn't take much to make 10mhz look bad. Most comparators will suck at 10mhz and their output drive capacity to push loads is pretty feeble. Just play around with your input coupling to the 7414 until you get some stable output. There are CMOS versions available also if you need other than TTL level output.

 
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 
The following users thanked this post: Moriambar, mindcrime

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1840
  • Country: us
Re: From 10MHz sine to square via comparator. Can you help?
« Reply #2 on: April 22, 2021, 03:14:19 pm »
The TLV3501 is a fast comparator, and well-suited for your 10 MHz application.  I'm using this part on the front-end of my Time Interval Counter design, for frequencies under 1 Hz and up to the 200 MHz area.  It has a small amount of built-in hysteresis which should provide adequate noise immunity when given a clean input.  You wouldn't want to drive a 50 Ohm cable directly with the output of the '3501, but it's fine for short traces and moderate impedances (I drive a FPGA with it).
Your ringing is most likely due to your breadboard layout and bypassing.  What are you driving with the comparator output?

As for biasing the inputs. I have a 1/2 supply voltage divider, bypassed, with 1 Meg resistors from the divider to each of the comparator inputs.  One input is then bypassed to ground, and the other capacitively coupled to the input protection network.  I am trying to provide a one Meg input impedance, with switchable 50 Ohm option, but if you are only planning on 50 Ohm inputs you should reduce the biasing resistors to 1K or so.  This will reduce the input offset-current-induced offset voltage.  Not critical though when you have a strong input signal.

If your input comes from off-board, then you need a protection circuit.  I use two series resistors, and a TLV diode to ground at the junction.  For 10 MHz, you can probably use 1K series resistors, which should give good protection.  I use the T.I. TPD1E04U04 TLV diode.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: Moriambar, mindcrime

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16510
  • Country: us
  • DavidH
Re: From 10MHz sine to square via comparator. Can you help?
« Reply #3 on: April 22, 2021, 07:00:13 pm »
Bruce as some example circuits here but does not go into great detail.

There are subtle issues with comparators which influence phase noise and jitter, like hysteresis, but if you have no way to measure these, then a simple design can be used.  I would look into a single comparator "data slicer" which takes feedback from the output of the comparator to enforce a 50% duty cycle.  A CMOS comparator with its rail-to-rail output is particularly useful here, although in the past I placed a CMOS gate at the output of the comparator to do the same thing.
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: From 10MHz sine to square via comparator. Can you help?
« Reply #4 on: April 22, 2021, 08:45:59 pm »
The TLV3501 is a fast comparator, and well-suited for your 10 MHz application.  I'm using this part on the front-end of my Time Interval Counter design, for frequencies under 1 Hz and up to the 200 MHz area.  It has a small amount of built-in hysteresis which should provide adequate noise immunity when given a clean input.  You wouldn't want to drive a 50 Ohm cable directly with the output of the '3501, but it's fine for short traces and moderate impedances (I drive a FPGA with it).
Your ringing is most likely due to your breadboard layout and bypassing.  What are you driving with the comparator output?

As for biasing the inputs. I have a 1/2 supply voltage divider, bypassed, with 1 Meg resistors from the divider to each of the comparator inputs.  One input is then bypassed to ground, and the other capacitively coupled to the input protection network.  I am trying to provide a one Meg input impedance, with switchable 50 Ohm option, but if you are only planning on 50 Ohm inputs you should reduce the biasing resistors to 1K or so.  This will reduce the input offset-current-induced offset voltage.  Not critical though when you have a strong input signal.

If your input comes from off-board, then you need a protection circuit.  I use two series resistors, and a TLV diode to ground at the junction.  For 10 MHz, you can probably use 1K series resistors, which should give good protection.  I use the T.I. TPD1E04U04 TLV diode.

Thanks for everything. I'll try capitalizing on your persoonal experience.
I'm driving some counters, specifically 74AC163
 

Offline Gerhard_dk4xp

  • Frequent Contributor
  • **
  • Posts: 321
  • Country: de
Re: From 10MHz sine to square via comparator. Can you help?
« Reply #5 on: April 22, 2021, 10:15:31 pm »
Somewhat surreal.
That's what i just soldered 20 minutes ago:

To the left is the comparator. No input signal = output low.
To the right, the rectifier notes if there is AC and creates a
signal to switch the 100 MHz VCXO from a trim pot to PLL
via an analog switch.

There is an LVC163 also to divide the 100 MHz to 10 for
the 74LV4046 PLL.
Gerhard
 
« Last Edit: April 22, 2021, 10:18:27 pm by Gerhard_dk4xp »
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1637
  • Country: is
Re: From 10MHz sine to square via comparator. Can you help?
« Reply #6 on: April 23, 2021, 01:02:43 am »
Be aware that the 74AC series are very picky about bypassing and lead lengths!!! They don't don't behave well on breadboards. They were so problematic for me I went back to 74LS in one of my projects.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16510
  • Country: us
  • DavidH
Re: From 10MHz sine to square via comparator. Can you help?
« Reply #7 on: April 23, 2021, 11:08:33 am »
Be aware that the 74AC series are very picky about bypassing and lead lengths!!! They don't don't behave well on breadboards. They were so problematic for me I went back to 74LS in one of my projects.

They did not behave well in DIPs either.  The AC series in DIPs with standard pinouts never reached its potential performance because of excessive lead inductance.  FAST and AS had an advantage here because of slower edge rates while maintaining low delay which is what matters.
« Last Edit: April 23, 2021, 11:12:23 am by David Hess »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf