12

High speed comparators are rather expensive and speed is what FPGAs are very good at. On the other hand, FPGAs (in my case: XC3S400) have paired differential pins in each bank that their voltages are compared ( At least I think so !). They also have Vref for single ended standards that may act as a comparator.

I want to know if I can use those differential I/O pair pins as a comparator -and if so- how should I do that ( Should I connect a vref and use single ended standards or simply connect two voltages to differential I/O pins ?)

EDITION: I tried it and works excellent !!!

Aug
  • 1,561
  • 6
  • 28
  • 63
  • If you stay within the documented voltage limits it ought to work after a fashion - precision may be more like 50-100mv than 1mv. How precise do you need? –  Nov 10 '13 at 11:24
  • @BrianDrummond precision is not a big concern, just converting a sine wave to logic level square wave. – Aug Nov 10 '13 at 12:56
  • 1
    @Aug, that is how all the ADCs in the world work! – FarhadA Nov 11 '13 at 15:10

1 Answers1

11

Yes you can. There are some applications notes using the differential pairs inside an FPGA as a low cost ADC.

There is a very good document describing this that you can use for your design:

Analysis on Digital Implementation of Sigma-Delta ADC with Passive Analog Components

David
  • 4,504
  • 2
  • 25
  • 44
FarhadA
  • 1,379
  • 1
  • 10
  • 20
  • the link does not work for me, do you have an alternative? – David Nov 10 '13 at 21:41
  • 1
    [Analysis on Digital Implementation of Sigma-Delta ADC with Passive Analog Components](http://www.uob.edu.bh/uob__files/651/V2-N2-03.pdf) – deadude Nov 10 '13 at 21:50
  • 1
    Thank you for your guidance! I tried it and works nice. Now I have a very high speed comparator at no more cost ! – Aug Nov 20 '13 at 14:02
  • Glad it worked, I used it long time ago and was surprised how easy it was to implement a simple ADC inside the FPGA without any active components. I saved a lot of time and money doing so :) – FarhadA Nov 20 '13 at 21:36
  • I found the linked paper a bit hard to read. This ["adc in an fpga" blogpost](https://davidkessner.wordpress.com/2011/05/01/adc-in-an-fpga) is much more accessible, IMO. – maxy Jul 19 '15 at 17:42
  • please NOTE: the S-D LVDT ADC has some heavy patents attached. Sure using it for hobbyist... but if anyone is thinking of putting it into a product ... –  Mar 28 '16 at 09:44
  • 1
    That is total BS Jon, I have been using it for over a decade. Just becasue a smart ass decided to patent it does not mean it is their design, I can show you at least 3 industrial application on the market for the past 10 years or so that uses this simple ADC idea. – FarhadA Mar 30 '16 at 07:16