Вы находитесь на странице: 1из 10

THE OPEN UNIVERSITY OF SRI LANKA

Faculty of Engineering Technology


Department of Electrical and Computer Engineering
Diploma in Technology Level 04
Course Information and Tutor Marked Assignments (2014/2015)

ECX4236 Microprocessors and Interfacing

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

Aims and Objectives:


This course provides the background knowledge necessary to build interfaces to a simple microprocessor based
system.

After studying this course, you are expected to achieve the following:

Be able to identify the programming model of a microprocessor/ microcontroller.


Ability to use the Instruction Set Architecture (ISA) to perform
o Arithmetic / Logic Operations.
o Data / Control Transfer Operations.
o Input / output Operations.
Describe the role of a computer simulator in program development and the ability to use such a
simulator.
Describe the purpose and use the following basic components of the 8051 architecture.
o Special Function Registers (SFR)
o Register Banks
o Interrupts
o Timers / Counters
o Serial Communication
Ability to write programs in assembly language to perform a particular task using a microprocessor
/ microcontroller.
Know the difference between a microprocessor and a microcontroller.
Know the different types of applications for which microcontrollers are used.
Ability to use basic interfacing techniques to connect the microcontroller to the outside world.
Basic knowledge about the ASIC and HDL.

Prerequisites:
The prerequisite for this course is as listed in the Student Guide Book.

Course Components:
At the time of registration, you should receive the following:
ECX4236 Microprocessors and Interfacing Laboratory Experiment Book.
ECX4236 Supplementary Notes

This course does not have a predefined set of lessons as such, and you are expected to search and find the
relevant materials in the library and on the internet. Moodle online class is available for this subject. User ID is
your NIC number and password is s-user (If you need an enrolment key please email your request to the course
coordinator)

1 ECX4236 Microprocessors and Interfacing


Three home-based Tutor Marked Assignments (TMAs) will direct such reading. You are required to prepare
three home TMAs. 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 others work
as your own) will not be tolerated, and will be reflected in the grade of all parties involved. For each assignment,
a viva voce examination will be held during laboratory classes.

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

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

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

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


Lab Average = average of (3 lab sessions)

Eligibility = CA Final 40% AND Lab Average 40%

Final Examination:
There will be a three hour CLOSED BOOK type test at which you are not allowed any reference materials.
Day Schools:
There will be five day schools. Please attend the first day school without fail. The first day school will be held
on 08th November 2014 from 1500-1700 hours at the Colombo Regional Centre.

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, feel free to 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.

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)

Contacts:
S-mail: - The Course Coordinator, ECX4236 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: - cjbas@ou.ac.lk Phone: - Direct: +94 11 288 1437 (or Ext: 437)

2 ECX4236 Microprocessors and Interfacing


Tutor Marked Assignment #1 2014
Use the ASM51 Assembler and the 8052 simulator to verify your ALP.
Submit your written assignment on or before 12th December 2014 and 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.

[01]
(a) Calculate the total number of machine cycles and time taken to generate software delay,
( + ) microseconds; where will be last three digit of your registration number (Clearly
show your all calculation for R1, R2 and R3 values etc.). Attach the simulation results (screen
images) to prove your calculation by using 8051 simulator software (MCU 8051 IDE)

(b) Calculate a timer 0 value TH0 and TL0 to generate same delay that you have obtained in Q1. (a)
(Clearly draw a timer configuration diagram with values).

(c) By using the delay that you have obtained in Q1. (b), toggle the LED when push button switch is
pressed and stop when switch is released.

i. Draw a schematic diagram for your solution.


ii. Draw a flowchart for your algorithm.
iii. Write an ALP for your solution using a timer.
iv. Draw an Input and Output waveforms of the system.

(d) Explain the switch bounce caused in push button switch with I/O waveform.

(e) Suggest the hardware and software solutions to overcome the switch bounce condition.

(f) Modify your ALP written in Q1. (c). iii, to eliminate switch bounce using the solution that you
suggested in Q1. (e).
[Q2]
(a) Draw a simple block diagram by specifying the available types of memory in 8051
microcontroller and clearly mention the area belongs to each type of memory and ALP
commands for memory operations in each type.

