You are on page 1of 4

Date of Examination : 11/11/2021

AHSANULLAHUNIVERSITY OF SCIENCE AND TECHNOLOGY


Department : Electrical and Electronic Engineering
Program :Bachelor of Science in Electrical and Electronic Engineering
Semester Final Examination, Fall – 2020, Course number :EEE 3209

Time: 2 (Two) Hours


Year : 3rd Semester : 2nd
Course Name: Microprocessor Interfacing and System Design Full Marks: 50

`General Instructions for the students (read carefully).


i. The examination will start at 9:00 AM and continue upto 11:00 PM (2 Hours). The student must
upload the PDF file using Google Form (provided in Google Class room) by 11:30 PM.
ii You must write the following information at the top page of each answer script:

Department: Program:
Course no: Course Title:
Examination: Semester (Session):
Student ID: Signature and Date:
iii. Answer script must be hand written and must be written in A4 size white paper. Students must
submit the hard copies of the answer script.
iv. Write down Student ID, Course number, and put your signature on top of every single page of the
answer script.
v. Fill up the Google Form using institutional E-mail within the allocated time. Upload the scan copy
of your answer scripts in PDF format. There must be single PDF file for each answer script.
vi. Student must avoid plagiarism, maintain academic integrity, and ethics. Students are not allowed
to take any help from another individual and if taken so can result in stern disciplinary actions
from the university authority.
vii. Students will get chance once and only once for submitting the answer scripts. Necessary
charts/tables are attached at the end of the question paper
viii. PDF file size of the answer script should be less than (or equal to) 1 GB. Student may use „Cam
scanner‟ or „Adobe scan‟ apps for scanning the handwritten answer sheet. . Uploading clear and
readable scan copy is your responsibility and must cover the full page of your answer script

ix Before uploading rename the PDF files accordingly, such as:


CourseNo_StudentID.pdf
For example:
EEE 3209_1801050.pdf

There are 5(five) questions. Answer any 4 (four) questions.


Numbers on the right side of each question indicate marks. Symbols have their usual meaning. Fill the top-
page of the answer-script according to the provided template in Google Class room.
`

1 (a) (i) Draw Layout Diagram for the Serial Monitor of the Arduino IDE and then label its various fields. [2]
(ii) Briefly describe the functions of the various options of the “Line ending tab” of Serial Monitor. [1.5]
(b) (i) Draw block diagrams with address range for the three kinds of memory spaces of ATmega328P [2]
Microcontroller.

1/4
(ii) Create a sketch to save the number 13.67 into the internal EEPROM of ATmega328P MCU using [1.5]
write() method and then read it back using read() method to show on Serial Monitor.
(c) Create a sketch for the following circuit (Fig.1(c)) using while-do structure so that the LED keeps [5.5]
blinking at 1-sec interval whenever K1 is closed and remains closed.

Figure for question 1(c)


2 (a) Write down the tasks that are being carried out when the following codes are executed: [4]
analogReference(DEFAULT);
unsigned int x = analogRead(A3);

(b) Draw sketches for both Sender and Receiver of the following circuit (Fig.2(b)) to accomplish these [4]
tasks: Sender will acquire wiper voltage of Pot and will show on SM1 with 2-digit precision. After that,
the value will be sent to Receiver over the SUART(5, 6) port for onward display on SM2.

Figure for question 2(b)

(c) (i) Draw a neat connection diagram between UNO-Master and NANO-Slave(0x23) using I2C Bus. [2]
(ii) Create sketch to Roll the I2C Slave (0x23) with diagnostic messages; send 0x1234 to the Slave; [2.5]
request for 5 bytes data from Slave and show them on Serial Monitor of Master.

3 (a) Prepare sketches for both Master and Slave of the following circuit (Fig.3(a)) to transfer 0x1234 from [5]
Master to Slave and 0x5678 from Slave to Master at 1 MBits/sec. The UNOs will show the received data
on SMs.

Figure for question 3(a)

(b) Refer to the below diagram (Fig.3(b)), prepare sketch so that the UNO responds to the Rising Edge of [4]
the incoming signal at DPin-2 and then turn ONL (built-in LED of UNO).

