0% found this document useful (0 votes)
2 views

EEE ECE365 Final Exam Summer 2021

This document outlines the final examination for the Microprocessor & Interfacing course at BRAC University, Summer 2021. It includes instructions for submission, a time limit, and a total of four questions covering topics such as timer configuration, ultrasonic sensor interfacing, H-bridge operation, and data frame formation. Each question requires calculations, programming tasks, and explanations related to the ATmega32 microcontroller.
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)
2 views

EEE ECE365 Final Exam Summer 2021

This document outlines the final examination for the Microprocessor & Interfacing course at BRAC University, Summer 2021. It includes instructions for submission, a time limit, and a total of four questions covering topics such as timer configuration, ultrasonic sensor interfacing, H-bridge operation, and data frame formation. Each question requires calculations, programming tasks, and explanations related to the ATmega32 microcontroller.
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/ 3

BRAC UNIVERSITY

EEE/ECE 365: Microprocessor & Interfacing


Final Examination, Summer 2021

N.B.
a. Your answers need to be hand-written, and you have to submit a single PDF file.
b. Answer all questions.
c. The right margin of each question indicates allocated marks.
d. Some required Registers’ bit patterns are attached (Page 3).

Time: 1 Hour 40 Minutes (Writing) + 20 Minutes (Submission) Full Marks: 70

1. With an ATmega32 of 8 MHz operating frequency, an Engineer wants to generate


a square wave having a frequency of 365 Hz using Timer2. The signal should be
generated automatically without any interrupt in the program.
(5)
a. Show the calculation of obtaining a minimum Prescaler value and value
to be stored in the relevant output compare register.
b. Write an embedded C program to generate the mentioned signal. (10)

2. Consider an ultrasonic proximity sensor installed on a vehicle to warn the driver


of any other vehicle coming close to it. The sensor generates a maximum of 2.5V
for a distance of 10m (meter) and 0V for 0m distance.

The sensor is interfaced with the ADC module, channel 4 of 16 MHz ATmega32
to measure the distance and generate an appropriate signal using an LED
connected to the microcontroller to warn the driver.

a. For maximum accuracy in ATmega32 ADC, what should be the value of (1+3)
ADC operating frequency, and to achieve below or equal to that frequency
what should be the Prescaler value in ADC?

b. Calculate the step size in Volt and the conversion factor in m/Volt. (4)

c. Write an embedded C program that will read the sensor output and convert (8+6)
that into the distance. If the measured distance is less than 10m, the

1/3
system will turn ON the LED, if the distance is less than 6m, it will cause
the LED to blink with a time interval of 1s, and if the distance goes below
3m, it will cause the LED to blink with a time interval of 0.1s.

Use the internal reference voltage for data conversion and right adjustment
to store the data. Use the delay() function to generate the required time
delays.

3. a. Explain the operation mechanism of the H-bridge in a DC motor driver with an (5)
appropriate diagram.

b. Mention two differences between a DC Motor and a Servo Motor. (2)

c. A servo motor needs to be rotated from 0 to 90 degree and back to 0 degree (13)
using two switches, Switch 1 and Switch 2, connected to an Atmega32
microcontroller.

Write an embedded C program so that the servo motor rotates gradually from
0 to +90 degree when Switch 1 is pressed, and then rotates back to 0 degree
when Switch 2 is pressed.

Consider the required PWM signal has a time period of 10 ms, a minimum on-
time of 1ms for 0 degree position, and a maximum on time of 2ms for +90 degree
position. The rotation needs to be performed gradually with a ’for’ loop. Consider
the operating frequency of ATmega32 as 8 MHz and a Prescaler of 1:8.

4. a. What is a data frame? How is it formed? (1+3)

b. To have a 9600 Baud rate, calculate the decimal value of UBRR for an (2)
ATmega32 operating at 8 MHz.

c. Show the settings of the registers UCSRA, UCSRB, UCSRC, and UBRR to
(7)
transmit 8-bit data, with two stop bits, and even parity at 9600 Baud rate.
Assume an operating frequency of 8 MHz.

2/3
TCCR1A

TCCR1B

TCCR2

ADMUX

ADCSRA

UCSRA

UCSRB

UCSRC

This portion is for the purpose of CO assessments, applicable to course teachers.


CO Question CEP

CO1 2(a), 2(b), 3(a), 3(b), 4 P1, P3, P7

CO2 2(c), 3(c) P1, P3, P7

3/3

You might also like