| ??? 10/16/03 07:57 Read: times |
#56734 - RE: TIMER HELP Responding to: ???'s previous message |
Hi,
Some rules about timer-for-time I use in my projects when I need with real clock ticks without unexpected divergence: - set the maximal priority level for a timer interrupt; another ones should have lower level. - never stop a timer! If you need to avoid timer ISR by a some reason then there is another way: masking interrupt. For example, somewhere in main program do not use CLR TR0 [some framefork] SETB TR0but instead CLR ET0 [some framefork] SETB ET0Moreover, if you know that a program has interrupt(s) with long-time ISR(s) execution then instead CLR/SETB ET0 use CLR/SETB EA. - use auto-reload feature of timers 0/1/2. - use a good OSC. You may add/delete some rules by your taste. Good days! |



