[go: up one dir, main page]

0% found this document useful (0 votes)
165 views79 pages

MSI - EEE-342 Lab Manual (EPE)

This document provides instructions for an experiment involving data movement in the PIC18F452 microcontroller using MPLAB IDE. The objectives are to create a new project in MPLAB IDE for the PIC18F452 microcontroller and move literal data into the Working Register (WREG). The document outlines the steps to create a new project, add an assembly source file, write sample code to the file, and build the project as relocatable so it can be moved to other workstations.

Uploaded by

Afaq Ahmed
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)
165 views79 pages

MSI - EEE-342 Lab Manual (EPE)

This document provides instructions for an experiment involving data movement in the PIC18F452 microcontroller using MPLAB IDE. The objectives are to create a new project in MPLAB IDE for the PIC18F452 microcontroller and move literal data into the Working Register (WREG). The document outlines the steps to create a new project, add an assembly source file, write sample code to the file, and build the project as relocatable so it can be moved to other workstations.

Uploaded by

Afaq Ahmed
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/ 79

COMSATS University Islamabad, Abbottabad Campus

Department of Electrical & Computer Engineering

Laboratory Manual
Microprocessor Systems and Interfacing EEE-342 (3+1)

BS Power Engineering

Date Created: 20 August 2021 Revision: MSILEEE342-01


Prepared by: Engr. Usman Khalid Engr.& Muhammad Naveed Shaikh
Student Name: Registration No.:

List OF Experiments

S. NO Typical Date
Experiment
1 Introduction to MPLAB, and Data movement in PIC18F
microcontroller
Implementation of Data movement and Simple Arithmetic
2
Instructions in File Register PIC18F microcontroller
3 Introduction to Proteus, I/O Port Programming
4 Implementation of Bit Manipulation Branch Instructions in PIC18F
Implementation of Stack., Call and Branches Instructions
5
Case Study: Delay Calculation and Implementation
6 Implementation of Logical instructions
7 Implementation of Timers in PIC Microcontroller
Open Ended Experiment (Suggested but not limited)
8 LCD Programming and Interfacing in PIC Microcontroller
9 Implementation of Serial Communication in PIC Microcontroller
10 Implementation of Interrupts in PIC Microcontroller
Typical
11 Introduction to Emu8086, and Data movement in 8086
Microprocessor
12 Implementation of Arithmetic Instructions in 8086Microprocessor
13 Implementation of Shift and Rotate Instructions in 8086
Microprocessor
14 Implementation of Jumps instructions in 8086 Microprocessors
15 Implementation of Logical instructions in 8086 Microprocessors
Implementation of Assembly Language in MTS-86C Trainer
16

ii
Preface
We feel pleasure in presenting the laboratory manual of Microprocessor Systems and Interfacing
course for under-graduate level. The objective of this manual is to support the theory syllabus of the
Microprocessor Systems and Interfacing course through experiments. This Lab Manual is for EEE-
342 Microprocessor Systems and Interfacing course. The labs constitute 25 % of the total marks for
this course. You are not allowed to wander in the lab or consult other groups when performing
experiments. Similarly, the lab reports must contain original efforts. CUI has a zero tolerance anti-
plagiarism policy.
In this manual, experiments are included related to Assembly language programming for PIC18F
microcontroller and 8086 Microprocessors. These assembly language programs are assembled and
debugged in MPLAB-IDE and emu-8086 environment for PIC microcontroller and 8086
microprocessors respectively. Furthermore, Simulations are performed in Proteus Environment.
A full effort has been made in the designing of this manual to cover the major topic of the course.
The lab staff including Engr. Jawad Sultan (lab engineer) and Mr. Khurram Shahzad (Lab
demonstrator) were involved in the developments, validation of experiments and documentation of
this manual. The OBE based review was carried out by Engr. Usman Khalid and Engr. Muhammad
Naveed Shaikh.
We would appreciate for identification of errors for further improvement of quality of the lab manual.

Engr. Usman Khalid and Engr. Muhammad Naveed Sheikh


Department of Electrical & Computer Engineering
COMSATS University Islamabad, Abbottabad Campus

Fall 2021

iii
Safety Regulations for Microprocessor Systems and

Interfacing Experiments
Important safety precautions
1. Refer the operating manual and follow the safety requirements before starting the
testing.
2. Be calm and relaxed, while working in lab.
3. First check your measuring equipment.
4. Keep the work area neat and clean.
5. Be sure about the locations of fire extinguishers and first aid kit.
6. No loose wires or metals pieces should be lying on the table or neat the circuit.
7. Avoid using long wires, that may get in your way while adjusting or changing leads.
8. Be aware of bracelets, rings, and metal watch bands (if you are wearing any of
them). Do not wear them near an energized circuit.
9. When working with energize circuit use only one hand while keeping rest of your
body away from conducting surfaces.
10. Always check your circuit connections before power it ON.
11. Always connect connection from load to power supply.
12. Never use any faulty or damage equipment and tools.
13. If an individual meets a live electrical conductor.
14. Do not touch the equipment, the cord, the person.
15. Disconnect the power source from the circuit breaker and pull out the plug using
insulated material

