TMR0

Thread Starter

Alho

Joined Nov 3, 2011
12
how can i start timing using TMR0 (PIC16F887) with a pushbutton input?
how can i write the C code for this using micrC?

any help?
thankx
 

mik3

Joined Feb 4, 2008
4,843
Set bit0 (TMR0ON) in T0CON register to 1 if the input is high.

if (pin_x==1) //don't know what the actual command is in microC
{

TMR0ON=1; //don't know what the actual command is in microC

}
 

Thread Starter

Alho

Joined Nov 3, 2011
12
actually i need to measure time (20 seconds) delay before an output pin goes HIGH.
the time should start when the button is pressed....
 
Top