Greetings everybody,
I am working on a project of making a timer which runs for 5
seconds and stops. I have selected timer 2 for this. I start the
timer on key press and it runs for 5 seconds.
Below is the code for initializing the timer 2
void _init_timer(void)
{
T2CON = 0x80; /* 10000000 */
/*--------------------------------------
Overflow at every 10 ms.
--------------------------------------*/
RCAP2H = 216;
↧