8051 Microcontroller Questions and Answers – Timer Programming

This set of 8051 Micro-controller Multiple Choice Questions & Answers (MCQs) focuses on “I/O Port Programming and Addressing Modes”.

1. What is the clock source for the timers?
a) some external crystal applied to the micro-controller for executing the timer
b) from the crystal applied to the micro-controller
c) through the software
d) through programming
View Answer

Answer: b
Explanation: Timer’s clock source is the crystal that is applied to the controller.

2. What is the frequency of the clock that is being used as the clock source for the timer?
a) some externally applied frequency f’
b) controller’s crystal frequency f
c) controller’s crystal frequency /12
d) externally applied frequency/12
View Answer

Answer: c
Explanation: The frequency of the clock source for the timer is equal to f/12(where f is the frequency of the crystal).

3. What is the function of the TMOD register?
a) TMOD register is used to set various operation modes of timer/counter
b) TMOD register is used to load the count of the timer
c) Is the destination or the final register where the result is obtained after the operation of the timer
d) Is used to interrupt the timer
View Answer

Answer: a
Explanation: TMOD is used to set various operation modes of timer/counter by the programmer.
advertisement
advertisement

4. What is the maximum delay that can be generated with the crystal frequency of 22MHz?
a) 2978.9 sec
b) 0.011 msec
c) 11.63 sec
d) 2.97 msec
View Answer

Answer: d
Explanation: For generating the maximum delay we have to multiply the maximum number of counts with the time period required to execute one machine cycle( 65536*1/22MHz).

5. Auto reload mode is allowed in which mode of the timer?
a) Mode 0
b) Mode 1
c) Mode 2
d) Mode 3
View Answer

Answer: c
Explanation: Auto reload is allowed in the Mode 2 of the timer because here in this mode, we don’t need to load the count again and again in the register.

6. Find out the roll over value for the timer in Mode 0, Mode 1 and Mode 2?
a) 00FFH,0FFFH,FFFFH
b) 1FFFH,0FFFH,FFFFH
c) 1FFFH,FFFFH,00FFH
d) 1FFFH,00FFH,FFFFH
View Answer

Answer: c
Explanation: For Mode 0 13 bit value is used so 1FFFH is chosen to be the roll over value. Similarly for Mode 1 FFFFH and for Mode 2 FFH is the roll over value for the timers and counter.

7. What steps are followed when we need to turn on any timer?
a) load the count, start the timer, keep monitoring it, stop the timer
b) load the TMOD register, load the count, start the timer, keep monitoring it, stop the timer
c) load the TMOD register, start the timer, load the count, keep monitoring it, stop the timer
d) none of the mentioned
View Answer

Answer: b
Explanation: When any timer is to turn on, then firstly we have to load the TMOD register and the count. Then the timer is to get started. After then, we need to monitor the timer properly and then when the roll over condition arises then the timer is to be stopped.
advertisement

8. If Timer 0 is to be used as a counter, then at what particular pin clock pulse need to be applied?
a) P3.3
b) P3.4
c) P3.5
d) P3.6
View Answer

Answer: b
Explanation: If Timer 0 is to be used as a counter, then a pulse has to be applied at P3.4 and if it is for Timer 1 then the clock pulse has to be applied at the pin P3.5.

9. In the instruction “MOV TH1,#-3”, what is the value that is being loaded in the TH1 register?
a) 0xFCH
b) 0xFBH
c) 0xFDH
d) 0xFEH
View Answer

Answer: c
Explanation: Negative value is loaded in 2’s complement form. -3 represented in 2’s complement form as FDH.
Steps to convert into 2’s complement:

advertisement
3 → 0000 0011       	Binary Equivalent of ‘3’
  →  1111 1100          1’s Complement of decimal ‘-3’
  →  1111 1101       	2’s Complement of decimal ‘-3’
      F     D           Hex Equivalent of ‘-3’

10. TF1, TR1, TF0, TR0 bits are of which register?
a) TMOD
b) SCON
c) TCON
d) SMOD
View Answer

Answer: c
Explanation: All of these bits are part of TCON (Timer Control) register. TF0 and TF1 are used to check overflow of timer 0 and timer 1 respectively. TR0 and TR1 are timer control bits used to start and stop of timer 0 and timer 1 respectively.

Sanfoundry Global Education & Learning Series – Microcontroller.

To practice all areas of Microcontroller, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.