RAHUL_KUMAR
Member level 5
- Joined
- Jun 5, 2017
- Messages
- 90
- Helped
- 4
- Reputation
- 8
- Reaction score
- 4
- Trophy points
- 8
- Location
- Bhubaneswar,Odisha,India
- Activity points
- 780
8051,assembly,timer- do flag register need clock 2 get monitored by microcontroller?
To generate time delay using timer we set the value of timer by loading TH and TL value in 8051 architecture micro controller. and start the timer by using instruction setb TR1 (if using timer 1) . the TF1 flag continuously get monitored and set to 1 when timer value roll over from FFFFH to 0000H.
Each increment produces a delay of 1.085 uS if we are using XTAL as 11.0592 MHz.
If we go for exact delay calculation we will have to consider each instruction comes in between.
each instruction need clock depend on its machine cycle . 1 byte instruction need 12 clock ,2 byte need 24 clock and so on .and timer need 12
clock .
one thing in all this is not encountered is the role of TF flag. it is continuously get monitored . dont it need any clock for this purpose?
QUESTION: To get exact delay calculation , we consider timer value and the instructions used in between for delay . But we dont consider the flag .
Dont it (the flag) need any clock to get monitored ?
if yes ,then it must be considered in exact calculation.
if no, then how is it happening? programmer dont monitor TF flag but ,uC itself do it . then it must be needed clock to execute it .
To generate time delay using timer we set the value of timer by loading TH and TL value in 8051 architecture micro controller. and start the timer by using instruction setb TR1 (if using timer 1) . the TF1 flag continuously get monitored and set to 1 when timer value roll over from FFFFH to 0000H.
Each increment produces a delay of 1.085 uS if we are using XTAL as 11.0592 MHz.
If we go for exact delay calculation we will have to consider each instruction comes in between.
each instruction need clock depend on its machine cycle . 1 byte instruction need 12 clock ,2 byte need 24 clock and so on .and timer need 12
clock .
one thing in all this is not encountered is the role of TF flag. it is continuously get monitored . dont it need any clock for this purpose?
QUESTION: To get exact delay calculation , we consider timer value and the instructions used in between for delay . But we dont consider the flag .
Dont it (the flag) need any clock to get monitored ?
if yes ,then it must be considered in exact calculation.
if no, then how is it happening? programmer dont monitor TF flag but ,uC itself do it . then it must be needed clock to execute it .