Quote Originally Posted by HenrikOlsson View Post
Why not use the prescaler? That will make the timer tick slower.
Otherwise, just do it the way you're thinking, each time it overflows (indicated by the interrupflag) you increment a variable. When it reaches the desired value you do whatever.
Just remember to claer the interrupt flag, you have that commented out in the code.

/Henrik.
Hi H,

I changed the prescaler bits:

T0CON.T0PS2 = 0 'Bit2 = 1:2 Prescale value
T0CON.T0PS1 = 0 'Bit1 = 1:2 Prescale value
T0CON.T0PS0 = 0 'Bit0 = 1:2 Prescale value

To:
T0CON.T0PS2 = 1 'Bit2 = 1:256 Prescale value
T0CON.T0PS1 = 1 'Bit1 = 1:256 Prescale value
T0CON.T0PS0 = 1 'Bit0 = 1:256 Prescale value

But I didn't see any difference.

You can see the commented out interrupt flag farther down the code.

Thanks C.