0% found this document useful (0 votes)
35 views5 pages

Question Bank

The document is a comprehensive question bank focused on microcontrollers, specifically the 8051 architecture, covering basic concepts, instruction sets, timers, interrupts, serial communication, interfacing, and advanced topics. It includes detailed explanations of the microcontroller's features, instructions, and applications in embedded systems. The content is structured in a question-and-answer format, making it a useful resource for learning and reference.

Uploaded by

Barik Pradeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views5 pages

Question Bank

The document is a comprehensive question bank focused on microcontrollers, specifically the 8051 architecture, covering basic concepts, instruction sets, timers, interrupts, serial communication, interfacing, and advanced topics. It includes detailed explanations of the microcontroller's features, instructions, and applications in embedded systems. The content is structured in a question-and-answer format, making it a useful resource for learning and reference.

Uploaded by

Barik Pradeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Viva Question Bank: Microcontrollers and Applications

(8051-Based)
Basic Concepts (1–25)

1. What is a microcontroller?
A microcontroller is a small computer on a single chip. It has a CPU, memory (RAM and ROM), and
input/output (I/O) ports to control devices in embedded systems like toys, appliances, or robots.
2. How is a microcontroller different from a microprocessor?
A microcontroller has built-in memory and I/O ports, making it ideal for specific tasks in embedded
systems. A microprocessor needs external memory and I/O components, used in general-purpose
systems like PCs.
3. What are the main uses of the 8051 microcontrollers?
The 8051 is used in automation (e.g., home appliances), embedded systems (e.g., sensors), and control
systems (e.g., motor control).
4. How many I/O ports does the 8051 have?
Four 8-bit ports: Port 0, Port 1, Port 2, and Port 3 (32 I/O lines total).
5. Which port handles both address and data?
Port 0 is used for multiplexed address and data when accessing external memory.
6. How many pins are on the 8051 microcontrollers?
40 pins, including power, ground, I/O, and control pins.
7. How much RAM does the 8051 have?
128 bytes of internal RAM for data storage.
8. How much ROM does the 8051 have?
4 KB of on-chip ROM (program memory) in the standard 8051.
9. Which pin resets the 8051?
Pin 9 (RST). A high signal for two machine cycles resets the microcontroller.
10. What does the ALE pin do?
Address Latch Enable (Pin 30) separates the address from the data on Port 0 during external memory
access.
11. What is the EA pin used for?
External Access (Pin 31): When high, the 8051 uses internal ROM; when low, it uses external ROM
for code.
12. What is the PSEN pin?
Program Store Enable (Pin 29) reads program code from external ROM.
13. Which instruction moves data between registers?
The MOV instruction (e.g., MOV R0, A moves data from Accumulator to R0).
14. Which instruction adds two numbers?
The ADD instruction (e.g., ADD A, R1 adds R1 to the Accumulator).
15. Name two arithmetic instructions.
ADD (addition) and SUBB (subtract with borrow).
16. Name two logical instructions.
ANL (logical AND) and ORL (logical OR).
17. Which instruction flips the bits in the Accumulator?
CPL A (complements the Accumulator, e.g., 1010 becomes 0101).
18. What does the Stack Pointer do?
The Stack Pointer (SP) points to the top of the stack in RAM, used to store data or return addresses
temporarily.
19. What is the Stack Pointer’s value after reset?
07H (points to address 07H in RAM).
20. Which register holds immediate data?
The Accumulator (A) often holds immediate data for operations.
21. What provides the clock for the 8051?
An external crystal oscillator, typically 11.0592 MHz, connected to pins 18 and 19 (XTAL1 and
XTAL2).
22. What is the Program Counter (PC)?
A 16-bit register that holds the address of the next instruction to execute.
23. What’s the difference between on-chip and off-chip memory?
On-chip memory (RAM/ROM) is inside the 8051; off-chip memory is external and connected via ports
and control pins.
Viva Question Bank: Microcontrollers and Applications
(8051-Based)
24. What is the DPTR register?
The Data Pointer (DPTR) is a 16-bit register used to address external memory or code memory.
25. What happens when the 8051 is powered on or reset?
The Program Counter resets to 0000H, and the microcontroller starts executing code from the reset
vector.

Instruction Set & Assembly (26–50)

26. Which instruction loads a register with a constant value?


