One shot timer for At89C51

I want to make one short timer in AT89C51 i.e timer should stop soon after it completes.
I have to use interrupt for overflow.

There is no specific bit for making one short timer in AT89C51, so what I did in ISR is

void timr_isr()
{
    TR0 = 0;  /* turn off timer */
    /* do something on completion of timer */

}

Only problem is when I turn off timer in ISR, TL0 increases to sone value.

Is this is correct way of doing?
Or there is other method for stopping timer

Parents Reply Children
No data
More questions in this forum