You are on page 1of 11

THE OPEN UNIVERSITY OF SRI LANKA

Faculty of Engineering Technology


Department of Electrical and Computer Engineering
Bachelor of Technology – Level 04
Course Information Sheet (2020/2021)

EEX4436 – Microprocessors and Interfacing


Target Group:
Students who are readying for the Degree in Engineering Technology

Course Aims:
To provide background knowledge to build simple microprocessor-based systems.

Course Outcomes:

 Describe the software design with an assembly language and/or a high-level language for typical embedded
systems applications using modern tools and development and debugging approaches.
 Demonstrate digital interfacing using parallel and asynchronous/synchronous serial techniques incorporating
typical on-chip modules such as general-purpose I/O, timers, and serial communication modules.
 Describe the use of the periodic interrupts, waveform generation, time measurement in microcontroller-based
systems.
 Demonstrate analogue interfacing using analogue-to-digital and digital-to-analogue converters connected to
sensors and actuators.
 Design a microcontroller-based system for a real-world application fulfilling the given specifications.

Outline Syllabus:

 Microprocessors and Microcontrollers


 Overview of Microprocessors and Microcontrollers
 Characteristics of microprocessors and microcontrollers
 Hardware overview of microcontroller-based systems
 Software tools for microcontroller-based systems
 Software design for microcontroller-based systems

 Inputs and outputs


 Input and output peripherals
 Memory system design
 Different I/O configurations of a microcontroller
 Polled driven and interrupt-driven programming

 Timers and counters


 Timers and counters
 Time measurement and programming of the hardware timers
 Design procedures and algorithms for the microcontroller-based applications.

 Communication
 Parallel I/O versus serial I/O
 Asynchronous serial interface
 Synchronous serial interface
 Controller area network and applications

1 ECX4436 Microprocessors and Interfacing


 Sensors and actuators
 Sensors and interfacing
 Actuators and interfacing

 Microcontroller based system design


 Mixed-signal interfacing techniques
 Controlling mixed-signal circuits
 Design of data acquisition systems
 Microcontroller based system design

Laboratory Work:
1. Demonstrate the functionalities of the microcontroller development board using the self-test method.
2. Demonstrate the basic interfacing techniques using mixed-signal circuits, I/O peripherals, sensors and actuators.
3. Implement a designed system using a microcontroller development board as a prototype model

Design Project
 Apply microcontroller-based systems design concepts in the real-world application
 Analysis of design parameters to design microcontroller-based systems.

Learning activities
 Two home-based Tutor Marked Assignments (TMA’S)
 Design project
 One CAT Test
 Three lab classes in six days

You are required to prepare two home TMAs and a design project report. These should be prepared individually, although
you are encouraged to form discussion groups and discuss the issues among yourselves whenever possible. Plagiarism (that
is, presenting other’s work as your own) will not be tolerated and will be reflected in the grade of all parties involved. After
each lab classes, a viva voce examination will be held. Further Oral evaluation (VIVA) will be there for each TMA and
design project.

There will be one CAT (Continuous Assessment Test). The CAT will be OPEN BOOK type, where you are allowed to
refer to any materials during the test.

There are seven activities in this course. two TMAs, a design project, Three Lab Sessions and One CAT

Laboratory:
At the time of registration, you are supposed to assign yourself to a particular lab group. If you are not assigned to a group
yet, please contact the course coordinator and get a group.

When you come to the LAB, you should bring the soft copy of the ALP (Assembly Language Program) that you have
written for each TMA.

Day Schools:
There will be six dayschools in both Colombo and Kandy regional centres. Please attend the first day of school without
fail. The first day school will be an introductory session for the course.

Course Components:
At the time of registration, you should receive the following:
 ECX4436 Microprocessors and Interfacing Laboratory Experiment Book (Lab manual).

