Kreeesh wrote:The first involves charging a capacitor between the true start of the signal and the first clock signal. You do the same with another capacitor between the stop signal and the next clock signal.
That's a fairly analog solution.
FPGAs make things a bit easier: you set up a tapped delay line consisting of elements of fixed delay (input/output time on the slices of the FPGA). String together enough of those elements to fit in a clock cycle of your clock, attach the taps to registered elements and clock them, and the pattern tells you when the signal occurred between the clock edges. Add that to the value counted by the clock edges, and you've got your time.
If you imagine having, say, a 50 ns clock, and delay elements of 10 ns each, and having 5 of them,
signal->del0->del1->del2->del3->del4
Suppose the signal happens at, say, 30 ns before the clock: in this case, del[4:0] would be 5'b11000.
Slice timing on FPGAs gets
very fast, so you can have a very precise timing. 100 ps isn't that difficult with, say, a Spartan-3 (I know of solutions that have gotten less than 50 ps) using its fast carry chain.
It's of course not this easy - the delay varies with temperature and process, so you would want to set up a calibration circuit (where you string a bunch of your delay elements together and measure where successive clocks edges end up - multiple if you want more precision, etc). You also have to worry about metastability of the main counter, which you can get around by various tricks (use two counters on opposite clock phases, selecting the proper one based on the delay line - there are other less resource-intensive tricks).
But 750 ps isn't really that difficult. For the calibration circuit you could look at Xilinx's XAPP454 where they have a similar design, but for the opposite reason (
generating a precise time interval).