(b) Compare and contrast XRAM and IRAM by using examples with ALP commands.

(c) Design a memory system for 8051 which require 32KB ROM and 16KB RAM using 2KB ROM chips
and 4KB RAM chips. State required width of the address bus, data bus and clearly show your
calculations and RD/WR and CS signals. Assume that the word length is 8 bit. State any other
assumptions.

(d) Draw a memory map for your design in Q2. (c) (Clearly show starting address, end address, and
address line values for each chip).

3 ECX4236 Microprocessors and Interfacing


Tutor Marked Assignment #1 2014
[Q3]
(a) List down the software tools that helps to develop 8051 based microcontroller systems and state
their usage in embedded system designs.

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

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

1. PIC 3. MSP430
2. Atmel ATMEGA 4. ARM

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

(d) By giving examples, compare and contrast the low level languages and the high level languages
for programming of the microcontroller based systems

[Q4]

(a) Briefly explain each function of the decoder, de-multiplexer, encoder and multiplexer using
block diagrams and truth tables.
(b) Draw flowcharts to demonstrate the functions of each device.
(c) Draw a block diagram to interface 16 push-button switches, 16 LED to 8051 microcontroller
using Q4. (a) Indicated devices. (You need to select appropriate device for optimum solution)
(d) Write an ALP to glow each LED if the relevant push-button is pressed.

[05]
Study the available sensors for very small and large distance measurement in the real world
application and list two sensors for each category with name, model, distance, cost etc.

4 ECX4236 Microprocessors and Interfacing


Tutor Marked Assignment #2 2014
Use the ASM51 Assembler and the 8052 simulator to verify your ALP.
Submit your written assignment on or before 06th February 2015 and late submissions will
not be accepted!
You should be prepared to face a viva voce examination based on TMA #2, during the
second laboratory session.
[Q1]

(a) Compare and contrast Stepper motor and servo motor.

(b) How to determine the rotation direction, rotation angle and rotation speed of a stepper
motor and a servo motor.

(c) Explain a mechanism to control the direction, angle and speed of a stepper motor and
draw an output waveform.

(d) Write an ALP to control the direction, angle and speed of a stepper motor according the
mechanism that you explained in Q1. (c).

[Q2]

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

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

(c) Draw a block diagram to interface an 8 bit ADC with 8051. Clearly show your calculations
and assumptions to use above DAC to set the ADC reference voltage 10 V and display the
result in three seven segment displays.

(d) Draw a flowchart to measure analog voltage 5 V using above ADC and DAC. Display the
result in three seven segment displays. Clearly show your calculations and assumptions.

(e) Write an ALP to implement your algorithm Q2. (d).

5 ECX4236 Microprocessors and Interfacing


Tutor Marked Assignment #2 2014
[Q3]

(a) In a serial communication experiment of 8051 microcontroller, a student set the crystal
frequency as 11.0592MHz and the variable baud rate is 9600. Find out the timer values of
the 8051 microcontroller for the experiment.

(b) Write an ALP to send a string @DEG 120 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)

(c) Draw a block diagram and explain how serial mode 3 can be used in multi device
communication. (Select number of devices as ( + ) where x is first digit of your
registration number)

(d) Draw a flow chart to send a string to any device in your multi device platform.

(e) Modify the ALP wrote in Q3. (b) to send the same string to any device in your multi device
platform.

[Q4]

(a) Briefly explain importance of the watchdog timers in the microcontroller based systems.

(b) A student is expecting to generate PWM signal. Duty cycle of the PWM signal may 25% or
50% or 75%. Assume frequency of the PWM signal is 40 kHz.
i. Sketch the wave form of the PWM signal for each of given duty cycles.
ii. Write an ALP to generate the PWM signal having 75% duty cycle using timer
interrupts.

[05]

Very briefly explain the operation of each sensors that you have identified in TMA #1, Q5,
with diagrams.

6 ECX4236 Microprocessors and Interfacing


Tutor Marked Assignment #3 2014
Use the ASM51 Assembler and the 8052 simulator to verify your ALP.
Submit your written assignment on or before 11th May 2015 and late submissions will not
be accepted!
You should be prepared to face a viva voce examination based on TMA #3, during the third
laboratory session.