Prerequisites:
EEX3510(P), MHZ3531(P), DMX3511(P),[ {ECX3233(EL) OR EEX3533(CA)} ,[[{ECX3150(EL) OR EEX3350(CA)}
,{ECX4150(EL) OR EEX4350(CA) OR EEX4351(CR)}]OR EEX3530(P)]]OR[{MEX3272(EL) OR DMX3572(CA)}
OR{MEX3274(EL) OR DMX3574(CA) }

2 ECX4436 Microprocessors and Interfacing


Eligibility:
The best six of the seven activities will be considered towards the continuous assessment mark.

CA Final = Average Best 6 of (2 TMA,1Design Project, 3 lab sessions, 1 CAT)


Lab Average = average of (3 lab sessions)

Eligibility = CA Final ≥ 40% AND Lab Average ≥ 40% AND Design Project ≥ 40

Final Examination:
There will be a three hour CLOSED BOOK type test at which you are not allowed any reference materials.

Recommended Readings:

 What Every Engineer should know about Micro-Computers


Hardware/Software Design a Step-by-step Example
(William S. Bennett and Carl F. Evert, Jr.)

 The 8051 Microcontroller and Embedded System Using Assembly and C


Second Edition
Prentice-Hall India
(Muhammed Ali Mazidi, Junice Gillispie Mazidi, Rolin D. Mckinlay)

 8051 Microcontrollers
MSC51 Family and Its Variants
Oxford University Press
(Satish Shah)

Online resources

1. Moodle online class is available for this course.


Web Address: https://learnousl.ou.ac.lk
Username: ‘s’ number given in the student record book
Password: National Identity card number (with Capital V)

2. You can access the Google Drive folder, which has valuable resources for this course. You can get access to google
drive by joining the following google group.
https://groups.google.com/g/eex4436_2021/

3. FB Group - https://www.facebook.com/groups/ECX4236/

Contacts:
S-mail: - The Course Coordinator, ECX4436 Microprocessors and Interfacing,
Department of Electrical and Computer Engineering, the Open University of Sri Lanka
P.O. Box 21, Nawala, Nugegoda, Sri Lanka.

E-mail: - CJ Basnayakage - cjbas@ou.ac.lk Phone: - Direct: +94 11 288 1437 (or Ext: 437)
DS Wickramasinghe – dswic@ou.ac.lk

3 ECX4436 Microprocessors and Interfacing


Tutor Marked Assignment #1 2021
 Use the ASM51 Assembler and the 8052 simulators (or MCU8051IDE) to verify your ALP.
 Submit your written assignment on or before the due date given in the activity diary. Late
submissions will not be accepted!
 You should be prepared to face a viva voce examination based on TMA #1 during the first
laboratory session.

[Q1]
(a) Briefly explains three reasons for the importance of micro controllers-based systems
(b) Compare and contrast three architectures in Microcontrollers.
(c) Briefly describe how you (as an engineer) benefits from microcontrollers-based systems,
according to your study field (Ex. Electrical, Electronic, Mechanical, Mechatronics, and
Computer).
(d) List the standards applicable to the serial communication protocols with their usage/applications.

[Q2]
(a) List down the software and hardware tools that help to develop 8051 based microcontroller
systems and state their usage in embedded system designs.

(b) List down the different manufacturers that produce 8051 derivatives with their proprietor names
with cost.

(c) Compare and contrast the followings with the 8051 microcontrollers (choose a microcontroller
from each category)

1. Arduino 3. FPGA
2. PIC 4. ARM

(Consider the I/O, Memory, ADC/DAC, Serial Communication, Availability, Cost, ISA, Forums
and Online Supports, Applications, Register Structure, CPU Features, Peripheral Subsystems. etc.
in your comparison)

(d) By giving examples, compare and contrast the low-level languages (Ex. Assembly etc.) and the
high-level languages (Ex. Visual C/Basic etc.) for programming of the microcontroller-based
systems

[Q3]
(a) By giving sample ALP, explain all addressing modes in the 8051 Microcontroller.
(b) Explain the Fetch-Execution cycle with necessary diagram and assembly codes.
(c) Write ALP for following cases,
a. Write a program to read Port 1 and wait until bit 3 of the port 1 is low. When Low is
detected, on bit, 3 set all port pin High on port 3.
b. Write a program to convert a gray code number into binary.

4 ECX4436 Microprocessors and Interfacing


Tutor Marked Assignment #1 2021
c. Write assembly language statements to simulate following C statements.
i. if I >= 6
x = x+7;
else
x =x*x;

(d) Draw a simple block diagram by specifying the available types of memory in 8051
microcontrollers and clearly mention the area belongs to each type of memory.

(e) Write the differences between each type of memory and write an ALP to access each memory
segment.

(f) Briefly describe the “Lookup Tables” by giving an example with ALP.

(g) Compare hardware and software polling. Briefly explain the differences between interrupts and
Polling by giving an example with ALP.

[Q4]
(a) Briefly describe the importance of the following regarding the microprocessor.
i. Timers.
ii. Counters.
(b) Explain the operation of watch dog timer in microcontrollers.

(c) Write an ALP to generate a digital pulse with the delay given below.
i. Using Software Delay Loops
ii. Using 8051 Timers

(Note: Assume delay time as last 5 digits of your registration number in microseconds)

[Q5] During the pandemic, hand sanitisers become popular. Search how automatic hand sanitisers
are working. (Analyse sensors, actuators and controlling mechanism)

5 ECX4436 Microprocessors and Interfacing


Tutor Marked Assignment #2 2021
 Use the ASM51 Assembler and the MCU8051IDE/8052 simulator to verify your ALP.
 Submit your written assignment on or before 8th Nov 2021.
 You should be prepared to face a viva voce examination based on TMA #2.

[Q1]

(a) There are four types of DC motors, namely Permanent magnet, series, shunt and compound
DC motors. Tabulate characteristics and application of each motor type.

(b) How to determine the direction of rotation in a Stepper motor and a DC motor?

(c) Choose one type of stepper motor that you identified in Q1. (a).

i. Design a small apparatus for rotating the stepper motor clockwise, anticlockwise,
measure the RPM after pressing correspondent switches, and draw the connection
diagram of your apparatus.
ii. Explain the interfacing devices that you have used in your design.
iii. Write an ALP of your design.

(d) Explain a mechanism to control the speed of a DC motor 25%, 50% and 75% of its full
speed and draw the output waveform.

(e) Write an ALP to control the speed of a DC motor 25%, 50% and 75% of its full speed
according to the mechanism that you explain in Q1. (d).

[Q2]

(a) List the available analogue to digital converter (ADC), digital to analogue converter (DAC) with
specifications in the market. (I.e. Manufacturer, Part No, resolution, cost, interfacing mechanism,
sampling speed etc.)

(b) The n-bit R/2R digital-to-analogue converter (DAC) has a reference of 16 V, and the analogue
output for the input code 1 is 15.625 mV. Find the digital input value for the output 9.140625 V.

(c) An 8-bit A/D converter device is to be interfaced with an 8051 microcomputer. Refer to Figure 1.
When the SOC (Start of Conversion) Signal is high, the conversion process starts. The EOC (End
of Conversion) line goes low when conversion data is available. The EOC line should be used to
interrupt the 8051 microcontroller.

6 ECX4436 Microprocessors and Interfacing


Tutor Marked Assignment #2 2021

Vref

8-bit digital
A/D output
Analog Input (Vin)
Converter

SOC

EOC

Figure 1

1) With the aid of a block diagram, show how this device can be interfaced to the 8051. Clearly
show your calculations and assumptions to use DAC used in question b to set the
ADC reference voltage 10 V.
2) Draw flowchart to capture 250 data samples from the A/D converter and store this data in
External Data memory.
3) Write an ALP to the above algorithm. The program is to be interrupt-driven.

