I've got an experimental box of tricks -- the console of an MRI scanner -- that spits out a 4 µs long, +5V TTL about every 100 ms, when something interesting happens. I'd like to ultimately create a timestamp in a file every time one of these happens, and write the data to disk on a linux computer that runs the show next door.
At the moment, as described on Stack Overflow, I've just wired the TTL into a parallel port on the linux box, and I poll it regularly by a high-priority process when the scan starts. Unfortunately, sometimes the process is suspended, and I miss a few (or a lot) of the short pulses.
Rather than handling the TTL as an interrupt, as my original question was about, it's been suggested that I use a hardware PIC to deal with the signals, and spit data back over USB (or ethernet) to the host machine.
Can anyone suggest a good PIC that can deal with short pulses, has an accurate timebase, and ideally already has a USB or TCP/IP stack implemented? I get the feeling that this has got to be a solved problem, I just don't know what to look for!