iv
Experiment 1

Introduction to MPLAB, and Data movement in PIC18F


microcontroller

Objective
1. To create new project in MPLAB IDE environment for PIC18F452.
2. To move literal data in Working Register (WREG) of PIC18F452.

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.

Discussion
MPLAB IDE is freely available software. One can download it from the website of microchip
technology. If you click on the desktop icon of MPLAB, it will open the graphical user interface
of MPLAB IDE. The GUI environment is shown below:

Procedure
In this tutorial, we are just going to develop a project, or we are going to learn how to create a
simple project inside this software.
Steps to create a new project in MPLAB IDE.
1. Click on the Project in the menu bar. Furthermore, then click the Project Wizard in the
drop-down menu. Usually, that is the very first option of the drop-down menu.

1
Then, you will notice the following dialogue box.

2. Click on Next. Then, you will notice the following step one dialogue box. Here it would
be best if you chose the specific microcontroller from the device drop-down menu. We will
choose the PIC18F452 microcontroller. And Click Next.

2
3. Then, you will notice the following dialogue box.

3
It is step two of our Project wizard procedure. Choose Microchip MPASM Tool suit in
Active Tool suite option as depicted in the figure. Furthermore, Select MPASM Assembler.
It will be highlighted in blue, as shown in the figure. Then click on next. Remember, if you
have recently installed your Project, you may need to install some of the updates for these
tool suites.
4. Then, you will notice the following step three Dialogue box

4
5. Click on Browse; the following window will appear.

5
6. Type in some name for the Project in the field of "File Name". For example, TEST
PROJECT and click on save. You will notice that the complete path has been written in
the browse field, as shown in the following figure. Click on the next.

7. Then you will notice the following step four window. Here you have an option to add any
existing source file (Assembly or C code). Since we are creating it for the first time, we
will not add any source file. We will click on next. It will create a project without any
source file. Moreover, the following window will appear.

6
8. This window is a summary of the complete Project wizard procedure. It enlists the device,
tool suit and complete path of the Project in the respective directory. Click on a finish to
complete the Project.
9. You will notice the following environment of the project in MPLAB IDE.

7
10. Now we will add a source file to the Project. Click on the Project in the menu bar. Then
click on "ADD New file to Project."

11. The following window will appear. Just verify the file location. If it is not correct, then
correct the path using the browse features. If the path is correct, name the file "testfile.asm"

8
as shown in the figure. And click save. Remember .asm extension is used for the assembly
source file. So, it is a must to enter this extension along with the file name.

12. Now you will have the following extra window of source file editor to place your assembly
code.

9
13. Write down the following specimen code in the editor.
#INCLUDE P18F452.INC
ORG 00H
END
14. Click on the make button as shown in the following window

10
As you click on the make button, you will have the following window presenting options
Absolute and Relocatable.

Absolute: This option is feasible when the location of the project and source file will not be
changed and remain the same forever.
Relocatable: This option is feasible for academic purposes. It will make the (build the code) file
relocatable. That means one can change the location of the file and the Project itself. Means one is
allowed to copy and paste it somewhere else.
We suggest you choose the Relocatable option so that students can carry these files with them in
their flash drives to process them further
in their workstations/ laptops.

15. So, let us click on the relocatable. Then you will notice certain processes to be completed.
You will see that the output window will show some warnings and errors during the file's
execution. Moreover, if the source code does not contain any error, the output window will
show the build succeeded. Message as in the following figure.

11
12
Data movement in Working Register (WREG)

To achieve this objective, we will use instruction MOVLW. It stands for move literal value to the
working register.
Instruction Format Operation
MOVLW D8 Move 8-bit immediate data into WREG (Working Register)

Lab Tasks
1. Move the following 8-bit numbers in WREG.
a) 45H
b) 25h
c) 36H
d) 0x2E
e) 0x4F
2. Consider one 8-bit number from your student ID and move it into the working register (i.e.,
24H for student ID FA17-EPE-124.)
Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

13
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

14
15
Experiment 2

Implementation of Data movement and Simple Arithmetic


Instructions in File Register PIC18F Microcontroller

Objective
1. To Understand the Data Movement between File Register and Working Register (WREG)
2. To Apply the Simple Arithmetic Instructions for PIC18F452 Microcontroller
Experiment & Test Setup
Workstation with installed MPLAB IDE environment.
Discussion
In this lab, we will explore and apply data movement and arithmetic Instructions for various
operations. Mainly, we apply these operations to involve data movement from WREG (working
register) to file register and vice versa. The following table provides the Instruction format and
operation of various data movement and arithmetic instructions.