Electronic Diameter Measuring System (EDMS)

The following description is about an Electronic Diameter Measuring System (EDMS) which is
used to measure the diameter of a metal ball. You are to analyze and design the requirements
for the EDMS (Figure 1) according to the 8051 microcontroller specifications.

Figure 1: Typical view of EDMS

The EDMS consists of a Diameter measuring unit, a Conveyor unit, a LED display panel, a
Start/Stop button panel and a 8051 microcontroller unit (8051 MCU) with a seven segment
display. The Conveyor unit which has only one motor (M1) rotating in one direction moves
the metal balls on to the diameter measuring unit. The Diameter measuring unit has a Linear
Variable Differential Transformer (LVDT) displacement sensor attached to the measuring bed.
The LED display panel has seven LEDs to show the classification of the metal ball (Table 1).
The 8051 MCU is used to connect all the modules in the system. In addition to that, the seven
segment display shows the diameter of each metal ball in millimeters and the Start/Stop
buttons are used for switching the system on or off.

7 ECX4236 Microprocessors and Interfacing


Tutor Marked Assignment #3 2014
When the EDMS starts, the motor M1 runs at 50% duty cycle to move the metal balls on to
the diameter measuring unit.

The EDMS will classify the metal balls according to the metal ball diameter. Assume that
acceptable diameter range of a metal ball is between 2mm and 6mm and the metal ball
diameter is a single digit integer (1 to 7). The classification values and LVDT output voltages
are shown in the Table 1 below.

Table 1: Classification of the ball diameter and LVDT output


LVDT Output Voltage
Classification Ball Diameter (mm)
(mV)
REJECT LOW 1 80
CLASS 2 LOW 2 160
CLASS 1 LOW 3 240
OK 4 320
CLASS 1 HIGH 5 400
CLASS 2 HIGH 6 480
REJECT HIGH 7 560

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

[Q1]

(i) Propose a mechanism to measure the diameter of the metal ball when it comes to
the measuring bed and release the result to the 8051 MCU before the next metal
ball arrives to the measuring bed with the help of the other sensors, actuators and
interfacing devices.
(ii) Find the resolution and the reference voltage ( ) of the Analog to Digital
Converter (ADC) which interfaces the LVDT and the 8051 MCU. Hence calculate
the equivalent digital values for the LVDT sensor.
(iii) Draw the external view of the system (i.e. a diagram that shows the inputs and the
outputs of the system).
(iv) 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.
(v) Draw a schematic diagram of the system

8 ECX4236 Microprocessors and Interfacing


Tutor Marked Assignment #3 2014
(vi) Draw a flowchart to represent an algorithm for the operations of the system.

(vii) Write an Assembly Language Program for the system.


(Clearly show assembly routines with comments)

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

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


Circuit)? Justify your answer?

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

9 ECX4236 Microprocessors and Interfacing


Laboratory Experiments 2014
Aim:

Study the AES-51 development board and execute assembly language programs.
Study the microprocessor interfacing for AES-51 development board.
Study the advanced microprocessor interfacing techniques and build real time
application by using 8051 microcontroller.

Objectives:

Having completed the experiments you will be able to understand

Familiar with the software tools for microprocessor programming.


Understand about the contents of List file (*.lst) and Hex (*.hex) file.
Identify the basic functions of AES-51 development board.
Understanding the sensors and actuators
Understanding microprocessor Interfacing techniques
Hands on experience of microcontroller interfacing

Experimental Tasks:

Session #1

Identify the basic functions available in the AES-51 development board.


Run the self-test program and familiar with the each functions of the AES-51
development board.
Familiar with the 8052 simulator
Assemble the programs written in TMA #1 and observe the results by using AES-51
development board.

Session #2

Assemble and simulate the programs which you written in TMA #2

Verify ALP by using AES-51 development board with given external interfacing
circuits/devices.

Session #3

Assemble and simulate the programs which you written in TMA #3


Verify ALP by using AES-51 development board with given external interfacing
circuits/devices.

10 ECX4236 Microprocessors and Interfacing

Вам также может понравиться