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
Only problem is when I turn off timer in ISR, TL0 increases to sone value. "increases to some value" incorrect "has increased to some value" correct, the timer keeps running while the Uc "finds its way" to the ISR
Erik