Skip to content
EC-606 · MICROCONTROLLER & EMBEDDED SYSTEM LAB/Important Questions

MICROCONTROLLER & EMBEDDED SYSTEM LAB (EC-606) - Important Questions

  1. Unit 514 Marks High Priority

    Configure a 16-bit hardware timer to generate an interrupt every 1 ms on a microcontroller with oscillator frequency $f_{osc}$ and a programmable prescaler $P$. Derive the expression for the required number of timer ticks $N_{ticks}$ and the 16-bit initial timer value $T_{init}$. Use the formula $N_{ticks} = f_{osc}\times\frac{1}{P}\times T_{int}$. For $T_{int}=1\,\text{ms}$, express $T_{init}$ in terms of $f_{osc}$ and $P$. Finally, outline the steps of the ISR (interrupt service routine) to toggle an output pin.

    Core practical calculation and timer configuration problem; tests ability to compute timer reload values and write ISR code.

  2. Unit 510 Marks High Priority

    Explain the principle of PWM generation using a timer/counter. Derive the relation between duty cycle $D$ and the timer compare register value $C$ for a timer with top value $T_{top}$: $D=\frac{C}{T_{top}}\times100\%$. Given $T_{top}=\left(2^{n}-1\right)$ for an $n$-bit timer, calculate the compare value required for $D=37\%$ on an 8-bit timer and show how you would program the compare register.

    Standard PWM calculation and register programming; common lab exercise for motor/LED control.

  3. Unit 510 Marks High Priority

    A microcontroller has an $n$-bit ADC with reference voltage $V_{ref}$. Derive the expression for the ADC step size $V_{step}$ and write the formula to convert an ADC digital value $N$ to the measured voltage $V_{in}$. Use the expression $V_{step}=\frac{V_{ref}}{2^{n}}$. If $n=12$ and $V_{ref}=3.3\,\text{V}$, compute $V_{step}$ and the analog voltage corresponding to $N=2048$.

    ADC fundamentals and interfacing calculations; core practical for sensor data acquisition.

  4. Unit 57 Marks High Priority

    Explain the I2C bus protocol for a master write followed by a repeated-start read from a slave. In your answer, clearly state the sequence of START, address, ACK/NACK, data and STOP conditions, and indicate how a repeated START differs from a STOP+START. Sketch pseudo-code (or API calls) for a microcontroller to write one byte to register $R$ of a slave with 7-bit address $A$ and then read two bytes from the same register using a repeated START.

    I2C master/slave communication sequence and practical implementation; frequently asked in lab exams.

  5. Unit 57 Marks Medium Priority

    Describe the SPI serial communication timing with respect to clock polarity (CPOL) and clock phase (CPHA). Explain how the four SPI modes (Mode 0..3) affect the sampling edge and clock idle level. For a given peripheral that requires data to be sampled on the rising edge of an idle-low clock, identify the SPI mode to be used and justify your answer.

    SPI modes and timing interpretation; important for correct peripheral interfacing.

  6. Unit 510 Marks Medium Priority

    Explain the advantages of using DMA (Direct Memory Access) in embedded applications. Describe the typical steps required to configure DMA to transfer a block of data from an ADC peripheral data register to a RAM buffer of size $N$. Include discussion of source/destination address incrementing, transfer size, and how to detect transfer completion.

    DMA use-cases and programming model; assesses understanding of advanced peripheral data transfer.

  7. Unit 514 Marks High Priority

    Define the terms task, context switch, semaphore, and priority inversion in the context of a real-time operating system (RTOS). Using pseudo-code, design a solution for a producer-consumer problem where a sensor task (producer) produces data at irregular intervals and a processing task (consumer) processes the data. Use a counting semaphore and show how priority inversion can occur and how priority inheritance resolves it.

    RTOS constructs and synchronization primitives; key theoretical & practical question for multitasking embedded systems.

  8. Unit 57 Marks Medium Priority

    A battery-powered embedded node alternates between active mode with current $I_{active}$ and sleep mode with current $I_{sleep}$. If the node is active for $T_{active}$ seconds every $T_{period}$ seconds, derive the average current $I_{avg}$ using $I_{avg}=\frac{I_{active}\times T_{active}+I_{sleep}\times\left(T_{period}-T_{active}\right)}{T_{period}}$. For $I_{active}=25\,\text{mA}$, $I_{sleep}=50\,\mu\text{A}$, $T_{active}=100\,\text{ms}$ and $T_{period}=10\,\text{s}$, compute $I_{avg}$ and estimate battery life for a $2000\,\text{mAh}$ battery.

    Power management calculation; practical for battery-powered embedded system design.

  9. Unit 57 Marks Medium Priority

    Describe the function of JTAG/SWD in embedded debugging. List at least three features available through JTAG/SWD debuggers (e.g., breakpoints, watchpoints, single-stepping) and explain how hardware breakpoints differ from software breakpoints. Explain how SWD can be used to halt the CPU and inspect peripheral registers without modifying application code.

    Debugging tools and techniques; practical understanding of in-circuit debugging and trace.

  10. Unit 57 Marks Low Priority

    Explain the CAN bus frame structure including the arbitration field, control field, data field and CRC. Describe how the CAN protocol handles collisions and error detection. For a standard CAN 2.0A frame with an 11-bit identifier $ID$, explain how priority is determined among multiple transmitting nodes.

    Fieldbus (CAN) fundamentals and error handling; relevant for automotive/industrial embedded labs.

  11. Unit 510 Marks Medium Priority

    Design an embedded application to read an analog temperature sensor (output range $0$--$3.0\,\text{V}$) using the microcontroller ADC and to signal over UART whenever the temperature crosses a threshold $T_{th}$. Describe ADC configuration (sampling time, resolution), threshold detection algorithm (include hysteresis to avoid chattering), and whether polling or interrupt-driven approach you would use. Provide pseudo-code for the interrupt handler or task that implements the threshold detection and UART notification.

    Sensor interfacing combining ADC and interrupts; practical integrated lab assignment.

  12. Unit 57 Marks Low Priority

    Explain how a Real Time Clock (RTC) module in microcontrollers keeps track of time. Describe common sources of timekeeping error and methods to calibrate an RTC (e.g., crystal trimming or software compensation). If an RTC crystal has a frequency error of $\Delta f$ relative to nominal $f_{nom}$, derive the fractional time error per day.

    RTC interfacing, timekeeping accuracy and calibration; common lab topic for systems requiring time stamps.

Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in