I'm working on a little project in my physics lab.
We would like to create a photon coincidence counter. We were thinking to use the Pi GPIO pin to monitor a couple of photo diode which produce a 15ns 5V TTL signal (I know the Pi can handle 3.3V maximum).
I asked on the RaspberryPi stack exchange (here) if the board could detect such short pulse and they suggested to use "GPIO Asynchronous Edge Detect" (they also suggested to ask here because it seemed a more specialised question).
I think this could work but I would like to know if the pin has some kind of "down-time" after being triggered where the pin doesn't register anything and if it doesn't at wich rate can it count? I also would like to know if the board can read multiple signal of this type in short delay one with another (or even better simultaneously).
To make it more clear we are not trying to measure the duration of such pulse but only if two pulses from two different photo diode arrive on the Pi simultaneously.

I'm pretty new with the Pi and I hope i explained clearly the problem. This is more a proof of concept to see if it can be done, even if we need to go "bare metal". Thanks

  • \$\begingroup\$ I assume you intend to use a Pi running a Linux? A general purpose OS like Linux is toally unsuited to such a task. And 15 ns is pretty short anyway for a controller, so I suggest you use some external logic circuit and/or counter. \$\endgroup\$ Dec 6, 2015 at 22:04
  • \$\begingroup\$ As I said, if we need to go bare metal I don't think it could be such a big problem. Maybe the development would be a bit longer but who knows when we'll receive the funds \$\endgroup\$
    – fox895
    Dec 7, 2015 at 9:40
  • \$\begingroup\$ If you go bare metal I'd choose a different target. Arduino Due might be one. But you still need to consider your requirements in more detail, my guess is that you need external hardware anyway. \$\endgroup\$ Dec 7, 2015 at 12:08

1 Answer 1


It would be better to use an external counter for this task rather than trying to manage all the complexity inside the Pi to make it work and guarantee that it works. You can read the output from the counter on the GPIO pins of the Pi.

  • \$\begingroup\$ The fact is that we are trying for a non expensive solution even if not perfect, as we are waiting for some funds to get a specific device for this and a counter for this kind of experiments is very expensive. As I said is more a proof of a concept to say "we can do this! " \$\endgroup\$
    – fox895
    Dec 6, 2015 at 18:46
  • \$\begingroup\$ It doesn't have to be expensive. nxp.com/documents/data_sheet/74HC590.pdf \$\endgroup\$
    – Daniel
    Dec 6, 2015 at 18:55
  • \$\begingroup\$ Uhm this is getting interesting, but I'm afraid I'm going to go full noob on this. How can it count only when the pulse are simultaneous? \$\endgroup\$
    – fox895
    Dec 6, 2015 at 19:04
  • \$\begingroup\$ So you want to set up many pins in the Rasberry Pi to do this? From your description I thought you were talking about connecting all the outputs together into a single pin. \$\endgroup\$
    – Daniel
    Dec 6, 2015 at 19:18
  • \$\begingroup\$ If "within the 15ns pulse width" is good enough for "simultaneous", I'd suggest you put an AND gate on the inputs and count pulses of its output. The Pi will not have good enough interrupt latency to trigger off one pin and measure another. \$\endgroup\$
    – pjc50
    Dec 6, 2015 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.