I recently came up with some interesting pulse interval code - using the UART timing mode to essentially time-stamp falling edge events.
The example code is for RPM counting, but it should be pretty understandable. Each time there’s a falling edge, the UART sees a start bit and we get a microsecond timestamp since the last event. The byte is malformed (there’s no stop bit so technically there’s a framing error) but I just ignore that. As imps tend to have plenty of UARTs this is a nice way to build a totally background RPM counter.
Obviously, to just count pulses, you simply need to count received bytes - as long as the minimum low period is >1 bit time, and the minimum high >9 bit times (configure the UART appropriately) youl won’t even need to use timing mode. This should work fine for fairly high pulse rates - what’s the range you’re looking at?