By: Masud-ul-Hasan
17
Initializing and Accessing Timer Registers
(Contd.)
•The timer is then started by setting the run control bit i.e.,
• SETB TR1
•Overflow flag is automatically set 100μs later. Following instruction will check that
• WAIT: JNB TF1, WAIT ; wait until overflow flag is set.
•When the timer overflows, it is necessary to stop the timer and clear the overflow flag in software by the following instructions:
• CLR TR1 ; stop Timer 1
CLR TF1 ; clear overflow flag of Timer 1