EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: Moriambar on April 22, 2021, 12:17:40 pm

Title: From 10MHz sine to square via comparator. Can you help?
Post by: Moriambar 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 (https://www.ti.com/lit/ds/symlink/tlv3501.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1619054650493) 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.
Title: Re: From 10MHz sine to square via comparator. Can you help?
Post by: CaptDon 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.

 
Title: Re: From 10MHz sine to square via comparator. Can you help?
Post by: fourfathom 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.
Title: Re: From 10MHz sine to square via comparator. Can you help?
Post by: David Hess on April 22, 2021, 07:00:13 pm
Bruce as some example circuits here (http://www.ko4bb.com/~bruce/CLKSHPR.html) 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.
Title: Re: From 10MHz sine to square via comparator. Can you help?
Post by: Moriambar 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 (https://www.ti.com/lit/ds/symlink/cd54ac163.pdf?ts=1618906688546&ref_url=https%253A%252F%252Fwww.google.com%252F)
Title: Re: From 10MHz sine to square via comparator. Can you help?
Post by: Gerhard_dk4xp 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
 
Title: Re: From 10MHz sine to square via comparator. Can you help?
Post by: CaptDon 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.
Title: Re: From 10MHz sine to square via comparator. Can you help?
Post by: David Hess 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.