[Q3]
(a) Briefly explains the Synchronous and Asynchronous communication in serial
communication with examples.
(b)
i. Draw the framing structure of the asynchronous serial data frame.
ii. What is known as “Baud Rate”?
iii. State three baud rates, which are commonly used in a serial data transfer?
iv. Calculate the timer values for the above mentioned (Q3 I c) baud rates.
(Assume crystal frequency as 11.0592MHz).
v. In a certain experiment, a student has the crystal frequency as 11.0592MHz,
and he set the variable baud rate to 4800. Find out the Timer value of the
experiment.

(c) Write an ALP to send a string “@DEG 90” to a PC through serial communication every X
milliseconds of the 8051 microcontroller (where X is your first digit of registration number).
Use 9600bps, 8 data bits, 1 start bit, 1 stop bit and no parity bits for the communication.
(Assume that the PC will receive data without any error)

[Q4]

(a) You are expected to search the internet and find the suitable devices (sensors, transducers
and/or actuators) that need to be interfaced with 8051 for the following. Justify your
answers.

i. To detect whether an object is moving or not.


ii. To measure the weight of an object.
iii. To check whether there is an object availability in a point.
iv. To check whether there is an obstacle within a certain area or not

7 ECX4436 Microprocessors and Interfacing


Tutor Marked Assignment #2 2021

(b) List the model or type, measurement range can be made, accuracy, price, and the type of
the output signal of the devices mentioned above in Q4. (a)

