Assignment 7 Solution
Assignment 7 Solution
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:
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:
3. 10 ms / 1.085 μs = 9216
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:
______________________________________________________________________
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:
QUESTION 7:
Identify priority of interrupts after the following instruction is executed?
MOV IP,#10h
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.
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
Correct Answer: B
Detailed Solution:
QUESTION 9:
Default priority order of 8051 _________________.
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
Timer 0 000Bh
Timer 1 001Bh
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?
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?
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*******