Timers and Counters: A. 1 / 10 B. 1 / 12 C. 1 / 15 D. 1 / 20
Timers and Counters: A. 1 / 10 B. 1 / 12 C. 1 / 15 D. 1 / 20
a. 1 / 10
b. 1 / 12
c. 1 / 15
d. 1 / 20
ANSWER: b. 1 / 12
2. Which special function register play a vital role in the timer/counter mode
selection process by allocating the bits in it?
a. TMOD
b. TCON
c. SCON
d. PCON
ANSWER: a. TMOD
3. How many machine cycle/s is / are executed by the counters in 8051 in order
to detect '1' to '0' transition at the external pin?
a. One
b. Two
c. Four
d. Eight
ANSWER: b. Two
4. Which bit must be set in TCON register in order to start the 'Timer 0' while
operating in 'Mode 0'?
a. TR0
b. TF0
c. IT0
d. IE0
ANSWER: a. TR0
a. TR1
b. External input at (INT1)
c. TF1
d. All of the above
ANSWER: b. External input at (INT1)
6. Which timer mode exhibit the necessity to generate the interrupt by setting
EA bit in IE enhancing the program counter to jump to another vector
location?
a. Mode 0
b. Mode 1
c. Mode 2
d. Mode 3
ANSWER: b. Mode 1
MOV SP, # 54 H
MOV TMOD ,# 0010 0000 C
SET C ET1
SETC TR0
SJMP $
Which among the below mentioned program segments represent the correct
code ?
a. MOV SP, # 54 H
MOV TCON ,# 0010 0000 C
SETC ET1
SETC TR0
SJMP $
c. MOV SP, # 54 H
MOV TMOD ,# 0010 0000 C
SETC ET1
SETC TR1
SETC EA
SJMP $
d. MOV SP, # 54 H
MOV TMOD ,# 0010 0000 C
SETC ET0
SETC TR1
SETC EA
SJMP $
a. 125 μ s
b. 250 μ s
c. 256 μ s
d. 1200 μ s
ANSWER: c. 256 μ s
a. 6, 5, 2, 4, 1, 3
b. 6, 1, 3, 2, 4, 5
c. 6, 5, 4, 3, 2, 1
d. 6, 2, 4, 5, 1, 3
ANSWER: b. 6, 1, 3,2, 4, 5
13. 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
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).
15. 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
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.
16. 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
Answer: b
Explanation: When any timer is to turn on, then firstly we have to load the
TMOD register and the count. Then timer is to get started. After then, we need
to monitor the timer properly and then when the roll over condition arises then
timer is to be stopped.
17. 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
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.
18. 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
Answer: a
Explanation: Hex value that is being loaded in the TH1 register is the two’s
complement of the value being loaded in it.
SERIAL COMMUNICATION
1. Why is it not necessary to specify the baud rate to be equal to the number of
bits per second?
A. Because each bit is preceded by a start bit & followed by one stop bit
B. Because each byte is preceded by a start byte & followed by one stop byte
C. Because each byte is preceded by a start bit & followed by one stop bit
D. Because each bit is preceded by a start byte &followed by one stop byte
ANSWER: C. Because each byte is preceded by a start bit & followed by one
stop bit
2. Which factor/s is/are supposed to have the equal values at both phases of
transmission and reception levels with an intimation of error-free serial
communication?
a. Baud Rate
b. Number of data bits & stop bits
c. Status of Parity bits
d. All of the above
ANSWER: d. All of the above
3. Which bits exhibit and signify the termination phase of the character
transmission and reception in SCON special function register?
a. Control bits
b. Status bits
c. Both a & b
d. None of the above
4. Which two bits are supposed to be analyzed / tested for unity value (1) in
SCON for the reception of byte in mode 1 serial communication ?
a. RI & TI
b. REN & RB8
c. RI & REN
d. TI & RB8
ANSWER: c. RI & REN
a. 8 bits
b. 10 bits
c. 11 bits
d. 12 bits
ANSWER: b. 10 bits
6. Which pin in the shift register mode (Mode 0) of serial communication allow
the data transmission as well as reception?
a. TXD
b. RXD
c. RB8
d. REN
ANSWER: b. RXD
7. How is the baud rate determined on the basis of system clock frequency (f sc)
in accordance to mode '0' of serial communication?
a. (oscillator frequency) / 12
b. [2SMOD / 32] x (oscillator frequency) / [12 x (256 – (TH1) ]
c. [2SMOD / 64] x (oscillator frequency)
d. 2SMOD / 32 x (Timer 1 overflow rate)
a. Modes 0 & 1
b. Modes 1 & 2
c. Modes 2 & 3
d. All of the above
9. How does it become possible for 9th bit to differentiate the address byte from
the data byte during the data transmission process in multiprocessor
communication?
a. By recognizing 9th bit as '1' for address byte & '0' for data byte
b. By recognizing 9th bit as '0' for address byte & '1' for data byte
c. By recognizing 9th bit as '1' for address as well as data bytes
d. By recognizing 9th bit as '0' for address as well as data bytes
ANSWER: a. By recognizing 9th bit as '1' for address byte & '0' for data byte
10. Which byte has the capability to interrupt the slave when SM2 bit is
assigned to be '1' after the initialization process in the multiprocessor mode of
communication?
a. Address byte
b. Data byte
c. Both a & b
d. None of the above
11. Which devices are specifically being used for converting serial to parallel
and from parallel to serial respectively?
a) timers
b) counters
c) registers
d) serial communication
Answer: c
Explanation: Some registers like parallel in serial out and serial in parallel out
are used to convert serial data into parallel and vice versa respectively.
13. Which of the following best describes the use of framing in asynchronous
means of communication?
a) it binds the data properly
b) it tells us about the start and stop of the data to be transmitted or received
c) it is used for error checking
d) it is used for flow control
Answer: b
Explanation: In data framing in asynchronous means of communication, the
data is packed between the start and the stop bit. This is done so as to tell the
other computer about the start and the end of the data.
15. Which of the following is the logic level understood by the micro-
controller/micro-processor?
a) TTL logic level
b) RS232 logic level
c) None of the mentioned
d) Both of the mentioned
Answer: a
Explanation: TTL logic or the transistor transistor logic level is the logic that is
understood by the micro-controllers/microprocessors.
17. Which of the following best states the reason that why baud rate is
mentioned in serial communication?
a) to know about the no of bits being transmitted per second
b) to make the two devices compatible with each other, so that the transmission
becomes easy and error free
c) to use Timer 1
d) for wasting memory
Answer: b
Explanation: To make two devices compatible with each other baud rate is
mentioned in the serial communication so that the transmission becomes easy
and error free.
18. With what frequency UART operates (where f denoted the crystal
frequency)?
a) f/12
b) f/32
c) f/144
d) f/384
Answer: d
Explanation: UART frequency is the crystal frequency f/12 divided by 32 that
comes out to be f/384.
25. The task of converting the byte into serial form and transmitting it bit by bit
along with start, stop and parity bits is carried out by
a) reception unit
b) serial communication unit
c) transmission unit
d) all of the mentioned
Answer: c
Explanation: the serial communication unit consists of transmission unit and
reception unit. The task of converting the byte into serial form and transmitting
it bit by bit along with start, stop and parity bits is carried out by transmission
unit.
26. The transmission unit does not require assistance from processor if once a
byte for transmission is written to
a) SCON register
b) SBUF register
c) SFR address
d) Any of the mentioned
Answer: b
Explanation: once a byte for transmission is written to the serial buffer(SBUF)
register, the transmission unit does not require assistance from processor.
27. The common unit shared by the receiver unit and transmission unit of
serial communication unit is
a) SCON(Serial Port Control) Register
b) SBUF(Serial Buffer) register
c) 8-bit serial data interface
d) All of the mentioned
Answer: d
Explanation: The transmission unit and receiver unit both are controlled by
using a common SCON(Serial Port Control) Register. Also both units share a
common serial buffer(SBUF) register which is a common 8-bit serial data
interface.
28. During serial reception, the buffer that receives serial bits and converts to
a byte is
a) receive buffer 0
b) receive buffer 1
c) receive buffer 2
d) none
Answer: b
Explanation: During serial reception, the receive buffer 1 receives serial bits
and converts to a byte, it then transfers the received parallel byte in receive
buffer 2.
32. The mode that offers the most secured parity enabled data communication
at lower baud rates is
a) mode 2
b) mode 1
c) mode 0
d) all of the mentioned
Answer: a
Explanation: The mode 3 offers the most secured parity enabled data
communication at lower baud rates of mode 1.
INTERRUPT PROGRAMMING
a. Edge - Triggering
b. Level Triggering
c. Both a & b
d. None of the above
3. Which among the below mentioned reasons is / are responsible for the
generation of Serial Port Interrupt?
A. Overflow of timer/counter 1
B. High to low transition on pin INT1
C. High to low transition on pin INT0
D. Setting of either TI or RI flag
a. A & B
b. Only B
c. C& D
d. Only D
ANSWER: d. Only D
4. How does the processor respond to an occurrence of the interrupt?
a. Scalar
b. Vector
c. Register
d. All of the above
ANSWER: b. Vector
6. 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
9. EA bit is used to
a) enable or disable external interrupts
b) enable or disable internal interrupts
c) enable or disable all the interrupts
d) none of the mentioned
Answer: c
Explanation: Using EA bit, all the interrupts can be enabled or disabled. Using
the individual respective bit, the respective interrupt can be enabled or
disabled.
10. The number of priority levels that each interrupt of 8051 have is
a) 1
b) 2
c) 3
d) 4
Answer: b
Explanation: Each interrupt level of 8051 can have two levels of priority namely
level 0 and level 1. Level 1 is considered as a higher priority level compared to
level 0.
11. The priority level of interrupt of 8051 for which SI(serial interrupt) interrupt
is programmed is
a) level 0
b) level 1
c) level 0 or level 1
d) none
Answer: b
Explanation: SI interrupt is programmed for level 1 priority.
12. The interrupt bit that when set works at level 1, and otherwise at level 0 is
a) PT1
b) PT0
c) PX1
d) All of the mentioned
Answer: d
Explanation: The bits, PT1, PT0, PX0 and PX1 when set, work at level 1,
otherwise at level 0.
13. All the interrupts at level 1 are polled in the second clock cycle of the
a) forth T state
b) fifth T state
c) third T state
d) none
Answer: b
Explanation: All the interrupts at level 1 are polled or sensed in the second
clock cycle of the fifth T state or 9th clock cycle out of 12 clock cycles. Then
all the interrupts at level 0 are also polled in the same cycle.
14. The minimum duration of the active low interrupt pulse for being sensed
without being lost must be
a) greater than one machine cycle
b) equal to one machine cycle
c) greater than 2 machine cycles
d) equal to 2 machine cycles
Answer: b
Explanation: The minimum duration of the active low interrupt pulse should be
equal to the duration of one machine cycle for being sensed, else it will be
lost.
15. If two interrupts, of higher priority and lower priority occur simultaneously,
then the service provided is for
a) interrupt of lower priority
b) interrupt of higher priority
c) lower & higher priority interrupts
d) none of the mentioned
Answer: b
Explanation: If two interrupts, occur simultaneously, then the one with higher
priority level and early polling sequence will receive service. The other one
with lower priority may get lost there, as there is no mechanism for storing the
interrupt requests.
17. The service to an interrupt will be delayed if it appears during the execution
of
a) RETI instruction
b) Instruction that writes to IE register
c) Instruction that writes to IP register
d) All of the mentioned
Answer: d
Explanation: The service to an interrupt will be delayed if it appears during the
execution of RETI instruction or the instruction that writes to IE/IP registers.
18. When any interrupt is enabled, then where the pointer moves does
immediately after this interrupt has occurred?
a) to the next instruction which is to be executed
b) to the first instruction of ISR
c) to the first location of the memory called the interrupt vector table
d) to the end of the program
Answer: c
Explanation: When any interrupt is enabled, then it goes to the vector table
where the address of the ISR is placed.
19. What are the contents of the IE register, when the interrupt of the memory
location 0x00 is caused?
a) 0xFFH
b) 0x00H
c) 0x10H
d) 0xF0H
Answer: b
Explanation: When interrupt of 0x00 is caused (the reset interrupt) then all the
other interrupts will be disabled or the contents of the IE register becomes
null.
20. After RETI instruction is executed then the pointer will move to which
location in the program?
a) next interrupt of the interrupt vector table
b) next instruction of the program after the IE instruction
c) next instruction after the RETI in the memory
d) none of the mentioned
Answer: b
Explanation: When the RETI instruction is executed, it will execute the
instruction present at the top of the stack (which is the PC’s value i.e after the
interrupt enable instruction).
21. Which pin of the external hardware is said to exhibit INT0 interrupt?
a) pin no 10
b) pin no 11
c) pin no 12
d) pin no 13
Answer: c
Explanation: INT0 interrupt is caused when pin no 12 in the hardware of the
8051 controller is enabled with a low levelled pulse.
23. Which of the following combination is the best to enable the external
hardware interrupt 0 of the IE register (assuming initially all bits of the IE
register are zero)?
a) EX0=1
b) EA=1
c) any of the mentioned
d) both of the mentioned
Answer: d
Explanation: For executing the EX0 interrupt, the EX0 and EA bits of the IE
register should be set. EA is set to enable all the interrupts and EX0 is set to
enable the external hardware interrupt 0 interrupt and mask the other enabled
interrupts.
24. Why normally LJMP instructions are the topmost lines of the ISR?
a) so as to jump to some other location where there is a wider space of memory
available to write the codes
b) so as to avoid overwriting of other interrupt instructions
c) both of the mentioned
d) none of the mentioned
Answer: c
Explanation: There is a small space of memory present in the vector table
between two different interrupts so in order to avoid overwriting of other
interrupts we normally jump to other locations where a wide range of space is
available.
25. Which register is used to make the pulse a level or an edge triggered
pulse?
a) TCON
b) IE
c) IPR
d) SCON
Answer: a
Explanation: TCON register is used to make any pulse level or edge triggered
one.
27. What is the correct order of priority that is set after a controller gets reset?
a) TxD/RxD > T1 > T0 >EX1 > EX0
b) TxD/RxD < T1 < T0<EX1 < EX0
c) EX0 > T0 > EX1 >T1> TxD/RxD
d) EX0 < T0 < EX1 < T1 < TxD/RxD
Answer: c
Explanation: EX0 >T0 > EX1> T1>TxD/RxD. This is the correct order of priority
that is set after a controller gets reset.