BSEE-19/A: Embedded System Lab

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

BSEE-19/A

Embedded system lab

LAB REPORT 03

Submitted to:
Sir Asad ur Rehman
Submitted by:
Syeda Armish Subzwari (200401074)
Asad Iqbal (200401033)
Irfan Ahmed (200401052)

Institute of Space Technology 0


❖ TITLE
PIC microchip Hardware and Interfacing techniques

❖ Objective:
To get familiar with hardware and the usage of PIC16F877A microcontroller.
2. To explain how to interface many different input and output devices to the PIC
microcontroller.
3. To make them understand Protius Simulation and PCB design software.
❖ Software Use:
We use software for this lab is Proteus and MPLAB.

❖ INTRODUCTION:
Drawing of the internal block of PIC16F877 is confirmed in discern 1-1. %
incorporates i ALU, which performs facts and performance on common enjoy,
RAM, also called "check in-document", EEPROM (Flash reminiscence) gadget,
EEPROM records, and "W" Subscribe. The “W” sign in is not continually part of
the document within the report but i am impartial, on foot login (additionally
referred to as “accumulator”). ALU, RAM "W" sign up, and data each EEPROM
manages and shops 8-bit-big facts, transferring in price from 0 to 255 (or, in
hexadecimal, from 0x00 to 0xFF). EEPROM (Flash memory) works with 14 capital
letters and covers all human instructions. It is not uncommon for microcontrollers
to have unique memory report sizes as properly software memory (within %: 8 bits
of facts and 14 bits of software program clauses) extra than that is, what subjects is
that data and gadget reminders take area in exclusive locations. This allows get
admission to all of them at the same time.
❖ Equipment/Apparatus:
1. PIC Microcontroller 16F877A
2. crystal
3. Resistors
4. Capacitors
5. Proteus Software
6. MP Lab software

Institute of Space Technology 1


❖ Task 1:
Draw a given circuit diagrams in Proteus ISIS software and submit the hard copy
of your circuit diagram.

❖ PROCEDURE:
1. Draw a circuit diagram that are present in lab manual.
2. Add the components of crystal, led lights, resistor, capacitors, and
PICF877A(microcontroller).
3. Connect the wires according to the circuit as we are placed the wires on
PORT D.
4. Then we write the program code on MPLAB software and in proteus we
have to connect the wires on PORT B and write the code according to it.
5. After doing the coding, save it, and observe the results.
6. The results observe that on start LED1 will glow and other all will OFF at the
same time.
7. On 1s the LED1 will turned OFF and LED 2 will glow and further LEDs will
OFF.
8. On 2s the LED1 will turned OFF and LED 2 will also OFF, LED3 will turned ON
and further LED will OFF.
9. On 3s the LED1, LED 2 and LED3 will turned OFF and LED 4 will ON.
10.On 4s the LED1, LED 2 and LED3 and LED 4 will ON.
11.On 5s the LED1, LED 2 and LED3 and LED 4 will OFF.
12.This process will repeat itself until the run is stopped.
13.This program is applied to microcontroller by add .hex file of MP lab
program into its properties.

Institute of Space Technology 2


❖ Code:
;Equate section
portd equ 08h
trisd equ 88h
status equ 03h
countequ 20h
count1 equ 21h

;List program
list p=16f877a
org 0
goto start
__config h'3f79'
;Delay program of 1 sec
delay movlw .255
movwf count
movlw .255
movwf count1
a decfsz count,1
goto a
decfsz count1,1
goto a
retlw 0

;port configuration
start
banksel trisd
movlw b'00000000'
movwf trisd
banksel portd
clrf portd

Institute of Space Technology 3


;Main program
again
movlw h'08'
movwf portd
call delay

movlw h'04'
movwf portd
call delay

movlw h'02'
movwf portd
call delay

movlw h'01'
movwf portd
call delay

movlw h'0f'
movwf portd
call delay

movlw h'00'
movwf portd
call delay

goto again
end

Institute of Space Technology 4


❖ Circuit Diagram :

❖ PCB LAYOUT:

Institute of Space Technology 5


❖ 3D VIEW:
❖ TOP VIEW:

❖ BOTTOM VIEW:

Institute of Space Technology 6


❖ Results:
The MPU6050 has a systematic interference system that can produce interference
signal in the INT pin. Status flags indicate the source of the disturbance. Disruption
sources may be enabled and disabled individually. As you can see from the block
diagram that memory registers are easily accessible by various modules in the data
bus.
❖ Conclusion:

This section describes how to work with many different input and output devices in
the PIC microcontroller. Examples of BASIC code are provided by Basic Stamp
users or PICAXE systems. Descriptions of BASIC instructions are provided in
Commands section (available separately).

THE END

Institute of Space Technology 7

You might also like