Hello, I'm new to the forum.
I've been playing with TMR0, trying to get it to work in counter mode as a stopwatch.
It seems simple enough, but I'm missing something because it only increments intermittently.
I've tried Pulling the TOCKI pin high, and trying to interrupt by grounding it.
I've tried pulling the TOCKI pin low, and trying to interrupt by switching it high.

But I just cant get it to work.

Does anyone have any suggestions for me?

Thanks.

I'm using the PIC16F877A.

Here is my basic program flow:

OPTION_REG = %00111000 'Transition on TOCKI (RA4),
'Increment on falling edge
'Prescalar assigned to WDT for a 1:1 TMR0 ratio.

INTCON = %10100000 ' Enable Global Interrupt and TMR0 Interrupt.

ON INTERRUPT GOTO LapCount
Main:
:
:
:
goto Main

disable
LapCount:
If INTCON.2 = 1 then
i = i + 1

INTCON = %10100000 'Clear TMR0 Interrupt Flag (Bit 2)

Resume
Enable