MOV Rn, #data (e.g., MOV R0, #25H loads 25H into R0).
27. What does the MOVX instruction do?
MOVX transfers data between the Accumulator and external RAM.
28. What does the MOVC instruction do?
MOVC copies data from code memory (ROM) to the Accumulator.
29. How are MOV and MOVX different?
MOV works with internal RAM or registers; MOVX works with external RAM.
30. What does the INC instruction do?
INC increases a register or memory value by 1 (e.g., INC R0).
31. Which instruction multiplies numbers?
MUL AB multiplies the Accumulator (A) and B register.
32. Where is the result of MUL AB stored?
The 16-bit result is stored in A (lower byte) and B (upper byte).
33. What does the DIV AB instruction do?
Divides A by B; quotient is stored in A, remainder in B.
34. What is the CJNE instruction?
Compare and Jump if Not Equal compares two values and jumps if they differ.
35. What does the DJNZ instruction do?
Decrements a register and jumps if the result is not zero.
36. What is a subroutine?
A reusable block of code called from the main program to perform a task.
37. What does the LCALL instruction do?
Long Call – calls a subroutine anywhere in the 64KB code memory.
38. How do you return from a subroutine?
Use the RET instruction to return to the calling program.
39. What’s the difference between RET and RETI?
RET returns from a subroutine; RETI returns from an interrupt and re-enables interrupts.
40. What is the SJMP instruction?
Short Jump – jumps to an address within -128 to +127 bytes from the current position.
41. What is the AJMP instruction?
Absolute Jump – jumps within a 2KB block of code memory.
42. What is the LJMP instruction?
Long Jump – jumps anywhere in the 64KB code memory.
43. What is the range of an SJMP jump?
-128 to +127 bytes relative to the current Program Counter.
44. Why use the NOP instruction?
No Operation – does nothing, used for timing delays or placeholders.
45. What does CLR A do?
Clears the Accumulator to 00H.
46. What does the XCH instruction do?
Exchanges the Accumulator’s contents with a register or memory (e.g., XCH A, R0).
47. What does the SWAP instruction do?
Swaps the upper and lower 4 bits (nibbles) of the Accumulator.
48. What does the PUSH instruction do?
Stores a register’s value on the stack and increases the Stack Pointer.
49. What does the POP instruction do?
Retrieves a value from the stack to a register and decreases the Stack Pointer.
50. What’s the difference between JZ and JNZ?
JZ (Jump if Zero) jumps if the Accumulator is 0; JNZ (Jump if Not Zero) jumps if it’s not 0.
Viva Question Bank: Microcontrollers and Applications
(8051-Based)
Timers, Interrupts, and Serial Communication (51–75)

51. How many timers does the 8051 have?


Two 16-bit timers: Timer 0 and Timer 1.
52. What is the size of a timer register?
16 bits, split into two 8-bit registers (THx for high byte, TLx for low byte).
53. What are the timer modes in 8051?
Mode 0 (13-bit timer), Mode 1 (16-bit timer), Mode 2 (8-bit auto-reload), Mode 3 (split timer).
54. Which register sets the timer mode?
TMOD (Timer Mode register).
55. Which register controls timer start/stop?
TCON (Timer Control register).
56. How many interrupts does the 8051 support?
Five: two external (INT0, INT1), two timer (TF0, TF1), and one serial (TI/RI).
57. What types of interrupts does the 8051 have?
External, Timer, Serial, and Reset interrupts.
58. How do you enable interrupts?
Use SETB EA (Enable All) in the IE register to allow interrupts.
59. What does the IE register do?
Interrupt Enable register – turns specific interrupts on or off.
60. How are interrupt priorities set?
Using the IP (Interrupt Priority) register to assign high or low priority.
61. How many serial ports does the 8051 have?
One full-duplex serial port (can send and receive data simultaneously).
62. What is the SBUF register?
Serial Buffer – holds data for sending or receiving via the serial port.
63. Which register configures serial communication?
SCON (Serial Control register).
64. Which timer sets the serial baud rate?
Timer 1, typically in Mode 2 (auto-reload).
65. What is the TI flag?
Transmit Interrupt flag – set when data transmission is complete.
66. What is the RI flag?
Receive Interrupt flag – set when data is received.
67. What is a baud rate?
The speed of serial data transfer, measured in bits per second (bps).
68. What is full-duplex communication?
Sending and receiving data at the same time.
69. What is half-duplex communication?
Sending and receiving data one at a time, not simultaneously.
70. How do you set up serial communication in 8051?
Configure TMOD (for Timer 1 mode), TH1 (for baud rate), SCON (for serial mode), and set TR1 to
start Timer 1.
71. How is the baud rate calculated for serial communication?
Baud Rate = (Oscillator Frequency / (32 × (256 – TH1))) for Timer 1 in Mode 2.
72. What are the TF0 and TF1 flags?
Timer Overflow flags – TF0 (Timer 0) and TF1 (Timer 1) are set when the timer overflows.
73. What is Timer Mode 2?
8-bit auto-reload mode – the timer reloads a preset value automatically after overflow.
74. What’s the difference between polling and interrupts?
Polling checks for events in a loop; interrupts let the CPU respond to events instantly.
75. What is the interrupt vector address for Timer 0?
000BH (where the Timer 0 interrupt service routine starts).

Interfacing and Applications (76–100)

76. Which port is typically used for LCD data?


