You are on page 1of 8

NPTEL Online Certification Courses

Indian Institute of Technology Kharagpur

Microprocessors And Microcontrollers


Assignment 7- Week 7
TYPE OF QUESTION: MCQ
Number of questions: 15 Total mark: 15 X 1 = 15
______________________________________________________________________________

QUESTION 1:
What is the maximum number of timers that can be used in an 8051 microcontroller?

A. 1
B. 2
C. 3
D. 4

Correct Answer: b

Detailed Solution:

The 8051 microcontroller has two timers - Timer 0 and Timer 1.

QUESTION 2:

What is the contents of TH1 and TL1, to generate a square wave of 50Hz at pin p2.3? (assume
XTAL=11.0592MHz)
A. TH1 = 00h, TL1 = DCh
B. TH1 = DCh, TL1 = DCh
C. TH1 = DCh, TL1 = 00h
D. TH1 = 00h, TL1 = CDh

Correct Answer: C

Detailed Solution:

1. The period of the square wave = 1 / 50 Hz = 20 ms.

2. The high or low portion of the square wave = 10 ms.


NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

3. 10 ms / 1.085 μs = 9216

4. 65536 – 9216 = 56320 in decimal = DC00H in hex.

5. TL1 = 00H and TH1 = DCH.

QUESTION 3:
When the timer is configured to operate in mode 0, what is the size of the timer?

A. 8-bit
B. 11-bit
C. 13-bit
D. 16-bit

Correct Answer: C

Detailed Solution:

In MODE 0, TL0 is 5-bit and TH0 is 8-bit

______________________________________________________________________

QUESTION 4:
Which one of the following instructions selects mode 2 timer 0?
A. MOV TMOD, #01h
B. MOV TMOD, #10h
C. MOV TMOD, #20h
D. MOV TMOD, #02h

Correct Answer: D

Detailed Solution:
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 5:
Which of the following instructions is equivalent the instruction CLR TF0
A. CLR TCON.5
B. CLR TCON.4
C. CLR TCON.6
D. CLR TCON.7

Correct Answer: A

Detailed Solution:

The equivalent instruction for CLR TF0 is "CLR TCON.5". This instruction clears the 5th bit
(TF0) of the TCON register, which is used to indicate the Timer 0 overflow interrupt flag. It
resets the flag to 0, indicating that the interrupt has been serviced and the timer has started
again from 0.

QUESTION 6:
Find the delay produced by timer in mode 1, if the TH and TL is initialized with 12h and
34h respectively? (Assume XTAL=11.0592MHz)

A. 792.60 msec
B. 66.05 msec
C. 66.05 µsec
D. 792.60 µsec

Correct Answer: B

Detailed Solution:

Delay = (FFFFh – 1234h + 1) × 1.085 µs = 66.05 msec


NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 7:
Identify priority of interrupts after the following instruction is executed?

MOV IP,#10h

A. INT0 > TF0 > INT1 > TF1 > RI + TI


B. RI+TI > INT0 > TF0 > INT1 > TF1
C. INT0 > RI+TI > TF0 > INT1 > TF1
D. INT1 > TF1 > INT0 > TF0 > RI + TI

Correct Answer: B

Detailed Solution:

In the 8051 microcontroller, the interrupt priority order can be changed by setting the IP
(Interrupt Priority) register. The IP register is an 8-bit register used to set the priority
levels of the 5 interrupt sources in the 8051 microcontroller. The interrupt sources are
INT0, Timer 0, INT1, Timer 1, and Serial Port.

The default priority order in the 8051 microcontroller is as follows:

1. INT0
2. Timer 0
3. INT1
4. Timer 1
5. Serial Port

However, the priority order can be changed by setting the priority levels in the IP register.
The IP register contains 3 bits each for Timer 1, Serial Port, and Timer 0, and 2 bits each for
INT1 and INT0.

To change the priority order, we can set the priority levels of the interrupt sources in the IP
register as per our requirement. The higher the value of the priority level, the higher the
priority of the interrupt source.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 8:
Identify priority of interrupts after the following instruction is executed?

MOV IP,#02h

A. INT0 > TF0 > INT1 > TF1 > RI + TI


B. TF1 > INT0 > TF0 > INT1 > RI + TI
C. INT0 > RI+TI > TF0 > INT1 > TF1
D. INT1 > TF1 > INT0 > TF0 > RI + TI

Correct Answer: B

Detailed Solution:

QUESTION 9:
Default priority order of 8051 _________________.

A. INT0 > TF0 > INT1 > TF1 > RI + TI


B. TF1 > INT0 > TF0 > INT1 > RI + TI
C. INT0 > RI+TI > TF0 > INT1 > TF1
D. INT1 > TF1 > INT0 > TF0 > RI + TI

Correct Answer: A

Detailed Solution:

QUESTION 10:
Which timer in an 8051 microcontroller is used for baud rate generation in serial
communication?

A. Timer 0
B. Timer 1
C. Timer 2
D. Timer 3
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

Correct Answer: B

Detailed Solution:

Timer 1 in 8051 microcontroller is used for baud rate generation in serial communication.

QUESTION 11:
What is the purpose of the Interrupt Vector Table in the 8051 microcontroller?

A. To store the address of the interrupt service routine for each interrupt
B. To store the priority level of each interrupt
C. To store the interrupt enable flag for each interrupt
D. None of the above

Correct Answer: A

Detailed Solution:

To store the address of the interrupt service routine for each interrupt

QUESTION 12:
In 8051, What is the address of the Interrupt service routine of Timer 0 overflow
interrupt?
A. 0000h
B. 0003h
C. 000Bh
D. 0013h

Correct Answer: C

Detailed Solution:

The 8051 microcontroller has a total of 5 interrupts, which are assigned addresses in the
ISR Address Table as follows:

Interrupt Address
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

External Interrupt 0 0003h

Timer 0 000Bh

External Interrupt 1 0013h

Timer 1 001Bh

Serial Port Interrupt 0023h

QUESTION 13:
What is the baud rate of serial communication in the 8051 microcontroller when SM0 is set to 0 and
SM1 is set to 0?

A. 1/12 of oscillator frequency


B. 1/32 of oscillator frequency
C. 1/64 of oscillator frequency
D. oscillator frequency

Correct Answer: A

Detailed Solution:

When SM0 is set to 0 and SM1 is set to 0, the 8-bit UART mode of serial communication is
selected. In this mode, the baud rate is equal to 1/12 of oscillator frequency.

QUESTION 14:
What is the baud rate of serial communication in the 8051 microcontroller when SM0 is set to 0, SM1 is
set to 1 and SMOD is set to 1?

A. 1/12 of oscillator frequency


B. 1/32 of oscillator frequency
C. 1/64 of oscillator frequency
D. oscillator frequency

Correct Answer: B
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

Detailed Solution:

The Baud rate is programmed to 1/32 of oscillator frequency. Because of mode 2 with
SMOD=1.

QUESTION 15:
Which of the following bit activates idle mode in 8051?

A. PCON.7
B. PCON.6
C. PCON.1
D. PCON.0

Correct Answer: D

Detailed Solution:

************END*******

You might also like