(c) Draw simple block diagrams to depict how to interface the sensors, transducers and/or the
actuators mentioned above in Q4. (a) with 8051

[05]

Study about “Electronic Hand Sanitizers” on the internet and identify main electronic units in the
system. Explain the operation of each unit with simple diagrams of the system.

8 ECX4436 Microprocessors and Interfacing


DESIGN PROJECT 2021
 Use the ASM51 Assembler and the MCU8051IDE/8052 simulator to verify your ALP.
 Submit your written assignment on or before 18th Nov 2021. Late submissions will not be
accepted!
 During the third laboratory session, you should be prepared to face a viva voce examination
based on the design project.

Electronic Hand Sanitizer (EHS)


The following description is about a part of an Electronic Hand Sanitizer (EHS), which is used
for cleaning human hands with liquid soap and water owing to the COVID-19 pandemic
(epidemic).
You are required to analyse and design the EHS (Figure 1) according to the given requirements.

Figure 1 shows the major components of the EHS. The EHS consists of two liquid storage
containers to store water and liquid soap and a Hot Air blower to produce hot air for dry human
hands after washing. Three electro-mechanical valves, V1, V2 and V3, control the liquids and hot
airflow. The hot air blower is driven by the DC motor M1 and the heater provides the necessary
temperature to outflow air. There is a switch to ON and OFF the EHS and alarm to indicate the
emptiness of the two containers. LED 1 and LED 2 indicate whether the water storage and liquid
soap are empty, respectively.

When the switch is ON, the EHS initialises the system itself and gets ready for its sanitising
operations. The hand sanitising process starts when there is enough water in the water storage and
liquid soap in the cylinder. If there is no water or liquid soap (empty), then the alarm should be
activated. The DC Motor M1 runs at an 80% duty cycle, and the heater maintains a 500C
temperature to produce hot air. When a human hand reaches the cleaning point, the electro-
mechanical valves are operated according to the following sequence (i.e. 1 to 7).

1. V1 opens for 1 second and closes it.


2. V2 opens for 1 second and closes it.

9 ECX4436 Microprocessors and Interfacing


DESIGN PROJECT 2021
Wait for 20 seconds.
4. V1 opens for 20 seconds and close it.
5. V3 opens for 10 seconds while M1 is running and heater, providing the expected temperature
at the same time.
6. V3 closes.
7. When the process is completed, beep the alarm for 2 Seconds. Then the system goes to the
initial state.

State all the assumptions clearly (if any) when answering questions.

[Q1]
(i) For the proposed mechanism, identify suitable sensors and actuators to detect the
following and draw simple diagrams for each to explain your methodology.
a. To identify the status of water storage and liquid soap cylinders (Empty or
not)
b. To identify the presence of a human hand in the cleaning point.
c. To measure and maintain 500C temperature.

(ii) List four (4) features required in a microcontroller for this application and provide
proper justification for each.

[Q2]
(i) Analysis of the given specifications/parameters related to the operations/processes of
the EHS and then prepare a Table of resources/features and conditions/constraints
required to design the EHS. (Table should contain, Processes, Sub-Operations,
Parameters, Conditions, Resources, Feature Required of 8051 microcontrollers, and
Comments).

(ii) Draw the external view of the system, i.e. A diagram that shows the inputs/sensors
and the outputs/actuators of the system.

(iii)Identify the sub units/sub modules of the system and draw the interconnected block
diagram of the system using the central controller and other required interfacing
devices.

[Q3] Draw a schematic diagram of the system. Clearly show each electronic
components/module. Use any suitable software tools to create a schematic diagram.

[Q4] Draw flowchart(s) to represent the algorithm of the EHS operation. Clearly show the
port mapping of the 8051 microcontrollers. (i.e. Mark the pin connection of each sensor
and actuators used in the EHS).

10 ECX4436 Microprocessors and Interfacing


DESIGN PROJECT 2021
[Q5] Write assembly language programs (ALP) to perform the above task. (i.e. Q4). Clearly
show the assembly language routines with comments and relation with the flowcharts
drawn in above Q4.

[Q6] Identify the design issues and the necessary improvements of your design.

[Q7] Is it possible to implement your design on an ASIC (Application Specific Integrated


Circuit)? Justify your answer?

[Q8] List the ethical, social issues/considerations of your design.

11 ECX4436 Microprocessors and Interfacing

You might also like