0% found this document useful (0 votes)
126 views

Lab 1-4 - Reports

This document provides information about a microprocessor and interfacing techniques laboratory course. The course aims to: 1. Teach students to write and simulate assembly language programs using MPLABX IDE and Proteus software to apply commands. 2. Develop PIC microcontroller programs to interface devices like LCDs, keyboards, and stepper motors. 3. Design microcontroller-based projects for practical applications. The course maps its learning outcomes to the program learning outcomes in areas like engineering knowledge, problem analysis, design and development of solutions, and lifelong learning. It also provides the list of experiments to be performed in the laboratory involving programming microcontrollers and interfacing various devices.

Uploaded by

Arslan Shafi
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)
126 views

Lab 1-4 - Reports

This document provides information about a microprocessor and interfacing techniques laboratory course. The course aims to: 1. Teach students to write and simulate assembly language programs using MPLABX IDE and Proteus software to apply commands. 2. Develop PIC microcontroller programs to interface devices like LCDs, keyboards, and stepper motors. 3. Design microcontroller-based projects for practical applications. The course maps its learning outcomes to the program learning outcomes in areas like engineering knowledge, problem analysis, design and development of solutions, and lifelong learning. It also provides the list of experiments to be performed in the laboratory involving programming microcontrollers and interfacing various devices.

Uploaded by

Arslan Shafi
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/ 29

Laboratory’s Course Learning Outcomes

Course Title : EE-342 Microprocessor and Interfacing Techniques Lab


Laboratory : Communication Lab (Lab 114)
Instructor : Engr. Muhammad Jamshed Abbass
Designation : Lab Engr., Faculty of Engineering &Applied Sciences
E-mail : Jamshed.abbass@riphah.edu.pk
Phone (Off.) :
Course Lab Objective:
Students will be able to:

CLO 1: Imitate different assembly language programs on MPLABX IDE and PROTEUS to
apply various commands. (Level: P-2)
CLO 2: Develop PIC microcontroller-based programs to interface LCD, keyboard and stepper
motors with PIC. (Level: P-4)
CLO 3: Design microcontroller-based project for practical applications. (Level P-5)
Mapping of Course Learning Outcomes (CLO) to Program Learning Outcomes (PLO) / Graduate
Attribute

Course CLOs/ PLO1 PLO2 PLO3 PLO4 PLO5 PLO6 PLO7 PLO8 PLO9 PLO 10 PLO 11 PLO 12
Code PLOs

CLO 1 x

CLO 2 x
EE-342
CLO 3 x

PLO1: Engineering Knowledge PLO8: Ethics


PLO2: Problem Analysis PLO9: Individual and Team Work
PLO3: Design/Development of Solutions PLO10: Communication
PLO4: Investigation PLO11: Project Management
PLO5: Modern Tool Usage PLO12: Lifelong Learning
PLO6: The Engineer and Society
PLO7: Environment and Sustainability
Department of Electrical Engineering
Faculty of Engineering & Applied Sciences
Riphah International University, Islamabad,
Pakistan

Program: B.Sc. Electrical Engineering Semester: IV


Subject: EE-342 Microprocessor and Interfacing Techniques Lab

List of Experiments
Sr. NO. Title Level of Inquiry CLO
A. Familiarization with MPLABX Compiler 0 1
Experiment 1
B. Familiarization with Proteous VSM
Simulator
Experiment 2 Introduction to Computer Architecture and LED 0 1
Interfacing using Arduino and PIC
Experiment 3 Interfacing LEDs with Arduino and PIC 0 1
microcontroller
Experiment 4 Branching statements in Arduino, PIC18 1 1
Microcontroller
Experiment 5 1 1
Time delay in Arduino and PIC microcontroller
Experiment 6 Perform arithmetic instructions inn in Arduino and 1 1
PIC microcontroller
Experiment 7 Logic/compare instructions and addressing modes in 1 1
Arduino, PIC microcontroller
Experiment 8 Hardware experimentation in Arduino and PIC 2 2
microcontroller
Experiment 9 1 2
C language in Arduino and PIC microcontroller
Experiment 10 Timers, counters and interrupt in Arduino and PIC 2 2
microcontroller
Experiment 11 LCD interfacing with Arduino and PIC 2 2
microcontroller
Interfacing 16×2 LCD and Keyboard 2 2
Experiment 12 A. With PIC18
B. Arduino
C. Raspberry Pi
Experiment 13 LCD interfacing with Arduino UNO 2 2
DC motor interfacing with Arduino UNO
Stepper/Servo Motor Control 2 2
Experiment 14
A. Using PIC18
B. Using Raspberry Pi
Experiment 15 3 3
PIC microcontroller-based project
Department of Electrical Engineering
Faculty of Engineering & Applied Sciences
Riphah International University, Islamabad, Pakistan

