I have made a timer using the TMR0 interrupt.

With the settings I use, I can't PAUSE for more than 16ms or I'll miss a tick.

So I have to slice a
PAUSE 50
in
PAUSE 10 : PAUSE 10 : PAUSE 10 : PAUSE 10 : PAUSE 10

But this is not a problem.

I have already used the WHILE/WEND loop followed by a PAUSE. And here, some problems occur from time to time.

I'm not absolutely sure but I think it can miss the "real" button state. The WHILE/WEND loop can "see" a bounce of the button and not the real state of the button you actually want it to have. It may not have the desired effect.

Moreover, this WHILE/WEND loop is a blocking loop since it will prevent the PIC to give the hand to the Interrupt as long as the button is pressed.

I would really prefer some kind of interrupt scanning for a raising/falling edge of I/O ports with an internal routine preventing consecutive (bouncing) inputs whithin a certain time frame.

Maybe something already existing in PICs, maybe something to do?