Instruction Operation
MOVLW D8 Move 8-bit immediate data into WREG (Working Register)
MOVWF F Move 8-bit data from WREG into file register at location F.
Move 8-bit data from file register at Location F to location
specified by Destination ‘D’ bit.
MOVF F, D
If D=0 or D=W, then destination is WREG
If D=1 or D=F, then destination is location F in file register
Add the contents of WREG and File register at location F and put
the result in the destination as dictated by D bit.
ADDWF F, D
If D=0 or D=W, then destination is WREG
If D=1 or D=F, then destination is location F in file register
SUBWF F, D Subtract the contents of WREG from File register at location F and
put the result in the destination as dictated by D bit.
If D=0 or D=W, then destination is WREG
If D=1 or D=F, then destination is location F in file register
MULWF Multiply the content of WREG with File register location at F and
put the result in default SFRs including PRODH and PRODL.
Result →PRODH: PRODL

16
Lab Tasks
1. Store these three 8-bit numbers in file register starting at location 12 H, 13 H and 14 H.

2. Add the 2F H and 4C H and store the result in file register location at 10H and display the
content of Status register. If there is any change in status register kindly comment on it.

3. Apply the Multiplication operation on 24h and 5Fh and store the result in file register
location at 04H and 05H and show the content of status register.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

17
4.

Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

18
19
Experiment 3

Introduction to Proteus and I/O Port Programming

Objective
1. To Understand the Input /Output Port Configuration for PIC18F452 Microcontroller
2. To Understand Project Development in PROTEUS

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.
Discussion
In PIC18F452, microcontroller has several built-in pins. These pins serve as an interface to outer
world for PIC microcontroller. These pins are distributed in SFRs PORTx. Generally, they are
termed as PORTs. These SFRs are part of file register (RAM). So, we can push to and retrieve
data from these PORTs by simply dealing them as file register location. This is one of the powerful
tool of PIC microcontroller.
These PORTS are named as PORTA, PORTB, PORTC, PORTD and PORTE. PORTA, PORTB
and PORTC. Furthermore, every PORTx has an extra associated register called TRISx. So, it
means PIC microcontroller has respective TRISA, TRISB, TRISC, TRISD and TRISE Registers.
These TRISx register play vital role in the configuration of PORTs. Because PORTx will function
properly when their corresponding TRISx registers are properly configured. Particularly, TRISx
Registers are responsible to dictate the direction flow of data through these PORTs. Direction flow
of data can be either inward or Outward.
Inward Direction: Data will flow from outer world (some sensor) to the microcontroller. That is
also named as Input Mode of PORTx. To make any pin as input pin, we need to place the 1 at the
specific bit of TRISx.
Outward Direction: Data will flow from microcontroller to the outer world (some sensor). That
is also known as Output Mode of PORTx. To make any pin as output pin, we need to place the 0
at the specific bit of TRISx.
By default every PORT is input mode. That means every bit of all TRISx Register has value of 1.
Each PORTx carry number of pins. For example PORTB has 8 pins and they are designated RB0,
RB1 through RB7. RB0 is designation of 0th pin of PORTB and similarly RB7 shows 7th pin of
PORTB. Several PORTx, their corresponding pins and their designations are given in following
table.

