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

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 (2013/2014) 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 1 ECX4236 Microprocessors and Interfacing

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) 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 09th November 2013 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) 2 ECX4236 Microprocessors and Interfacing

Embedded Systems & Robots: Projects Using The 8051 Microcontroller Subrata Ghoshal

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. cjbas@ou.ac.lk Phone: Direct: +94 11 288 1437 (or Ext: 437)

E-mail: -

3 ECX4236 Microprocessors and Interfacing

Tutor Marked Assignment #1 2013


Use the ASM51 Assembler and the 8052 simulator to verify your ALP. Submit your written assignment on or before 13th December 2013 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 student has written a simple ALP program and has compiled it using ASM51 compiler. The generated .LST file is shown Figure 1. (a) Calculate the total number of machine cycles and time taken to complete the program for given ALP in Figure 1 and verify the results using simulator. ) microseconds delay; where (b) Modify the given ALP in Figure 1 to generate ( will be last two digit of your registration number (Clearly show your all calculation for R1, R2 and R3 values). (c) Calculate a timer 0 value TH0 and TL0 to generate same delay that you have obtained in Q1. (b) (Clearly draw a timer configuration diagram with values) (d) By using the delay that you have obtained in Q1. (c), toggle the LED when push button switch is pressed and stop when switch is released. i. ii. iii. iv. Draw a schematic diagram for your solution. Draw a flowchart for your algorithm. Write an ALP for your solution using a timer. Draw an Input and Output waveforms of the system.

(e) Explain the switch bounce caused in push button switch with I/O waveform. (f) Suggest the hardware and software solutions to overcome the switch bounce condition. (g) Modify your ALP written in Q1. (d). iii, to eliminate switch bounce using software solution that suggested in Q1. (f) with the help of figure 1.

4 ECX4236 Microprocessors and Interfacing

Tutor Marked Assignment #1 2013

Figure 1 [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 LOOKUP TABLE by using examples with ALP commands. (c) Design a memory system for 8051 which require 16KB ROM and 8KB RAM using 4KB ROM chips and 2KB 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).

[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.

5 ECX4236 Microprocessors and Interfacing

Tutor Marked Assignment #1 2013


(c) Compare and contrast the followings with the 8051 microcontroller 1. PIC 16F877A 2. Atmel AVR ATmega32 3. 4. MSP430 ARM Cortex

(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 8 push-button switches, 8 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 sorting machines available in the world and list 3 types of such machines with name, model, kind of sorting objects, used sensors and actuators, main functions/stages, physical parameters used for sorting etc.

6 ECX4236 Microprocessors and Interfacing

Tutor Marked Assignment #2 2013

Use the ASM51 Assembler and the 8052 simulator to verify your ALP. Submit your written assignment on or before 07th February 2014 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, DC motor and servo motor. (b) How to determine the rotation direction, rotation angle and rotation speed of a stepper motor, a DC motor and a servo motor. (c) Explain a mechanism to control the direction, angle and speed of a servo motor and draw an output waveform. (d) Write an ALP to control the direction, angle and speed of a servo 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) Draw a block diagram to interface an ADC with 8051. Clearly show how to use DAC to set the reference voltage of the ADC and display the result in three seven segment displays. (c) Draw a flowchart to measure analog voltage using ADC and DAC. Display the result in three seven segment displays. (d) Write an ALP to implement your algorithm Q2. (c).

7 ECX4236 Microprocessors and Interfacing

Tutor Marked Assignment #2 2013


[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 4800. Find out the timer values of the 8051 microcontroller for the experiment. (b) Write an ALP to send a string @RMOV +50000 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 ) where x is first digit of your communication. (Select number of devices as ( 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 interrupt and interrupt priority using real world examples and importance of watchdog timers. (b) A student is expecting to generate PWM signal. Duty cycle of the PWM signal may 30% or 60% or 80%. Assume frequency of the PWM signal is 50Hz. 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 60% duty cycle using timer interrupts. [05] Very briefly explain the sorting procedure in a sorting machine that you have identified in TMA #1, Q5, with diagrams.

8 ECX4236 Microprocessors and Interfacing

Tutor Marked Assignment #3 2013


Use the ASM51 Assembler and the 8052 simulator to verify your ALP. Submit your written assignment on or before 12th May 2014 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 Sorting Machine (ESM)


The following description is about an Electronic Sorting Machine (ESM) which separates objects (i.e. black peppers) weightier than dust particles. You are to analyse and design the requirements for the ESM according to the 8051 microcontroller specifications.
Upper bin
M1

Black peppers Motor (M1) for shaking the upper bin Fan V1 Exit for dust particles Wind
M2

Electronic valve (V1)

Three seven segment displays for weight (T1)

Start button Motor (M2) to control the fan speed Lower bin Transducer (T1) for measuring the weight

Stop button

Electronic valve (V2)

V2

T1

Alarm

(a)

(b)

Figure 1: Typical view of ESM (a) Sorting Unit, (b) Front Control Panel of ESM The electronic sorting machine (ESM) consists of the sorting unit and the front control panel as shown in the Figure 1. The sorting unit has two motors M1 & M2, a fan, two bins, two electronic valves (solenoid valves) V1 & V2, and a weight measuring transducer T1. The front control panel of ESM has three seven segment displays to display the weight, a start button to start the system, a stop button to stop the system, and an alarm to indicate desired weight. When the ESM starts, the motor M1 runs at 75% duty cycle to shake the upper bin. The motor M2 runs at 50% duty cycle to rotate the fan to provide sufficient wind to separate the dust particles from the input objects (i.e. black peppers). The electronic valves V1 & V2 should be opened if both the lower bin and the objects (i.e. black peppers) in the upper bin are available. 9 ECX4236 Microprocessors and Interfacing

Tutor Marked Assignment #3 2013


If weight of the objects in the lower bin reaches to 500g then the following actions mush be carried out. 1. The alarm should be on. 2. Both the electronic valves V1 & V2 should be closed. 3. The motor M1 & M2 should be stopped after reducing the motor speed gradually without removing the power for sudden stop. 4. Automatically pick and place the lower bin to continue the process. 5. Store the number of completed bin count in external ram Otherwise operation should continue until the stop button pressed. Weight of the empty lower bin is 12g. The absolute value of the objects in the lower bin should be displayed in three seven segment displays with 1g accuracy. State all other assumptions (if any) clearly, when answering the questions. [Q1] (i) (ii) (iii) (iv) (v) (vi) (vii) Identify the sensor(s) and the actuator(s) required to identify presence of the objects (i. e. black peppers) in the upper bin as shown in the Figure 1 (a). Find the necessary reference voltage and the resolution of your ADC to measure the weight and justify your answer. Draw the external view of the system (i.e. a diagram that shows the inputs and the outputs of the system). Identify the sub units/sub modules of the system and draw the interconnected block diagram of the system using the central controller. Draw a schematic diagram of the system Draw a flowchart to represent an algorithm for operations of the system. Write an Assembly Language Program for the system. (Clearly show assembly routines with comments)

[Q2] [Q3]

Identify the design issues and the necessary improvements of your design. Is it possible to implement your design on an ASIC (Application Specific Integrated Circuit)? Justify your answer? List the ethical, social issues/considerations of your design 10 ECX4236 Microprocessors and Interfacing

[Q4]

Laboratory Experiments 2013


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.

11 ECX4236 Microprocessors and Interfacing

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