Lab Report #1
Lab Report #1
Lab Report #1
Faculty of Engineering
Electrical-Computer Engineering Department
Section
EAG
Lab Time
Wednesday, 14:00–15:50
Submission Date
Team Members
Instructors
Dr Rania Elmanfalouty
Engineer Haneen
Table of Contents
Introduction ................................................................................................................................ 3
Objectives .................................................................................................................................. 3
Experiment ................................................................................................................................. 3
Results ........................................................................................................................................ 5
Conclusion ............................................................................................................................... 10
References ................................................................................................................................ 10
Introduction
Assembly language commands are used to control all processing units. It performs the basic
arithmetic and logical operations performed by the computer’s processor. As for the
microcontroller, it is a single element which combines the components needed to act as a single
unit. The aim of this laboratory was to familiarize students with the software used for assembly
language, which is MPLAB, and the software used for hardware simulation, which is Proteus
VSM. Alternatively, using Proteus Design software to analyze the schematics of a PIC18F4550
microcontroller is implemented. Proteus is a widely used tool by engineers that simulates the
behavior of more than 800 types of microcontrollers as well as a variety of other utilities [1].
Objectives
• To gain understanding of Assembly programming language
• To gain an understanding of MPLAB IDE
• To examine and use MPLAB assembler
• To examine and use MPLAB simulator
• To examine and use Proteus VSM (Virtual System Modelling) for hardware simulation
Experiment
Schematic Diagram
For exercises one through four, no schematic diagrams were needed since the results were
obtained using MPLAB. However, exercise 5 required the use of Proteus, thus a schematic
diagram was given as shown in Figure 1. The results of the constructed schematic are shown
in the Results section.
EXERCISE 1 EXERCISE 2
EXERCISE 3 EXERCISE 4
Figure 2: Exercise 1
The second exercise we wrote and assembled a program to add 5 random single digits numbers
and save the result in WREG. As shown in Figure 3 we first moved literal value 1H to the
WREG, after that we used ADD instruction to add the numbers 1H, 3H, 5H, 2H, 4H finally the
value in the WREG was 0F H which represents 10 in decimal.
Figure 3: Exercise 2
The third exercise was to write and assemble a program to set the value 30 in decimal to WREG
register, and then increment it by 3 and copy it to File Register location 40H. As shown in
Figure 4 we moved literal value 30d to WREG then we add 3 to WREG. Finally, we moved a
copy from the WREG contents to location 40H as shown in Figure 5 the final value was 21 hex
which is equal to 33d.
Figure 4: Exercise 3 (WREG)
Conclusion
In conclusion, the two tests were performed successfully, and the objectives were achieved.
Using the MPLAB software proved crucial in assembling and simulating commands as to the
program in a single step when analyzing the various variables. The results reflect accurate,
high-precision functional values. On the other hand, proving a PIC microcontroller's
performance using Proteus was simple and detailed. A clear understanding of both simulators
was obtained. All experiments show how interrelated they are. A computer simulation
framework like Proteus needs to simulate all microcontrollers and program them using
assembly language.
References