0% found this document useful (1 vote)
968 views

Timer Programming MCQs

The document contains multiple choice questions about timer programming and I/O port programming in 8051 microcontrollers. For timers, the clock source is the microcontroller's crystal frequency. The TMOD register is used to set timers to different modes. For a 22MHz crystal, the maximum delay that can be generated is approximately 2.97 milliseconds. For ports, port 0 requires a pull-up resistor and ports 0 and 1 act as the 16-bit address lines.

Uploaded by

Syed Hamedoon
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
968 views

Timer Programming MCQs

The document contains multiple choice questions about timer programming and I/O port programming in 8051 microcontrollers. For timers, the clock source is the microcontroller's crystal frequency. The TMOD register is used to set timers to different modes. For a 22MHz crystal, the maximum delay that can be generated is approximately 2.97 milliseconds. For ports, port 0 requires a pull-up resistor and ports 0 and 1 act as the 16-bit address lines.

Uploaded by

Syed Hamedoon
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Timer Programming MCQs

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 different timer’s or counter’s to their appropriate modes
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 register is used to set different timer’s or counter’s to their appropriate modes so
that it tells the user that what mode is being used when operating any timer or counter.

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. 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.

6. 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.

7. TF1, TR1, TF0, TR0 bits are of which register?


a) TMOD
b) SCON
c) TCON
d) SMOD
View Answer

Answer: c
Explanation: These bits are of TCON register. It tells us about the overflow flag bit and the run control
bit.

I/O Port Programming MCQS

1. To initialize any port as an output port what value is to be given to it?


a) 0xFF
b) 0x00
c) 0x01
d) A port is by default an output port
View Answer

Answer: d
Explanation: In 8051, a port is initialized by default in its output mode no need to pass any value to it.
2. Which out of the four ports of 8051 needs a pull-up resistor for using it is as an input or an output
port?
a) PORT 0
b) PORT 1
c) PORT 2
d) PORT 3
View Answer

Answer: a
Explanation: These pins are the open drain pins of the controller which means it needs a pull-up resistor
for using it as an input or an output ports.

3. Which of the ports act as the 16 bit address lines for transferring data through it?
a) PORT 0 and PORT 1
b) PORT 1 and PORT 2
c) PORT 0 and PORT 2
d) PORT 1 and PORT 3
View Answer

4. Which of the following registers are not bit addressable?


a) SCON
b) PCON
c) A
d) PSW
View Answer

Answer: b
Explanation: PCON register is not a bit addressable register.

Q1. Which value of disc capacitors is preferred or recommended especially when the quartz crystal is
connected externally in an oscillator circuit of 8051 ?

a. 10 pF
b. 20 pF
c. 30 pF
d. 40 pF

View Answer / Hide Answer

ANSWER: c. 30 pF

Why are the resonators not preferred for an oscillator circuit 0f 8051?

a. Because they do not avail for 12 MHz higher order frequencies


b. Because they are unstable as compared to quartz crystals
c. Because cost reduction due to its utility is almost negligible in comparison to total cost of microcontroller board
d. All of the above

View Answer / Hide Answer

ANSWER: d. All of the above

Q3. Which location specify the storage / loading of vector address during the interrupt
generation?

a. Stack Pointer
b. Program Counter
c. Data Pointer
d. All of the above

View Answer / Hide Answer

ANSWER: b. Program Counter

You might also like