Port 1 or Port 2, due to their simple I/O capabilities.
Viva Question Bank: Microcontrollers and Applications
(8051-Based)
77. Which pins control an LCD?
RS (Register Select), RW (Read/Write), and EN (Enable).
78. What command clears an LCD screen?
0x01 (sent as a command to the LCD).
79. What modes does an LCD support?
4-bit mode (uses 4 data lines) and 8-bit mode (uses 8 data lines).
80. What does the RS pin do on an LCD?
Selects command (RS=0) or data (RS=1) mode.
81. What is the RW pin on an LCD?
Read/Write: RW=0 to write to the LCD, RW=1 to read from it.
82. What does the EN pin do on an LCD?
Enable – a high-to-low pulse latches data or commands into the LCD.
83. How many keys are in a 4x4 keypad?
16 keys (4 rows × 4 columns).
84. How does a matrix keypad detect a key press?
Scans rows (set as outputs) and reads columns (set as inputs) to find the pressed key.
85. What is key debouncing?
Filtering out multiple signals from a single key press due to mechanical bouncing.
86. What is a sensor?
A device that detects changes (e.g., temperature, light) and outputs a signal.
87. What is an ADC?
Analog-to-Digital Converter – turns analog signals (e.g., from sensors) into digital values.
88. Why is an ADC needed with the 8051?
The 8051 processes digital signals, but sensors often produce analog signals.
89. Which ADCs are commonly used with the 8051?
ADC0804 (single channel) or ADC0808 (8-channel).
90. How do you control a motor with the 8051?
Use a motor driver like L293D or ULN2003 to interface the 8051’s low-power signals with the motor.
91. What is PWM?
Pulse Width Modulation – controls power to devices (e.g., motor speed) by varying the duty cycle of a
square wave.
92. What is EEPROM?
Electrically Erasable Programmable Read-Only Memory – non-volatile memory for data storage.
93. How is EEPROM connected to the 8051?
Using serial protocols like I2C or SPI.
94. What is the I2C protocol?
A two-wire serial protocol (SCL for clock, SDA for data) for connecting devices.
95. Which pins are used for I2C on the 8051?
Any two port pins (e.g., P1.0 for SDA, P1.1 for SCL), configured via software.
96. What is the SPI protocol?
Serial Peripheral Interface – a four-wire protocol (MOSI, MISO, SCLK, CS) for high-speed
communication.
97. How is a 7-segment display connected to the 8051?
Connect segment pins to a port (e.g., P1) and use multiplexing for multiple digits.
98. What does a relay do in 8051 projects?
A relay switches high-power devices (e.g., motors) using low-power signals from the 8051.
99. How do you connect an LED to the 8051?
Connect the LED to a port pin with a current-limiting resistor, and set the pin as output.
100. Why use pull-up resistors with 8051 ports?
Pull-up resistors (e.g., on Port 0) ensure a stable high signal when pins are used as inputs or outputs.

Miscellaneous and Advanced (101–125)

101. What is the typical clock frequency of the 8051?


11.0592 MHz, commonly used for accurate serial communication.
102. Why is 11.0592 MHz preferred?
It allows precise baud rates (e.g., 9600 bps) for serial communication with standard timers.
Viva Question Bank: Microcontrollers and Applications
(8051-Based)
103. What are Special Function Registers (SFRs)?
Registers that control the 8051’s peripherals, like timers, ports, and serial communication.
104. Name five SFRs in the 8051.
Accumulator (A), B, PSW (Program Status Word), TMOD (Timer Mode), SCON (Serial Control).
105. What is bit-addressable memory?
Memory where each bit can be set, cleared, or tested individually.
106. Which parts of the 8051 are bit-addressable?
All four ports (P0–P3), some RAM (20H–2FH), and certain SFRs (e.g., PSW).
107. What is the PSW register?
Program Status Word – holds flags like Carry (CY) and Overflow (OV) to show operation results.
108. Name two flags in the PSW.
CY (Carry flag) and OV (Overflow flag).
109. How many bits are in the Accumulator?
8 bits.
110. How many registers are in each register bank?
8 registers (R0–R7) per bank.
111. How many register banks does the 8051 have?
Four banks (Bank 0–3), selected via PSW bits.
112. What is the internal RAM address range?
00H to 7FH (128 bytes).
113. What is the B register used for?
Holds data for multiplication (MUL AB) and division (DIV AB) operations.
114. How do you clear the B register?
Use CLR B to set it to 00H.
115. What is external RAM?
Additional RAM connected outside the 8051 for extra data storage.
116. How do you access external RAM?
Use the MOVX instruction with DPTR or R0/R1 as the address.
117. What is the code memory address range?
0000H to FFFFH (up to 64KB).
118. Can the 8051 use both internal and external ROM?
Yes, internal ROM is used when EA is high; external ROM is used when EA is low.
119. How do you clear a specific bit?
Use CLR bit (e.g., CLR P1.0 clears bit 0 of Port 1).
120. How do you set a specific bit?
Use SETB bit (e.g., SETB P1.0 sets bit 0 of Port 1).
121. What does the PCON register do?
Power Control register – manages power modes (idle, power-down) and serial baud rate doubling.
122. What’s the difference between idle and power-down modes?
Idle mode stops the CPU but keeps peripherals running; power-down mode stops the oscillator for
maximum power saving.
123. How does the RST pin work?
A high signal on Pin 9 (RST) for two machine cycles resets the 8051.
124. How long is a machine cycle in the 8051?
12 clock cycles (e.g., 1.085 µs at 11.0592 MHz).
125. Why is bit-addressable memory useful?
It allows direct control of individual bits (e.g., for LEDs or switches), saving memory and simplifying
code.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy