UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
500 Views
Registered: ‎07-31-2019

LVDS as a comparator

I interfaced FPGA(Kintex_7, LVDS_25, Vadj=1.8v)with external board to provide inputs(Analog voltage and reference voltage) to LVDS. I adjusted frequencies of signal generators to 1µHz and amplitudes to least possible value 10mv. When both the inputs are 10mv, comparator output is zero. I kept analog voltage 10mv and kept on increasing reference voltage. When Vref was increased to 51mv, the comparator output became 1. In the next step, reference voltage(51mv) is kept same and analog voltage is increased till comparator output became 0. This process is repeated to max input voltage levels. Please find the attached file for the values noted down. If you can notice from the file, the analog voltage is always less than Reference voltage but still the comparator keeps switching ON and OFF (toggle). I'm not able to understand this behaviour. In the beginning, the comparator output toggles when the difference between analog and reference voltage is 41mv (51mv - 10mv). But as i go on increasing the analog and reference voltages, the voltage difference for which the comparator output toggles, is increasing to 100mv, 250mv and so on, as seen in the file. I fail to understand the reason for this. According to my understanding, the input voltage (Vref and Vana) difference for comapartor output to toggle, should always remain constant, even if i'm increasing the input voltage values. But as said above, the difference doesn't remain constant, but increasing as well. Hence, it would be helpful if someone can explain the LVDS input output behavior as a comparator considering those noted values in the attached file.

 

0 Kudos
10 Replies
Highlighted
424 Views
Registered: ‎01-22-2015

Re: LVDS as a comparator

trivenianunag@gmail.com 

Good questions! 

First let’s look at LVDS_25 specs from Table 12 of the Kintex-7 datasheet (DS182).   Note that for an LVDS_25 input, the common mode voltage, VICM, should between 0.300 and 1.500 V.  Also, the differential input voltage, VIDIFF, should be between 0.100 and 0.600 V.  So, during your test, when the voltage inputs to the LVDS_25 gate are outside of these specifications then anything can happen.

However, and perhaps most importantly, the LVDS_25 gate is digital logic and should not be thought of as a comparator.  That is, when the Q-input is at least 0.100V more than the nQ-input then the gate output is guaranteed to be in one state.  When the nQ-input is at least 0.100V more than the Q-input then the gate output is guaranteed to be in the other state.   When the difference between the Q-input and the nQ-input is less than 0.100V then you are in an undefined region where anything can happen

This same thing happens with ordinary LVTTL logic that has thresholds of about 0.8V and 2.0V.  If you feed a voltage that is between 0.8V and 2.0V to the LVTTL gate then the output of the gate could be anything.  In fact, it could oscillate between and high and low states as noise causes the input voltage to move around in the undefined region between 0.8V and 2.0V.

Thus, for proper operation of logic (whether it is LVTTL or LVDS_25), it is important that inputs to the gate have fast transitions through the undefined region.

Mark

337 Views
Registered: ‎07-31-2019

Re: LVDS as a comparator

Thanks for your reply. I have modified my previous question as it was not precise. I hope, it would give you a better understanding regarding my query.
Now, in continuation to your response:
I understand your explanation regarding the LVDS_25 datasheet. That if VIDIFF (difference between Vana and Vref) is in the range of 100mv - 600mv,  then the LVDS will function properly as a comparator. Going by that if you look at the file, when the Vana value is 75mv (Q) and Vref (nQ) is 180mv, VIDIFF will be 105mv and hence the comparator output should have been ideally  0. But as you see in the left column in the file, the output is still 1. Only when Vref was made 183mv, the comp output became 0.
I fail to correlate this with my theoretical understanding.
Also, I don't find in the datasheet, what should be the minimum Q and nQ input values, for the LVDS to work correctly as a comparator.
It would be really helpful if you could guide me with my queries.


Triveni
0 Kudos
313 Views
Registered: ‎01-22-2015

Re: LVDS as a comparator

trivenianunag@gmail.com 

     Only when Vref was made 183mv, the comp output became 0.  I fail to correlate this with my theoretical understanding.
When Vref=183mV and Vana=75mV the magnitude of (Q-nQ) is 108mV, which is very close to VIDIFF(min)=100mV for LVDS.  Perhaps there is measurement error or voltage drops that cause your 108mV reading to actually be less than 100mV.  Also, as shown below, these values for Q and nQ violate the VICM specification for LVDS.

     Also, I don't find in the datasheet, what should be the minimum Q and nQ input values..
