Hi,

A simple way could be to count how many times you have read "1023" and reset the counter if other reading ... there might be something like a timed loop in your program ...

from your TMR1 example ...

IF counter > 3435 then AUTO_DESTRUCT_LAUNCHED ...

"on interrupt" might be more than enough to flag the TMR1 Overflows and increment counter ...

Alain