Program: B.Sc. Electrical Engineering Semester: IV


Subject: EE-342 Microprocessor and Interfacing Date: 28 March, 2022
Experiment 1: Introduction MPLABX IDE

OBJECTIVES: A. Familiarization with MPLABX Compiler

B. Familiarization with Porteous VSM Simulator

Name: Muhammad Arslan Shafi Roll No: 25215

Performance Lab Report

Description Total Marks Description Total Marks


Marks Obtained Marks Obtained
Individual Work 5 Organization/Structure 5
Contributions
and
Time
Management
Propose/Create 5 Calculation and 5
Multiple Data Presentation
Solutions
Total Marks obtained

Remarks (if any): ………………………………….

Name & Signature of faculty: …………………………………


Introduction to MPLABx IDE
Objectives:
i) Introduction and Familiarization with MPLABx IDE software.
ii) Basic Understanding of how to install and create project in MPLABx IDE.
iii) Basic C++ Coding using MPLABx IDE software.

Introduction:
1. MPLABx IDE:

MPLAB X Integrated Development Environment (IDE) is a software program that introduces


powerful tools to help configure, develop, debug and qualify embedded designs for most of
Microchip’s microcontrollers and digital signal controllers.
It is called an Integrated Development Environment, or IDE, because it provides a single
integrated environment to develop code for embedded microcontrollers.
2. Uses and Benefits of MPLABx IDE:

The MPLAB IDE provides the ability to:


➢ Create and edit source code using the built-in editor.
➢ Assemble, compile and link source code.
➢ Debug the executable logic by watching program flow with the built-in simulator or in
real time with in-circuit emulators or in-circuit debuggers.
➢ Make timing measurements with the simulator or emulator.
➢ View variables in Watch windows.
➢ Program firmware into devices with device programmers

3. Languages used in MPLABx IDE:

➢ C/C++
➢ Shell Scripts
➢ Make file
➢ SQL
➢ Assembly
➢ HTML
➢ Java Script
➢ XML

Procedure:
Steps for creating a basic C++ code in MPLABx IDE:
1. Create a new Project in the MPLABx IDE Program by selecting Standalone Project in
options given.
2. Select Family ➔ Advanced 8-bit MCUs
Select Device ➔ PIC18F458

3. Select Hardware Tool Kit ➔ PICkit3


4. Select Compiler ➔ MPASM v (5.68)

5. Select Location and Name of Project.


6. Select File > Project Properties > Language > C++ > C++ Main File

7. Now Create a C++ based Program in the main file.


8. In this program I created a simple calculator which performs arithmetical operations on
two variables based on the user’s choice.
9. The basic operations include Addition, Subtraction, Multiplication and Division.
10. As we simulate the program the following Error is displayed because no
microcontroller chip is attached to it.

Introduction to Proteus.
Objectives
iv) Introduction and Familiarization with Proteus software.
v) Basic Understanding of how to install and create project in Proteus.
vi) To interface LEDs with PIC microcontroller using Proteus.

Introduction
4. Proteus Software

It is a software suite containing schematic, simulation as well as PCB designing.


• ISIS is the software used to draw schematics and simulate the circuits in real time. The
simulation allows human access during run time, thus providing real time simulation.
• ARES is used for PCB designing. It has the feature of viewing output in 3D view of
the designed PCB along with components.
• The designer can also develop 2D drawings for the product.

5. Micro controller Simulation

The micro-controller simulation in Proteus works by applying either a hex file or a debug file
to the microcontroller part on the schematic. It is then co-simulated along with any analog and
digital electronics connected to it. This enables its use in a broad spectrum of project
prototyping in areas such as motor control, temperature control and user interface design, since
no hardware is required, is convenient to use as training or teaching tool. Support is available
for co-simulation of:
• Microchip Technologies PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC33
Microcontrollers.
• Atmel AVR (and Arduino), 8051 and ARM Cortex-M3 Microcontrollers
• NXP 8051, ARM7, ARM Cortex-M0 and ARM Cortex-M3 Microcontrollers.
• Texas Instruments MSP430, PICCOLO DSP and ARM Cortex-M3 Microcontrollers.
• Parallax Basic Stamp, Freescale HC11, 8086 Microcontrollers