The datasheet LVDS specifications for VICM=(Q+nQ)/2 and VIDIFF=mag(Q-nQ) work together to restrict the range of Q and nQ.  For example, if (Q-nQ)=100mV and you restrict (Q+nQ)/2>300mV then you have two equations in the two unknowns, (Q and nQ) .  For this example, the solution is Q>350mV and nQ>250mV.  All combinations of [VICM>300mV, VICM<1500mV, VIDIFF>100mV, and VIDIFF<600mV ] can be analyzed in this way to find the voltage restrictions for Q and nQ.

Teacher drjohnsmith
Teacher
305 Views
Registered: ‎07-09-2009

Re: LVDS as a comparator

Please don't modify posts after people have replied, it breaks the chain of Q and A,
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Teacher drjohnsmith
Teacher
303 Views
Registered: ‎07-09-2009

Re: LVDS as a comparator

Assuming you are simulating, if not , why not ?
then you can generate the IBIS models of the IO pins, and simulate what you want,

There was, 20 odd years ago various designs that used a differential input of the FPGA , along with a "PWM" output of the fpga, to make an ADC, hunt them down might help.

Generally speaking, trying t understand the theoretical nature of an IO pin is a route to no where , The actual circuit is NDA to Xilinx, and they wont give it out without lots of restrictions and a good commercial need,

The FPGA is specified to work in a given set of normal conditions and limits, anything outside this , and you are on your own.
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
229 Views
Registered: ‎07-31-2019

Re: LVDS as a comparator

I now understood how are the input voltage ranges are derived, using the spec. But i have another related query. As you can see from my file, as Vana (Q) increases Vref (Qn) also increases, but not to the same extent but more. I mean to say, that as Q increases, Vidiff also increases. Just to be precise :

Vana : 250, 275, 300, 325, .....

Vref (for the LVDS to work as comparator) : 529, 577, 625, 674, ...

Means, Vdiff : 279, 302, 325, 349.... and so on..

Is there any reason for Vdiff to increase as the input voltages increase ?

0 Kudos
Teacher drjohnsmith
Teacher
219 Views
Registered: ‎07-09-2009

Re: LVDS as a comparator

If its within spec, its part of the magic of the input circuit,
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
191 Views
Registered: ‎01-22-2015

Re: LVDS as a comparator

trivenianunag@gmail.com 

I believe that your test method is giving you false measurements for VIDIFF of the LVDS_25 gate. 

As I mentioned before, it is important for inputs to LVDS_25 logic to have fast transitions through the undefined region (ie. when VIDIFF < 100mV).

Here is another way to do the testing that should give better results.

  • Set Qn at a fixed value (eg. set Qn=1.000V)
  • Get a square-wave generator and set it to toggle between Q=Vana and Q=1.200V at 1KHz rate.
  • Initially set Vana at 0.800V. You should see the LVDS_25 output  is reliably toggling at the 1KHz rate
  • Adjust Vana to higher values until the LVDS_25 output does not reliably toggle at the 1KHz rate. Record this critical value of Vana.
  • Compute VIDIFF as (Qn minus the critical value of Vana) and you should find this to be near 0.100V

Mark

0 Kudos
120 Views
Registered: ‎07-31-2019

Re: LVDS as a comparator

I think the values are incorrect. So, I thought to take new values considering LVDS_specs. 

1. I need to check LVDS input output behaviour for D.C. I'm using two signal generators to give inputs to  LVDS_25. I will set the frequencies of both signals to 1µHz.  Now, what should be the minimum amplitude and offset voltage for positive pin of LVDS and negative pins of LVDS_25 i.e., from which value should I start measurement?. Also, should I follow the same procedure which I described in first question? (In first step Voltage(amplitude+offset) of one signal(positive pin) is kept constant and the other signal(negative pin) is varied till LVDS toggle. In second step,

negative pin signal is kept constant and positive pin signal is varied. 

Could you please explain how to check the if LVDS_25 can be used as a comparator?

 

0 Kudos
Teacher drjohnsmith
Teacher
109 Views
Registered: ‎07-09-2009

Re: LVDS as a comparator

Your asking
"Could you please explain how to check the if LVDS_25 can be used as a comparator?"

as this use is outside the design and data sheet for the device, I would not think Xilinx can help .

If you do a google, you will find this older post
https://forums.xilinx.com/t5/Other-FPGA-Architecture/LVDS-as-a-comparator/td-p/913942

As I think I have mentioned, there was a spree a few years back of people in universities using FPGAs as analog FM radio receivers , and using the differential inputs as a comparator. I think using the spartan 3 back in those days.

Have a search around for what they did , it was well off the beaten track, and made some great demos at shows.
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos