BSEE-19/A: Embedded System Lab
BSEE-19/A: Embedded System Lab
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)
❖ 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
❖ 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.
;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
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
❖ PCB LAYOUT:
❖ BOTTOM VIEW:
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