TCON REGISTER 8051
Timer Control Register (TCON): TCON is another register used to control operations of counter and timers in microcontrollers. It is an 8-bit register wherein four upper bits are responsible for timers and counters and lower bits are responsible for interrupts.
TF1: The TF1 stands for ‘timer1’ flag bit. Whenever calculating the time-delay in timer1, the TH1 and TL1 reaches to the maximum value that is “FFFF” automatically.
EX: while (TF1==1)
Whenever the TF1=1, then clear the flag bit and stop the timer.
TR1: The TR1 stands for timer1 start or stop bit. This timer starting can be through software instruction or through hardware method.
EX: gate=0 (start timer 1 through software instruction)
TR1=1; (Start timer)
TF0: The TF0 stands for ‘timer0’ flag-bit. Whenever calculating the time delay in timer1, the TH0 and TL0 reaches to a maximum value that is ‘FFFF’, automatically.
EX: while (TF0==1)
Whenever the TF0=1, then clear the flag bit and stop the timer.
TR0: The TR0 stands for ‘timer0’ start or stop bit; this timer starting can be through software instruction or through hardware method.
EX: gate=0 (start timer 1 through software instruction)
TR0=1; (Start timer)
Comments
Post a Comment