first time on stackexchange, hope I'm in the right place. I am working on a project where I need to timestamp an event (which will be detected from an electrical pulse) down to a few tens of nanoseconds and synchronized with GPS (because there will be a couple of those modules that need to be synced together). I looked for a simple arduino/raspberry solution but it seems it won't do better than 1-2 us, far from ~30 ns.
I was thinking of using the 1PPS output (1Hz) of the GPS to get a very accurate time and then find the time interval between this pulse and the sensor's pulse by counting cycles of an external, high precision clock. I have found a clock which will get me under 30ns innacuracy over the 1s PPS(40MHz, 10ppb, 1ps jitter).
Now, the problem is how do I go about counting these clock cycles? My experience on the subject is very close to 0 and so is my teammate's. Any help is very much appreciated.
EDIT: It seems this is very complicated for someone who's only experience with microcontroller is sending data through serial. The perfect product for my application would be something like this: http://www.ti.com/product/TDC7201/description Just connect the two pulses to START and STOP pins and it returns the time interval. The only difference is I would need a 1s measurement (vs 8ms) but with 10-50ns precision (vs 50ps). Basically 1000x longer measurement with 1000x less precision.