PORTx `Number of Pins Symbols

20
PORTA 7 pins RA0-RA6
PORTB 8 pins RB0-RB7
PORTC 8 pins RC0-RC7
PORTD 8 pins RD0-RD7
PORTE 3 pins RE0-RE2
PROTUES
The Proteus Design Set is a proprietary software tool suite that is primarily used to automate
electronic design. Electronic design experts and technicians use the software to develop schematics
and electronic prints for printed circuit board manufacture.
In this course, we will use Proteus to simulate the various sensors with PIC18452 microcontroller.
Depending upon the nature of lab task, we will use various features of Proteus. However, in each
lab every student will make a PROTEUS projects with integration of PIC18F452. Students will
learn this project development during lab. They are advised to keenly observe and practice that
procedure. Because, it will be useful for every other coming lab.

Lab Tasks
1. Consider Registration # and use it as 8-bit Hexadecimal number. For example, FA18-EPE-
024, 8-bit hexadecimal number would be 24Hex. Display your registration number on 8
LEDs connected with PORTC in PROTEUS Simulation of PIC18452.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

21
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

22
23
Experiment 4

Implementation of Bit Manipulation Branch Instructions


Objective
1. To Understand bit manipulation Branch Instructions in PIC18F452
2. To Understand the input/ Output configurations in Proteus

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.

Discussion

In the last lab, we have observed how to set or reset all the bits of each register TRISx at once.
Thus, it will make complete PORT either input or output. But there are various scenarios in which
pins within the single PORT can be used as input and output simultaneously. For example, RB0
can be configured as Output pin while at the same time RB7 can be configured as Input Pin. To
achieve this goal, we will require some instructions to modify or manipulate the individual bits of
PORTs. These instructions are known as Bit-Manipulation Instructions. Some of the bit
manipulation instructions are given in the following table.

Instruction Operation
Bit Clear File: it will clear the specific bit ‘D’
BCF F, D
of File Register ‘F’
Bit Set File: It will set the specific ‘D’ of File
BSF F, D
Register ‘F.’
Bit Test File Skip if Set: It will test the specific
BTFSS F, D bit ‘D’ of File Register ‘F’. It will also skip the
next instruction if test bit ‘D’ is found as 1.
Bit Test File Skip if Clear: It will test the
specific bit ‘D’ of file Register ‘F’. It will also
BTFSC F, D
skip the next instruction if test bit ‘D’ is found
as 0.

Lab Tasks
Implement the PIC18F452 in PROTEUS to perform the various tasks. Use Switches to Provide
the input and output must be displayed on LED in each task:

1. Use PORTB and PORTC as input ports, which receive 8-bit information. Information
received from PORTB and PORTC are added, and the results should be displayed on

24
PORTD. Connect 8 LEDs with PORTD to visualize the result present on PORTD. Repeat
this addition process for the indefinite time interval.

2. Receive two 8-bit numbers from PORTB and PORTD and Check if the numbers are equal
or not. If numbers are equal, turn on the LED connected with RC0; otherwise, turn on the
LED connected with RC4. Repeat this checking mechanism for an indefinite time interval.

3. Receive the number from PORTC and check it is zero or not. If it is zero, then keep
checking the PORTC content. If any result received from PORTC becomes non-zero, turn
on the LED connected with RB2 and stop the program and do not check the content coming
from PORTC.
Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

25
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

26
27
Experiment 5

Implementation of Stack, Call and Branches Instructions

Case Study: Delay Calculation and Implementation

Objective
3. To Understand the Stack, Call and Branches Instruction
4. To Produce the required amount delay in real time.

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.
Discussion
In theory classes, we have learned about subroutines and the use of Call Instructions. These
subroutines are important pieces of code that are written to perform specific tasks. These
subroutines are called in the main program multiple times by using the Call Instruction.
Furthermore, we also learned about stack memory built-in PIC microcontrollers. Upon execution
of call instructions, the contents of the program counter and other important registers are pushed
automatically into Stack. At the end of every subroutine, RETURN instruction is used, which will
pop out (retrieve back) to the content of the registers.
An important Application of Subroutines in Assembly language for a microcontroller is Delay
Generation. We know that it takes a certain time to get executed for each assembly instruction by
the microcontroller. If we put a specific number of instructions with a certain calculation in the
subroutine, it will generate a fixed amount of Delay. For example, if we repeat instruction and
around 1 million times in a subroutine and let say execution time of instruction is o1 us. Then,
Complete execution of the subroutine will produce 1-second delays.
In theory classes, we have also learned that certain instructions cause variable Delay. For example,
some conditional branch instruction takes 2 to 3 cycles depending upon the condition is true or
false. In certain cases, we do not have the exact time. So Real-time delay may have a difference as
compared to theoretical calculations.
This lab will realize this delay generation using subroutines and Call Instruction and simulate
them in Proteus Environment.

Note
Use following two lines in the beginning of code
LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX
config OSC=HS, OSCS=OFF, WDT=OFF, BORV=45, PWRT=ON, BOR=ON, DEBUG=OFF,
LVP=OFF, STVR=OFF

28
Lab Tasks

1. Connect 8 LEDs with PORTD of PIC18F452 in Proteus. Send 55H to PORTD and
complement the data on PORTD. Use a Delay of 1 second between consecutive outputs.
2. Connect two LEDs with RC0 & RC1 and a switch with RB0 of PIC18F452 in Proteus.
Implement the following logic in given microcontroller turns on the LED connected with
RC0 when SW is turned on and turns on the LED connected with RC1 when SW is turned
off.
3. Write down the assembly language program for the following scenario: Two sensors S1
and S2, are installed at the entrance and exit of the classroom. Every time a person enters
the classroom, S1 sends high to RB0. Every time a person exits from the classroom, S2
sends high to RB1. Display the total number of persons present in the classroom at PORTC.
Update the Displayed Content on PORTC with some realistic delay using the nested loop
Approach.
4. Use PIC18F452 Microcontroller to generate a square wave and verify the output in Proteus.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

29
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

30
31
Experiment 6

Implementation of Logical instructions


Objective
1. To Understand Logical Instruction for PIC18452 Assembly language.

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.
Discussion
In previous labs, we have discussed various instructions, including Data Movement, Arithmetic,
Bit Manipulation and Branch Instructions. But Assembly language implementation of various
applications also requires knowledge of Logical Instructions. In this lab, we will explore various
logical instructions in assembly language programming for the PIC18F452 microcontroller. We
will implement some of the applications in Proteus. So, the important Logical Instruction and their
respective operations are given in the following table.
Instruction Operation
ANDLW data8 [WREG] AND 8-bit data →[WREG]
ANDWF F, D [WREG] AND [F] →D
COMF F, D NOT [F] D
IORLW data8 [WREG] OR 8-bit data→[WREG]
IORWF F, D [WREG] OR 8-bit data →D
XORLW data8 [WREG] XOR 8-bit data → [WREG]
XORWF F, D [WREG] XOR [F] →D

Note
Use following two lines in the beginning of code

LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX


config OSC=HS, OSCS=OFF, WDT=OFF, BORV=45, PWRT=ON, BOR=ON, DEBUG=OFF,
LVP=OFF, STVR=OFF

32
Lab Tasks

1. Three different temperature sensors are connected to RB1, RB2 and RB3. If the temperature
observed at any of the sensors exceeds the specific threshold, an alarm alert is generated by a
Green LED connected at RC4. Implement the above task with microcontroller PIC18 F452 in
Proteus. Use Switches with RB1, RB2 and RB3 to simulate the effect of sensors.
2. Modify the above program by connecting two extra LEDs Blue and RED, with RC5 and RC6.
Now three will be following alarm updates.
a. Turn on Green LED if any one of the sensors sends an alarm.
b. Turn on Blue LED if any two of the sensors sends an alarm.
c. Turn on RED LED if all of the sensors sends an alarm.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

33
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

34
35
Experiment 7

Implementation of Timers in PIC Microcontroller


Objective
1. To Use the Timer0 in application design for PIC18F452 Using Assembly Language.

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.
Discussion
In theory classes, we have already learned about the various features of Timer 0. Programming
the Timers and implementing them in different applications, including event counters and delay
generation. In this lab, students will utilize their knowledge and use them in given lab tasks. Timer0
bits and their necessary bits are shown in the following table.
TMR 0ON T08- T0CS T0SE PSA T0PS2 T0PS1 T0PS0
BIT
0→Timer 0→16- 0→ 0→ 0→ 8 different combinations from
is OFF bit Internal Positive Prescaler 000 through 111.
Edge is on
1→Timer 1→ 8- 1→ Each combination refers to
is ON bit External 1→ 1→ different Scaling factor for crystal
Negative Prescaler clock.
Edge is off

Note
Use following two lines in the beginning of code

LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX


config OSC=HS, OSCS=OFF, WDT=OFF, BORV=45, PWRT=ON, BOR=ON, DEBUG=OFF,
LVP=OFF, STVR=OFF

Lab Tasks
1. Generate a rectangular wave with a PIC18F452 microcontroller with the following
requirements.
1. Frequency=200Hz, Duty Cycle =20% & XTAL =20 MHz
2. Frequency=50Hz, Duty Cycle =25% & XTAL =40 MHz
3. Frequency=1Hz, Duty Cycle =50% & XTAL =40 MHz
4. Frequency=4Hz, Duty Cycle =25% & XTAL =20 MHz

36
Fill the Following table from above programs:

S.NO Fins Tins TMR0L TMR0H T0CON Prescaler Value if


used.
i)
ii)
iii)
iv)

2. Implement a RADAR System using PIC18F452. The radar system uses a listening sensor
and listens for high values from the sensor. Once it detects a high value from the sensor,
it will generate a pulse with a duration of 300ms. Use XTAL=24 MHz with PIC18F452.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

37
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

38
39
Experiment 8

LCD Programming and Interfacing in PIC Microcontroller


Objective
1. To Implement the LCD interfacing in PIC microcontroller.

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.

Discussion
LCD is an important Output device that is used in many microcontroller applications to display
the senor information. This lab aims to teach the interfacing of 16x2 LCD with PIC18F452.
Students have already available theory notes listing all the concepts of writing and reading the
LCD. This lab is an open-ended lab, and Students are free to use their programming skills to
implement the following lab tasks of LCD interfacing. However, the tutor is allowed to enhance
and increase the lab task as per the availability of lab time.

Lab Tasks
Implement the following simple tasks in Proteus.
1. Connect a 16x2 LCD with PIC18F452. Print your name on LCD Using Assembly Language.
2. Now, add assembly instructions to the upper program to also print your Registration ID in the
second row.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

40
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

41
42
Experiment 9

Implementation of Serial Communication in PIC Microcontroller

Objective
1. To establish serial communication link between two PIC Microcontrollers.

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.
Discussion
In theory classes, we have already learned serial communication in PIC18F microcontroller.
PIC18F452 has built in USART. In this course, students need to implement the following lab tasks
using the various registers they have learned about Serial Communication.
Note
Use following two lines in the beginning of code

LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX


config OSC=HS, OSCS=OFF, WDT=OFF, BORV=45, PWRT=ON, BOR=ON, DEBUG=OFF,
LVP=OFF, STVR=OFF

Lab Tasks
Use two microcontrollers, one as Transmitter and the other as a receiver. Transmitter accepts an
8-bit value from any PORT and sends this 8-bit value serially in asynchronous mode through its
TX pin. On the other end, the Receiver receives this value and display it on LEDs connected to
PORTD of Receiver.
1. Use XTAL=4MHz and Baud rate =2400 bps
2. Repeat Activity 1 with XTAL=10MHz and Baud rate =9600bps
3. Repeat Activity 2 and use LCD instead of LEDs.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

43
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

44
45
Experiment 10

Implementation of Interrupts in PIC Microcontroller

Objective
1. To Implement various interrupts in PIC18F452 in Proteus.

Experiment & Test Setup


Workstation with installed MPLAB IDE environment.

Discussion
In theory classes, we have already learned various interrupts in the PIC18F microcontroller. These
interrupts have various classifications. Some of them include internal interrupts, external
interrupts, timer interrupts, serial interrupts, and PORTB-Change Interrupts. In this LAB, students
need to implement the following lab tasks using interrupts in Proteus.
Note
Use following two lines in the beginning of code
LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX
config OSC=HS, OSCS=OFF, WDT=OFF, BORV=45, PWRT=ON, BOR=ON, DEBUG=OFF,
LVP=OFF, STVR=OFF

Lab Tasks

1. Connect Two LEDs with RC1& RC2. Use External Hardware interrupts in the PIC18F
microcontroller. Turn on the LED connected to RC1 if INT0 is triggered, turn on the LED
connected to RC2 if INT1 is triggered and turn off both LEDs if INT2 is triggered. Use INT0
& INT1 as positive edge-triggered and INT2 as negative edge-triggered interrupts. Also,
generate a 500Hz Square wave at RC0 using timer0 interrupt with XTAL=20 MHz.
2. Accept two 4-bit numbers NUM1 & NUM2, are received from PORTC. NUM1 is received
from pins (RC7-RC4), and NUM2 is received from pins (RC3-RC0). Use external hardware
interrupts INT0, INT1, INT2 for the following operations:
a) Display the sum of NUM1 and NUM2 at PORTD if INT0 is triggered.
b) Display the difference of NUM1 and NUM2 (NUM2-NUM) at PORTD if INT1 is
triggered.
c) Display the product of NUM1 & NUM2 at PORTD if INT2 is triggered.

46
Report Required
1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

47
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

48
49
Experiment 11

Introduction to Emu8086, and Data movement in 8086


Microprocessor

Objective
1. To create new project in EMU8086 environment.
2. Use Emu8086 to execute instructions
3. Write a complete assembly program.

Experiment & Test Setup


Workstation with installed EMU8086 environment.

Discussion
An Integrated Development Environment (IDE) provides a convenient environment to write a
source file, assemble and link it to a -.COM or -.EXE file, and trace it in both source file, and
machine code. Emu86 is an educational IDE for assembly program development.

Practice 8086 Emulator

1. Loading, verifying and saving machine code.


2. Executing instructions and tracing programs.

Procedure
In this tutorial, we are just going to develop a project, or we are going to learn how to create a
simple project inside this software.

Click on icon, following window will appear.

50
Then, you will notice the following dialogue box Click on new

Click on the empty workspace radio button. Furthermore, then click the OK.

51
Now write Assembly language program in new file.

Following figure shows the emulator of 8086 which gets opened by clicking on emulate button

Click on Single step if color of any register changed after running an instruction it means contents
of this register are affected by this instruction.

52
Data Transfer Instructions: These instructions are used to transfer the data from source operand
to destination operand. All the store, move, load, exchange, input and output instructions belong
to this group.

Lab Tasks
Write assembly language statement for each of the following instruction. Also fill the following
table for each statement.

1. MOV : Copy byte or word from specified source to specified destination


2. PUSH : Push the specified word to top of the stack
3. POP : Pop the word from top of the stack to the specified location
4. PUSHA : Push all registers to the stack
5. POPA : Pop the words from stack to all registers
6. XCHG : Exchange the contents of the specified source and destination operands one of
which may be a register or memory location.

53
AX BX CX DX CS IP SS SP BP SI DI DS ES FL
Instructions AL AH BL BH CL CH DL DH

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

54
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

55
56
Experiment 12

Implementation of Arithmetic Instructions in 8086Microprocessor

Objective
1. Write programs in Emu8086 using arithmetic instructions
2. Write a complete assembly program.

Experiment & Test Setup


Workstation with installed EMU8086 environment.
Arithmetic instructions:
These instructions are used to perform various mathematical operations like addition, subtraction,
multiplication, and division etc.
Addition instructions
1. ADD: Add specified byte to byte or word to word
2. ADC: Add with carry
3. INC: Increment specified byte or specified word by 1
4. AAA: ASCII adjust after addition
5. DAA: Decimal (BCD) adjust after addition
Subtraction instructions
1. SUB: Subtract byte from byte or word from word
2. SBB: Subtract with borrow
3. DEC: Decrement specified byte or word by 1
4. NEG: Negate or invert each bit of a specified byte or word and add 1 (2’s
complement)
5. CMP: Compare two specified byte or two specified words
6. AAS: ASCII adjust after subtraction
7. DAS: Decimal adjust after subtraction
Multiplication instructions
1. MUL: Multiply unsigned byte by byte or unsigned word or word.
2. IMUL: Multiply signed bye by byte or signed word by word
3. AAM: ASCII adjust after multiplication

57
Division instructions
1. DIV: Divide unsigned word by byte or unsigned double word by word
2. IDIV: Divide signed word by byte or signed double word by word
3. AAD: ASCII adjust after division

Lab Task
1. Perform addition operation between numbers 78A4H & F458
2. Subtract the 78A4 from F458H
3. Check following assembly instructions are valid or not? In case of valid, explain what
each instruction does? In case of invalid instruction explain the reason.
a. MOV AX, BX
b. MOV BL, AX
c. MOV BH, FEH
d. MOV DX,02A0H
4. ADD three 16-bit numbers (F478H, E879H &1234H) in emu8086 and verify your
results.
5. Use SBB instruction in some program and verify its operation.
6. Calculate the factorial of any 4-bit number using MUL & LOOP instruction and verify
your result.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

58
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

59
60
Experiment 13

Implementation of Shift and Rotate Instructions in


8086 Microprocessor

Objective
1. How 8086 executes shift and rotate instructions
2. Write programs in Emu8086 using shift and rotate instructions

Experiment & Test Setup


Workstation with installed EMU8086 environment.
Shift instructions
1. SHL/SAL: Shift bits of a word or byte left, put zero(S) in LSBs.
2. SHR: Shift bits of a word or byte right, put zero(S) in MSBs.
3. SAR: Shift bits of a word or byte right, copy old MSB into new MSB.
Rotate instructions
1. ROL: Rotate bits of byte or word left, MSB to LSB and to Carry Flag [CF]
2. ROR: Rotate bits of byte or word right, LSB to MSB and to Carry Flag [CF]
3. RCR: Rotate bits of byte or word right, LSB TO CF and CF to MSB
4. RCL: Rotate bits of byte or word left, MSB TO CF and CF to LSB

Lab Tasks:
1. Store a random 16-bit number in AX. Determine if the number is even or odd. If the
number is odd, move the number in BX and move it to DX.
2. Store a random number 16-bit number in AX. Determine if the number is positive or
negative. If the number is negative, move it into BX, Otherwise, move it into DX.
3. Store a random 8-bit number in AX. Divide it by two and store the Result into BX.
4. Store a random 8-bit number in AX. Multiply it by two and store the result into DX.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

61
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

62
63
Experiment 14

Implementation of Jumps instructions in 8086


Microprocessors

Objective
1. How 8086 executes Jump instructions.
2. Write programs in Emu8086 using conditional & unconditional jump instructions

Experiment & Test Setup


Workstation with installed EMU8086 environment.
Unconditional transfer instructions
1. CALL: Call a procedure, save return address on stack
2. RET: Return from procedure to the main program.
3. JMP: Go to specified address to get next instruction
Conditional transfer instructions
1. JA/JNBE: Jump if above / jump if not below or equal
2. JAE/JNB: Jump if above /jump if not below
3. JBE/JNA: Jump if below or equal/ Jump if not above
4. JC: jump if carry flag CF=1
5. JE/JZ: jump if equal/jump if zero flag ZF=1
6. JG/JNLE: Jump if greater/ jump if not less than or equal
7. JGE/JNL: jump if greater than or equal/ jump if not less than
8. JL/JNGE: jump if less than/ jump if not greater than or equal
9. JLE/JNG: jump if less than or equal/ jump if not greater than
10. JNC: jump if no carry (CF=0)
11. JNE/JNZ: jump if not equal/ jump if not zero (ZF=0)
12. JNO: jump if no overflow (OF=0)
13. JNP/JPO: jump if not parity/ jump if parity odd (PF=0)
14. JNS: jump if not sign (SF=0)
15. JO: jump if overflow flag (OF=1)
16. JP/JPE: jump if parity/jump if parity even (PF=1)
17. JS: jump if sign (SF=1)

64
Lab Task
1. Move two numbers in AX & BX, compare two values if AX >BX, then move the AX
value in CX; otherwise, move BX value in CX.
2. Perform the factorial of 3-bit number without using LOOP statement (Use DEC or INC
instruction with CONDITIONAL JUMP instructions.
3. Move a certain number in AX, check if a number is even or odd if the number is odd,
then move FFFFH into DX; otherwise, move FFFFH in CX.
Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

65
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

66
67
Experiment 15

Implementation of Logical instructions in 8086


Microprocessors

Objective
1. Write programs in Emu8086 using logic instructions
2. Write a complete assembly program.

Experiment & Test Setup


Workstation with installed EMU8086 environment.
Logical instructions
1. NOT: Invert each bit of a byte or word.
2. AND: ANDing each bit in a byte or word with the corresponding bit in another byte or
word.
3. OR: ORing each bit in a byte or word with the corresponding bit in another byte or word.
4. XOR : Exclusive OR each bit in a byte or word with the corresponding bit in another byte
or word.

Lab Tasks:
1. Store two 16-bit numbers in AX and BX registers. Perform AND Operation in between
the content of AX and BX. Store the Result into CX.
2. Store two 16-bit numbers in AX and BX registers. Perform OR Operation in between the
content of AX and BX. Store the Result into CX.
3. Store two 16-bit numbers in AX and BX registers. Perform XOR Operation in between
the content of AX and BX. Store the Result into CX.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

68
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

69
70
Experiment 16

Implementation of Assembly Language in MTS-86C


Trainer
Objective
• Understand the MTS-86C Trainer
• Implement the Machine Code in MTS-86C Trainer

Experiment & Test Setup


MTS-86C Trainer
DISCUSSION
The Microcomputer Trainer MTS-86C8086 is suitable for learning the fundamentals of today's
computers. Users can learn about the architecture and programming of the 8086 CPU with MTS-
86C.
There are five major components to the system: (1) an 8086 processor, (2) access to the system
and user memory, (3) international chipsets, (4) input and output devices (5) an external interface.
Users can download the program to the system memory and execute it to examine the experiment
results instantly after editing and creating assembly program codes on the PC. Debugging is also
possible via the system keypad interface, accessed from either the PC or the MTS-86C.
• Demo programs are permanently kept in the system's ROM to allow rapid system testing and
functional demonstration.
• For all 8086 experiments, the power supply, and all necessary experimental kits.
• Programming codes are downloaded, debugged, and executed via the computer's keyboard or the
MTS-86C.
• The external interface allows students to experiment by designing their circuits.
• All chipsets have their names printed in the respective positions on the acrylic panel, which is
covered by an acrylic cover on the top of the trainer panel.

71
Lab Tasks:
1. Convert the following Assembly Language Instructions into Machine Code.
Instruction1: MOV BX,0223H
Instruction2: MOV AX,04F4H
Instruction3: ADD AX, BX
Instruction4: MOV DX, AX
Instruction5: INC DX
2. Load the above instructions’ Machine Code into MTS-86C Trainer and execute the
instructions. Also verify the effect of these instructions upon various Data Registers.

Report Required

1. Upload the solved task before the deadline mentioned in the course portal.
2. The solution should include code, snapshots, and any necessary comments/information to
explain the content.
3. Also, attach the hard copy of the solution with the blank sheet at the end of the Lab
Experiment.

72
Laboratory Assessment
Student Name: Reg. No.:

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Psychomotor
(Evaluated
60
during the
experiment)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(C)
Affective
(Evaluated 10
during the lab)

Marks
Allocated Poor Good Very Good Excellent
Criteria Obtained
Marks 40%-50% 51% - 70% 71% - 80% 81%-100%
(P)
Cognitive
(Evaluated on
30
report
submission

Obtained Marks=(0.6 × P ) + (0.1 × A) + (0.23× C) = : Total Marks:

Course Instructor: Date:

73
74
LIST OF COMPLEX ENGINEERING PROBLEMs
1. Design and Implementation of Real time Temperature Monitor
2. Design and Implementation of Decimal Calculator
3. Design and Implementation of Real time Temperature Monitor
4. Design and Implementation of Calculator of DC MOTOR RPM
5. Design and Implementation of Empty Parking Slot Identifier
6. Design and Implementation of Traffic Congestion Control
7. Design and Implementation of Room Lightening Management System
8. Design and Implementation of Collision Avoidance & Lane change in Vehicles
9. Design and Implementation of localization of an object in specific area
10. Design and Implementation of Wind direction and Speed Monitor
11. Design and Implementation of Intrusion Detection & Prevention

75

You might also like