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

Experiment 8

1) The document describes an experiment interfacing LEDs with an 8255 Programmable Peripheral Interface chip using an 8086 microprocessor kit. 2) The experiment had two tasks - making the LEDs blink together, and then blink in a clockwise direction by changing which LED is on. 3) Code segments in assembly language were written to control the 8255 chip and output patterns to the LED ports to achieve the desired blinking patterns.

Uploaded by

ZAHID HOSSAIN
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)
60 views

Experiment 8

1) The document describes an experiment interfacing LEDs with an 8255 Programmable Peripheral Interface chip using an 8086 microprocessor kit. 2) The experiment had two tasks - making the LEDs blink together, and then blink in a clockwise direction by changing which LED is on. 3) Code segments in assembly language were written to control the 8255 chip and output patterns to the LED ports to achieve the desired blinking patterns.

Uploaded by

ZAHID HOSSAIN
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/ 5

Heaven’s Light is Our Guide

Rajshahi University of Engineering & Technology

Department of Electrical & Electronic Engineering

: Microprocessor, Interfacing and System design


Course Title Sessional

Course No : EEE 3210


Experiment No : 08
Name of the Experiment : LED Interfacing with 8255 PPI.
Date of Experiment : 06 December, 2023
Date of Submission : 13 December, 2023

Submitted by Submitted to

Name : Zahid Hossain Belal Hossain

Roll : 1901145 Assistant Professor

Section : C Department of EEE

Session : 2019-20 RUET


Experiment No: 08
Experiment Name: LED Interfacing with 8255 PPI.
Objectives:
1. To know the function of 8255 PPI.
2. To know how to write a code for blinking the LED of a MDA8086 kit.
Theory:
8255 is a popularly used parallel, programmable input-output device. It can be used to
transfer data under various condition from simple input-output to interrupt input-output.
This is economical, functional, flexible but is a little complex and general purpose i/o
device that can be used with almost any microprocessor. It has 24 pins that can be
grouped in two 8-bit parallel ports: A and B called Port A(PA) and Port B(PB) with the
remaining eight known as Port C(PC). Port C can be further divided into groups of 4-
bits ports named Cupper (Cu) and Clower (Cl). There are 40 pins and operates in +5
regulated power supply.
Modes of 8255 – It works in two modes:
1. Bit set reset (BSR) mode.
2. Input/output (I/O) mode.

Control Word Format

Mode Selection Port-C


00-Mode 0 Port-B
Upper
01-Mode 1 0 - Input
1 - Input
10-Mode 2 1 - Output
0 - Output

D7 D6 D5 D4 D3 D2 D1 D0

Mode Port-C
1- I/O Mode Port-A
Selection Lower
0- BSR 0 - Input
0 - Mode 0 1 - Input
Mode 1 - Output
1 - Mode 1 0 - Output

➢ BSR Mode: When MSB of the control register is zero (0), 8255 works in Bit Set-
Reset mode.in this only PC bit are used for set and reset.
➢ I/O Mode: When MSB of the control register is one (1), 8255 works in Input-
Output mode.it is further divided into three categories.
➢ Mode 0: In this mode all three ports (PA, PB, PC) can work as simple input
function or output function also in this mode there is no interrupt handling
capabilities.
➢ Mode 1: In this either port A or port B can work and port C bits are used as
Handshake signal before actual data transmission plus it has interrupt handling
capabilities.
➢ Mode 2: In this only port A works and port B can work either in Mode 0 or
Mode 1: and the 6 bits of port C are used as Handshake signal plus it also has
to interrupt handling capability.
➢ Three 8-Bit I/O Ports:
Port A (PA): 8-bit bidirectional port.
Port B (PB): 8-bit bidirectional port.
Port C (PC): 8-bit port with two 4-bit nibbles.

Required Apparatus:
1. MDA8086 Kit.
2. Computer.

Three 8-Bit I/O Ports:


➢ Port A (PA): 8-bit bidirectional port.
➢ Port B (PB): 8-bit bidirectional port.
➢ Port C (PC): 8-bit port with two 4-bit nibbles. Each nibble can be individually
programmed as either input or output.

Codes:
Task 01: For Blinking bulbs together.

CODE SEGEMNT
ASSUME CS:CODE,DS:CODE
PORTB EQU 1BH
CNTRL EQU 1FH
ORG 1000H START:
MOV AL,10000000B
OUT CNTRL, AL
L1:
MOV AL,00001111B
OUTPUT PORTB, AL
MOV CX, 0FFFFH
LOOP1:
NOP
NOP
NOP
LOOP LOOP1
JMP L1
CODE ENDS
END START
Output:

Fig. 01: LED Blinking.


Task 02: Blinking LED in Clockwise Direction.
Codes:
CODE SEGMENT
ASSUME CS:CODE, DS:CODE

PORTB EQU 1BH


CTRL EQU 1FH

ORG 1000H
START:
MOV AL,80H
OUT CTRL,AL
L2:
MOV SI,OFFSET DATA
L3:
MOV AL,BYTE PTR DS:[SI]
CMP AL,00H
JE L2

OUT PORTB, AL
CALL DELAY
INC SI
JMP L3

DATA DB 00000001B
DB 00000010B
DB 00001000B
DB 00000100B
DB 00H

DELAY PROC NEAR


MOV CX,0FFFFH
L1:
NOP
NOP
LOOP L1
RET
DELAY ENDP
CODE ENDS
END START
Output:

a) LED 11 (RED) is on. b) LED 12 (green) is on.

c) LED 14 (RED) is on. d) LED 13 (YELLOW) is on.


Fig. 02: Blinking of LED in clockwise direction.

Discussion and Conclusion: The experiment of blinking light in using 8255 PPI was
done successfully. In task 01, the LEDs in 8086 kit were blinking together. In task 2,
the LEDs were blinking in clockwise direction. The proper steps were maintain during
the experiment.

You might also like