Specific Timers logic +At89c51

Thread Starter

aamirali

Joined Feb 2, 2012
412
1. I used to do programming in which I use one timer as delay timer for generating specific delay & other for general purpose timer for periodically updating some vraibles/pin/ etc . in interrupt.
I am using 11.0592Mhz crystal


2. But now I have to also use uart. Now uart use Timer 1. Now uart remain active for entire time.
So I have left with only one timer.

3. I have a logic in which general timer will keep on running at 1ms interrupt, & if I have to create some specific delay. I set up a global flag, which start counting in interrupt for specific time & generate the delay.

Problem with above approach is, when I have to create specific delay:
1. Time has to be factor of 1ms. I cannot make 1.5ms
2. Max error rate in generating delay is +- 1ms.
3. If I set periodic timer below 1ms than interrupt happens lots of time in 1ms & adds unnecessary cycles like PUSH,POP everytime.


Does anyone has better approach to do. I want to cretae specific delay also & don't want to disturb periodic updation of variables/pins etc
 
Top