2/4
R1A Arduino UNO
L
GND
1k 13

5V
b7 b1 b0
ISC01 ISC00 EICRA
1, 1
Button
2
RE INTF0

Rpd
4.7k b7 b0
INTF0 EIFR
GND
risingEdeDPin2

Figure for question 3(b)


(c) ATmega328P
tc1a
System Clock Prescaler TC1 Clock Prescaler 15 8 7 0 flag
Interrupt Logic [3.5]
TOIE1 I

TOV1
fosc /1 clkSYS STOP clkTC1
ISR(TIMER1_OVF_vect)
XT! 16 MHz 16 MHz /1
9
/2 /8
/4 /64 TCNT1H TCNT1L
16 MHz

Global Interrupt
Oscillator

/8 /256
Y1

Enable Switch
Internal
Crystal

/16 /1024 TC1 = TCNT1


/32 Local Interrupt Enable
10 XT2
/64 Switch ISR Rountine
/128
/256 L
DPin-13
DPin-5

PB5 19 GND
CLKPR TCCR1B RN2A = 1k
11 T1 (PD5) External Pulse

Figure for question 3(c)


Referring to above figure 3(c), create sketch so that the L (built-in LED of UNO) blinks at 2-sec interval
on interrupt basis.

4 (a) Given below the timing diagram of DSFPWM Signal (Fig.4(a)). Briefly describe its working principle. [4.5]
TCNT1 TC1 Count line
Full Count =
0x10000
MAX Count
0xFFFF
ICF1
ICR1(0xyyyy) C TOP CountF1
ICR1(0xzzzz) C’ TOP CountF2
OCR1A (0xnnnn) B D B D
BOTTOM TOV1
Count A OCF1A OCF1A
t
0 OFF E E’
V Time OFF
(DPin-9) Time
OC1A/PWM On On
(invert) Time Time
t

One Period (old) One Period (new)


pwmMode10Invert

Figure for question 4(a)

(b) Read the following diagram carefully and then answer to the questions:

3/4
(i) Write codes to set the present time and date taking it from the PC and then issue commands to [2.5]
read hour, minute, and second to show on SM.
(ii) The above clock system can be used to detect the presence of an unauthorized person in the room, [2]
who will press on micro switch K1 to interrupt the MCU. Write codes to save the Time of
intruder‟s entrance into the EEPROM of the RTC Module.
(c)

(i) Draw connection diagram (usingnecessary 3.3V/5V Level Sifters) between the above 3.3V supply [2]
and 3.3V logic BME280 Sensor and the 5V UNO for I2C Bus Operation.
(ii) [1.5]
myData[0]
myData[1]
myData[1]

From the above temperature resister layout diagram of DS18B20 sensor, find expression for float
myTempvariable when the resolution is 11-bit.

5 (a) Within 1st 2Km Zone Outside 1st 2Km Zone d-drive [4.5]

A B
40.00 42.40 44.80 DFM (Tk)
0.00 2.00 2.20 DDM (km)
0.00 0.00 0.00 DWM (MS)

Draw Flow Chart for the above D-drive journey of a Taxi Meter. Given:
Flat Fare for the first 2 km journey: Tk 40.00. Distance update by 10m.
Price update: Tk 2.40 for each 200m after first 2km of journey.
(b) Describe the purposes of the following Library Functions with examples:
(i) strtoul(arg1, arg2, arg3); [2]
(ii) atof(); [2]
(c) Read the following Class named AirPumpand then answer to the questions:
class AirPump
{
private:
intrelayPin; //this is DPin to drive relay

public:
AirPump(intDPin):relayPin(DPin){} //constructor that always comes with data type/tag
void varSetup(); //function to initialize variables
void pumpON(); //function/method to turn on Air Pump
void pumpOFF(); //function/method to turn off Air Pump
};

(i) What is the role of the class keyword? [1]


(ii) Write codes to declare an object named Pump1 and then apply the method pumpON(). [1.5]
(iii) Write codes to define the method pumpON( ). [1.5]

4/4

You might also like