1. What are the main features of an 8051 microcontroller?
Answer:
The 8051 microcontroller has the following features:
- 8-bit CPU optimized for Boolean operations.
- 4 KB on-chip ROM (program memory).
- 128 bytes of on-chip RAM (data memory).
- Four 8-bit I/O ports (P0, P1, P2, P3).
- Two 16-bit timers/counters (Timer 0 and Timer 1).
- Full-duplex serial port (UART).
- 64 KB external memory addressability for program and data.
- Five interrupt sources (2 external, 2 timer, 1 serial).
- Bit-addressable memory (for Boolean operations).
Example: The 8051 can perform hardware multiplication/division in 4 μs.
2. Differentiate between microprocessor and microcontroller.
| Microprocessor | Microcontroller |
|---|---|
| Only contains CPU (ALU, registers, control unit). | Integrates CPU, RAM, ROM, I/O, timers, and peripherals. |
| Requires external peripherals (RAM, ROM, I/O). | All peripherals are on-chip. |
| Used in general-purpose computing (e.g., PCs). | Used in embedded systems (e.g., washing machines). |
| Higher power consumption. | Low power consumption. |
| Example: Intel 8085. | Example: 8051. |
Reference: Page 1-2.
3. List the on-chip peripherals of 8051.
Answer:
The 8051 has the following on-chip peripherals:
- Two 16-bit timers/counters (Timer 0 and Timer 1).
- Serial communication port (UART).
- Four 8-bit I/O ports (P0, P1, P2, P3).
- Interrupt controller (5 interrupt sources).
- 128 bytes of RAM and 4 KB ROM.
Reference: Page 1-3.
4. What is meant by SFR in 8051? Explain with examples.
Answer:
- SFR (Special Function Registers) are dedicated registers in 8051 that control hardware operations like timers, serial communication, and I/O ports.
- They are located in the address range 80H to FFH.
Examples:
- ACC (Accumulator) – Used for arithmetic operations.
- TMOD (Timer Mode Register) – Configures timer modes.
- SCON (Serial Control Register) – Controls serial communication.
Reference: Page 1-7.
5. List the different types of 8051 addressing modes.
Answer:
The 8051 supports six addressing modes:
- Register Addressing (e.g.,
MOV A, R0). - Direct Addressing (e.g.,
MOV A, 30H). - Register Indirect Addressing (e.g.,
MOV A, @R1). - Immediate Addressing (e.g.,
MOV A, #25H). - Indexed Addressing (e.g.,
MOVC A, @A+DPTR). - Bit Addressing (e.g.,
SETB P1.0).
Reference: Page 2-2.
6. List the structure of 8051 PSW (Program Status Word).
| Bit | Flag | Function |
|---|---|---|
| PSW.7 | CY | Carry flag (used in arithmetic operations). |
| PSW.6 | AC | Auxiliary carry (for BCD operations). |
| PSW.5 | F0 | User-defined flag. |
| PSW.4, PSW.3 | RS1, RS0 | Register bank selection (Bank 0 to Bank 3). |
| PSW.2 | OV | Overflow flag (for signed arithmetic). |
| PSW.1 | - | Reserved. |
| PSW.0 | P | Parity flag (even parity for accumulator). |
Example: MOV PSW, #08H selects Register Bank 1.
Reference: Page 1-5.
7. List the interrupts available in 8051.
Answer:
The 8051 has five interrupt sources:
- External Interrupt 0 (INT0) – Triggered via P3.2.
- External Interrupt 1 (INT1) – Triggered via P3.3.
- Timer 0 Interrupt (TF0) – Generated when Timer 0 overflows.
- Timer 1 Interrupt (TF1) – Generated when Timer 1 overflows.
- Serial Port Interrupt (RI/TI) – Triggered on serial data transmission/reception.
Reference: Page 3-64.
8. Write short notes on 8051 timers.
Answer:
- The 8051 has two 16-bit timers (Timer 0 and Timer 1).
- Four Modes of Operation:
- Mode 0: 13-bit timer (5-bit prescaler).
- Mode 1: 16-bit timer (no prescaler).
- Mode 2: 8-bit auto-reload timer.
- Mode 3: Split timer mode (only for Timer 0).
- Applications: Delay generation, event counting, baud rate generation.
Example: MOV TMOD, #01H sets Timer 0 in Mode 1.
Reference: Page 3-25.
9. Write the functions of the following signals: ALE, EA, TXD, RXD.
Answer:
- ALE (Address Latch Enable) – Demultiplexes address/data bus (P0).
- EA (External Access) – If EA = 1, internal ROM is used; if EA = 0, external ROM is used.
- TXD (Transmit Data) – Serial data output (P3.1).
- RXD (Receive Data) – Serial data input (P3.0).
Reference: Page 1-10.
10. Write short notes on serial communication in 8051.
Answer:
- The 8051 has a full-duplex UART for serial communication.
- Modes:
- Mode 0 – Synchronous shift register (for I/O expansion).
- Mode 1 – 8-bit UART with variable baud rate.
- Mode 2 – 9-bit UART with fixed baud rate.
- Mode 3 – 9-bit UART with variable baud rate.
- Baud Rate: Controlled by Timer 1.
Example: MOV SCON, #50H configures serial port in Mode 1.
Reference: Page 3-50.
11. What is the use of Bluetooth in embedded systems?
Answer:
- Bluetooth is used for short-range wireless communication (up to 100m).
- Applications:
- Wireless sensor networks.
- Home automation (smart bulbs, locks).
- Health monitoring (wearable devices).
Example: A Bluetooth module (HC-05) interfaces with 8051 for wireless data transfer.
Reference: Page 6-6.
12. Differentiate between GSM and GPS.
| GSM | GPS |
|---|---|
| Used for cellular communication (voice/data). | Used for satellite-based navigation. |
| Operates on 900/1800 MHz bands. | Uses satellite signals (L1 band: 1575.42 MHz). |
| Example: Sending SMS via SIM800 module. | Example: Tracking vehicle location. |
Reference: Page 6-20 (GPS), Page 6-21 (GSM).
13. Why are communication APIs required in IoT system design?
Answer:
- APIs (Application Programming Interfaces) enable standardized communication between IoT devices and cloud platforms.
- Functions:
- Data exchange (e.g., REST API for HTTP requests).
- Device management (e.g., MQTT for sensor data).
Example: GET /api/temperature fetches temperature data from a cloud server.
Reference: Page 6-4.
14. Define: AUC, EIR, VLR, HLR.
Answer:
- AUC (Authentication Center) – Verifies SIM card authenticity.
- EIR (Equipment Identity Register) – Tracks valid/invalid mobile devices.
- VLR (Visitor Location Register) – Stores temporary subscriber data.
- HLR (Home Location Register) – Stores permanent subscriber data.
Reference: Page 6-24.
15. Write the topologies of Bluetooth.
Answer:
Bluetooth supports three topologies:
- Piconet – 1 master + 7 slaves (e.g., smartphone connected to headphones).
- Scatternet – Multiple interconnected piconets.
- Broadcast – 1 master broadcasts to multiple slaves.
Reference: Page 6-6.
16. Why is BLE (Bluetooth Low Energy) required?
Answer:
- BLE consumes less power than classic Bluetooth.
- Applications:
- Wearable devices (e.g., fitness bands).
- IoT sensors (battery-operated).
Example: A BLE beacon in a smart retail store sends discount alerts.
Reference: Page 6-6.
17. Differentiate Zigbee and Bluetooth.
| Zigbee | Bluetooth |
|---|---|
| Low power, long-range (100m). | Short-range (10m). |
| Supports mesh networking. | Supports piconet/scatternet. |
| Used in industrial IoT. | Used in consumer devices. |
Reference: Page 6-9 (Zigbee), Page 6-6 (Bluetooth).
18. What is REST?
Answer:
- REST (Representational State Transfer) is an HTTP-based API architecture for IoT communication.
- Principles:
- Stateless communication.
- Uses GET, POST, PUT, DELETE methods.
Example: GET /api/devices retrieves a list of IoT devices.
Reference: Page 6-4.
19. What are PUT, GET, DELETE functions?
Answer:
- GET – Retrieves data (e.g.,
GET /api/temperature). - PUT – Updates data (e.g.,
PUT /api/led?state=ON). - DELETE – Removes data (e.g.,
DELETE /api/device/123).
Reference: Page 6-4.
20. Differentiate request-response model and publisher-subscriber model.
| Request-Response | Publisher-Subscriber |
|---|---|
| Client sends request, server responds (e.g., HTTP). | Publisher broadcasts data, subscribers receive (e.g., MQTT). |
| Synchronous. | Asynchronous. |
| Example: REST API. | Example: MQTT for sensor data. |
Reference: Page 6-4.