Procedure:
Steps for creating a basic code for interfacing LEDs with microcontroller:
11. Open the Proteus Software installed in your system, a starting Main page will appear.
12. Create a new Project in the Proteus Software by selecting New Project in File options
given and give your project a Name and Location.

13. Select ➔ Do not create a Schematic Option


We can choose any Schematic Option we want to use as per requirements of our projects.

14. Select ➔ Do not create a PCB layout


If we desire to use any PCB layout then it can be chosen form options given.
15. Select ➔ No Firmware Project.
Firmware is a software program permanently etched into a hardware device such as
a keyboards, hard drive, BIOS, or video card.

16. The following dialogue box gives a summary of all the options selected.
Click Finish to create the project.
17. Select the following devices form PICK DEVICES
PIC18F458 , LED BODY
Connect the PIC controller with a 5V source and connect the LED on output Port. Write
a program using assembly language for a Blinking LED on the PIC firmware.

(Single LED Blinking)


Conclusion
Today we performed an introductory lab in which we were introduced to the MPLABx IDE
software and taught how to install and create a new project for basic coding of a microcontroller.
We were also informed about its importance and uses in the field of electrical engineering.
In this lab we performed an informatory lab in which we were introduced to the Proteus software
and taught how to install and create a new project for basic coding of a microcontroller as well as
how to write programs in the firmware of PIC microcontroller. We were also informed about its
importance and uses in the field of electrical engineering.
Department of Electrical Engineering
Faculty of Engineering & Applied Sciences
Riphah International University, Islamabad, Pakistan

Program: B.Sc. Electrical Engineering Semester: IV


Subject: EE-342 Microprocessor and Interfacing Date: 5 April, 2022
Experiment 2: Introduction to Computer Architecture and LED Interfacing using Arduino
and PIC
OBJECTIVES:

You will learn following.

• Introduction to Arduino and PIC


• LED Interfacing with Arduino and PIC

Name: Muhammad Arslan Shafi Roll No: 25215

Performance Lab Report

Description Total Marks Description Total Marks


Marks Obtained Marks Obtained
Individual Work 5 Organization/Structure 5
Contributions
and
Time
Management
Propose/Create 5 Calculation and 5
Multiple Data Presentation
Solutions
Total Marks obtained

Remarks (if any): ………………………………….

Name & Signature of faculty: …………………………………


Introduction to Arduino
Objectives:
i) Introduction and Familiarization with Arduino IDE software.
ii) Basic Understanding of how to install and create project in Arduino IDE.
iii) Basic C++ Coding using Arduino IDE software.

Introduction:
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a
Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing
something online.

There are many other microcontrollers and microcontroller platforms available for physical
computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard, and many
others offer similar functionality. All of these tools take the messy details of microcontroller
programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of
working with microcontrollers, but it offers some advantage for teachers, students, and interested
amateurs over other systems:

• Inexpensive: Arduino boards are relatively inexpensive compared to other microcontroller


platforms. The least expensive version of the Arduino module can be assembled by hand,
and even the pre-assembled Arduino modules cost less than \$50
• Cross-platform: The Arduino Software (IDE) runs on Windows, Macintosh OSX, and
Linux operating systems. Most microcontroller systems are limited to Windows.
• Simple, clear programming environment: The Arduino Software (IDE) is easy-to-use
for beginners, yet flexible enough for advanced users to take advantage of as well. For
teachers, it's conveniently based on the Processing programming environment, so students
learning to program in that environment will be familiar with how the Arduino IDE works.
• Open source and extensible software: The Arduino software is published as open source
tools, available for extension by experienced programmers. The language can be expanded
through C++ libraries, and people wanting to understand the technical details can make the
leap from Arduino to the AVR C programming language on which it's based. Similarly,
you can add AVR-C code directly into your Arduino programs if you want to.
• Open source and extensible hardware: The plans of the Arduino boards are published
under a Creative Commons license, so experienced circuit designers can make their own
version of the module, extending it and improving it. Even relatively inexperienced users
can build the breadboard version of the module in order to understand how it works and
save money.
Types of Arduino:
1. Arduino UNO

2. Lilypad Arduino

