Sorry, I forgot that the input signal is actually inverted, which is why I needed to put that not gate in there.
Are you trying to count how many high pulses?
How long is the input stay high?
What I understand from your requirement is that you need to use a counter to count the high period of every pulse and also issue an interrupt when the High period exceeds a threshold, is that right?
If that is the case, then one way to implement it is to use the Capture feature to determine the High period. The Compare value has to be set according to your threshold requirement. Upon compare match, an interrupt is generated if "Interrupt on Compare" is enabled or the "comp" terminal on the component also gives a pulse. ISR can be connected to this terminal to execute your code on interrupt.