the ClockCounter interrupt could be made a bit faster since it uses no pbp code it can be called an asm interrupt and secondly
the interrupt flag is being cleared twice
INT_Handler TMR2_INT, _ClockCounter, ASM, no
might help.
ps
if the do something in the checksensor int takes longer than the tmr2 time out period you are wasting your time ever trying to get it to work.
why not just set a flg here and then process the "do something " in an interruptable routine
Bookmarks