3. Arduino Mega
4. Arduino Leonardo

5. Arduino Red Board

LED Interfacing with Arduino:


Code:

Conclusion:
For the electronic project, there are number of Arduino products available in the market.
And the selection of the Arduino product is completely based on the requirement of project and
budget of the project. All the products have different features, uses and selection of right product
is completely dependent on user requirements.
Department of Electrical Engineering

Faculty of Engineering & Applied Sciences


Riphah International University, Islamabad, Pakistan

Program: B.Sc. Electrical Engineering Semester: IV


Subject: EE-342 Microprocessor and Interfacing Date: 12 April, 2022
Experiment 3: Interfacing LEDs with Arduino and PIC microcontroller

OBJECTIVES:

You will learn following.

• To create a program to interface LEDs with Arduino and PIC microcontroller Introduction
and Familiarization with Proteus and Thinkercad software.
• Basic Understanding of how to install and create project in Proteus.
• To interface LEDs with Arduino and PIC microcontroller using Assembly and C language.

Name: Muhammad Arslan Shafi Roll No: 25215

Performance Lab Report

Description Total Marks Description Total Marks


Marks Obtained Marks Obtained
Individual Work 5 Organization/Structure 5
Contributions
and
Time
Management
Propose/Create 5 Calculation and 5
Multiple Data Presentation
Solutions
Total Marks obtained

Remarks (if any): ………………………………….

Name & Signature of faculty: …………………………………


OBJECTIVES:

• To create a program to interface LEDs with Arduino and PIC microcontroller


• Introduction and Familiarization with Proteus and Tinkercad software.
• Basic Understanding of how to install and create project in Proteus.
• To interface LEDs with Arduino and PIC microcontroller using Assembly and C language.

Interface LEDs with Arduino:

Code:
void setup()

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(11, OUTPUT);

pinMode(10, OUTPUT);

}
void loop()

digitalWrite(13, HIGH);

digitalWrite(12, LOW);

digitalWrite(11, LOW);

digitalWrite(10, LOW);

delay(1000);

digitalWrite(13, LOW);

digitalWrite(12, HIGH);

digitalWrite(11, LOW);

digitalWrite(10, LOW);

delay(1000);

digitalWrite(13, LOW);

digitalWrite(12, LOW);

digitalWrite(11, HIGH);

digitalWrite(10, LOW);

delay(1000);

digitalWrite(13, LOW);

digitalWrite(12, LOW);

digitalWrite(11, LOW);

digitalWrite(10, HIGH);

delay(1000);

}
Conclusion:

The goals that we set out to achieve in the purpose were all achieved as we proved in the
video. Similarly, the whole process was documented in the schematic and theory sections. These
all prove that the Arduino platform is indeed beginner friendly (even though it came without
instructions!) and that getting the hardware equivalent of a "hello, world" program of blinky
LEDs resulted in few hassles.
Department of Electrical Engineering
Faculty of Engineering & Applied Sciences
Riphah International University, Islamabad, Pakistan

Program: B.Sc. Electrical Engineering Semester: IV


Subject: EE-342 Microprocessor and Interfacing Date: 19 April, 2022
Experiment 4: Branching statements in Arduino and PIC18 Microcontroller
OBJECTIVES:

You will learn following.

• To create branches in Arduino and PIC microcontroller


• To blink LEDs by creating loops in Arduino and PIC microcontroller

Name: Muhammad Arslan Shafi Roll No: 25215

Performance Lab Report

Description Total Marks Description Total Marks


Marks Obtained Marks Obtained
Individual Work 5 Organization/Structure 5
Contributions
and
Time
Management
Propose/Create 5 Calculation and 5
Multiple Data Presentation
Solutions
Total Marks obtained

Remarks (if any): ………………………………….

Name & Signature of faculty: …………………………………


OBJECTIVES:

• To create branches in Arduino and PIC microcontroller


• To blink LEDs by creating loops in Arduino and PIC microcontroller

Introduction:
This simple little project uses an Arduino and some LEDs to replicate a traffic light. It uses code
as an internal timer and continues to run until you cut the Arduino's power supply. This project is
done to give you an idea of how the traffic light controller works. This is not the real time traffic
light controller. So, at start, green light of signal 1 and red lights at other signals will light up to
give time to the vehicles at signal 1 to pass. After 5 seconds, the yellow light at signal 1 will light
up to give an indication that the red light at signal 1 is about to come up and also to give an
indication to the vehicles at signal 2 that the green light is about to light up. So, after 2 seconds,
red light at signal 1 will come up and green light at signal will come up meaning vehicles at signal
1 must stop and vehicles at signal 2 can move. Similarly, the traffic light controller will work for
the signal 3, signal 4 and the system will keep looping.

