IoT and Embedded Systems Viva Questions with Answers (LPC2148 Based)
GENERAL IOT & EMBEDDED SYSTEMS (THEORY)
1. What is the role of PLL in LPC2148?
PLL (Phase Locked Loop) increases the internal system clock frequency from the external oscillator
for faster processing.
2. What is VPBDIV and its significance?
VPBDIV determines the peripheral clock (PCLK) frequency relative to CPU clock (CCLK), typically PCLK
= CCLK, CCLK/2, or CCLK/4.
3. Difference between UART, SPI, and I2C?
• UART: Serial, asynchronous, 2 wires (TX, RX)
• SPI: Synchronous, full duplex, 4 wires (MISO, MOSI, SCLK, SS)
• I2C: Synchronous, half duplex, 2 wires (SCL, SDA), supports multiple masters/slaves.
4. What are the different types of memory in LPC2148?
Flash (program), SRAM (data), peripheral memory (registers), stack memory.
5. What is GPIO and how is it configured?
General Purpose Input Output. Use IOxDIR to set direction, IOxSET/CLR to write, IOxPIN to read.
6. What is the use of DACR register?
It holds the digital value (10-bit) that is converted to analog voltage by DAC.
7. How does an interrupt differ from polling?
Polling continuously checks a flag; interrupts automatically invoke ISR on an event.
PROGRAM-WISE VIVA (WITH INTERFACING)
1. Elevator Interface
Q: Which GPIO pins are used?
P0.16–P0.23 for LEDs, P1.16–P1.19 for key detection.
Q: How is latch clearing done?
By setting CLR pins low and then high.
Q: What is IO0CLR = 0x00F00000 for?
To clear P0.20 to P0.23 pins used to reset latches.
2. Seven Segment Display
Q: Why strobe signal needed?
To latch the shifted data from shift register to output.
Q: What happens if delay is not given after strobe?
Improper display; data may not latch correctly.
Q: How is “HELP” displayed?
Each character’s 7-segment code is sent using serial shifting into cascaded shift registers.
3. Stepper Motor Interface
Q: Steps for full rotation?
200 steps; step angle = 1.8°.
Q: Direction control?
By reversing the sequence of excitation (clockwise or counterclockwise).
Q: Role of ULN2803?
It acts as a driver circuit to power the motor from microcontroller output.
4. DAC Waveform Generation
Q: Why use lookup table?
To avoid run-time computation and reduce CPU load.
Q: What is resolution of DAC?
10-bit resolution; output range 0 to 3.3V.
Q: How is sine wave generated?
Values calculated using formula: 512 + 511 * sin(θ).
5. Matrix Keyboard Interface
Q: How does scanning work?
Apply ‘0’ to each row one by one, check for ‘0’ on columns.
Q: What is key bouncing?
Physical contacts may oscillate; handled with delay (debouncing).
Q: Role of lookup table?
Maps row-col position to ASCII value.
6. DC Motor with PWM
Q: How is speed controlled?
Using PWM duty cycle.
Q: Role of ADC?
Reads analog voltage (potentiometer) to adjust duty cycle.
Q: Function of PWMMR0 and PWMMR6?
PWMMR0 sets total period; PWMMR6 sets ON time.
7. LCD Display Interface
Q: Interface mode?
4-bit nibble mode using D4-D7 lines.
Q: Commands to initialize LCD?
0x28 (Function Set), 0x0C (Display ON), 0x01 (Clear).
Q: How to display on 2nd/3rd/4th line?
Use DDRAM address: 0xC0 (2nd), 0x94 (3rd), 0xD4 (4th).
ADVANCED/ARM-SPECIFIC QUESTIONS
1. What is a barrel shifter?
Hardware unit in ARM for efficient bit shifts during instruction execution.
2. What does MOV and MVN do?
MOV copies value; MVN copies bitwise NOT of the value.
3. What are conditional codes in ARM?
EQ, NE, GT, LT, used to execute instructions based on flag status.
4. Use of LDR and STR?
LDR loads from memory to register; STR stores from register to memory.
5. What is CPSR?
Current Program Status Register; holds flag and mode info.
HIGH-YIELD TRICK QUESTIONS
Q: What happens if PLL is not locked?
System clock becomes unstable.
Q: How to generate exact 1 ms delay?
Using calibrated nested loops or hardware timer configured for 1 ms.
Q: How is ADC result read?
From bits 6–15 of ADCxGDR register.
Q: Why debounce is necessary in switches?
To avoid false multiple triggering.
Q: What is the range of ADC?
0–1023 (10-bit), corresponds to 0—3.3V.
Q: Use of SystemInit()?
Configures PLL, sets VPBDIV, and prepares the system clock.
Prepared by: Denish
Subject: IoT and Embedded Systems Lab Viva (CS344AI)