Issue with reading serial data

If you are expecting to do things every 4 µsecs then I suspect your code in the ISR is too slow. digitalRead() is a slow function.

Try using the digitalWriteFast() library and if that does not show an improvement try reading the port directly with PINX (where X is replaced by the letter for the port you want to read. Look up Arduino Port Manipulation.

However it may be the case that your timer generating the pulses is creating a natural sync with the timer detecting them - so what works in test may not work when it is trying to read data from an external device with which it is not synchronized.

Overall, wouldn't it be a lot simple to use a CHANGE interrupt to detect the pulses?

...R