Tinkercad Schematics:

Code:
void setup()

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);
pinMode(11, OUTPUT);

pinMode(10, OUTPUT);

pinMode(9, OUTPUT);

pinMode(8, OUTPUT);

pinMode(7, OUTPUT);

pinMode(6, OUTPUT);

pinMode(5, OUTPUT);

pinMode(4, OUTPUT);

pinMode(3, OUTPUT);

pinMode(2, OUTPUT);

void loop()

digitalWrite(13, 0);

digitalWrite(12, 0);

digitalWrite(11, 1);

digitalWrite(10, 1);

digitalWrite(9, 0);

digitalWrite(8, 0);

digitalWrite(7, 1);

digitalWrite(6, 0);

digitalWrite(5, 0);

digitalWrite(4, 1);
digitalWrite(3, 0);

digitalWrite(2, 0);

delay(4000);

digitalWrite(13, 0);

digitalWrite(12, 1);

digitalWrite(11, 0);

digitalWrite(10, 0);

digitalWrite(9, 1);

digitalWrite(8, 0);

digitalWrite(7, 1);

digitalWrite(6, 0);

digitalWrite(5, 0);

digitalWrite(4, 1);

digitalWrite(3, 0);

digitalWrite(2, 0);

delay(2000);

digitalWrite(13, 1);

digitalWrite(12, 0);

digitalWrite(11, 0);

digitalWrite(10, 0);

digitalWrite(9, 0);

digitalWrite(8, 1);

digitalWrite(7, 1);

digitalWrite(6, 0);
digitalWrite(5, 0);

digitalWrite(4, 1);

digitalWrite(3, 0);

digitalWrite(2, 0);

delay(4000);

digitalWrite(13, 1);

digitalWrite(12, 0);

digitalWrite(11, 0);

digitalWrite(10, 0);

digitalWrite(9, 1);

digitalWrite(8, 0);

digitalWrite(7, 1);

digitalWrite(6, 0);

digitalWrite(5, 0);

digitalWrite(4, 0);

digitalWrite(3, 1);

digitalWrite(2, 0);

delay(2000);

digitalWrite(13, 1);

digitalWrite(12, 0);

digitalWrite(11, 0);

digitalWrite(10, 1);

digitalWrite(9, 0);

digitalWrite(8, 0);
digitalWrite(7, 1);

digitalWrite(6, 0);

digitalWrite(5, 0);

digitalWrite(4, 0);

digitalWrite(3, 0);

digitalWrite(2, 1);

delay(4000);

digitalWrite(13, 1);

digitalWrite(12, 0);

digitalWrite(11, 0);

digitalWrite(10, 1);

digitalWrite(9, 0);

digitalWrite(8, 0);

digitalWrite(7, 0);

digitalWrite(6, 1);

digitalWrite(5, 0);

digitalWrite(4, 0);

digitalWrite(3, 1);

digitalWrite(2, 0);

delay(2000);

digitalWrite(13, 1);

digitalWrite(12, 0);

digitalWrite(11, 0);

digitalWrite(10, 1);
digitalWrite(9, 0);

digitalWrite(8, 0);

digitalWrite(7, 0);

digitalWrite(6, 0);

digitalWrite(5, 1);

digitalWrite(4, 1);

digitalWrite(3, 0);

digitalWrite(2, 0);

delay(4000);

digitalWrite(13, 0);

digitalWrite(12, 1);

digitalWrite(11, 0);

digitalWrite(10, 1);

digitalWrite(9, 0);

digitalWrite(8, 0);

digitalWrite(7, 0);

digitalWrite(6, 1);

digitalWrite(5, 0);

digitalWrite(4, 1);

digitalWrite(3, 0);

digitalWrite(2, 0);

delay(2000);

}
Conclusion:
There are total of 12 LEDs used in this project. Each signal has 3 LEDs (Red, Yellow and
Green) connected to it through the 220-ohm resistors. The resistors are used to limit the current
that is going to pass through the LEDs. If you won’t use the resistors then the LEDs may burn due
to excessive current.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy