SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP.
Interfacing of 8051 with 8255
Programmable Peripheral Interface
Why do we need to interface 8255 PPI with 8051?
Why do we need additional pins when we have enough on the 8051
already?
 For some applications, it is always recommended to use 8255 PPI to
avoid data loss and damage to the microcontroller.
 The 8051 has four ports: Out of four ports Port 0, Port 2, Port 3 – all
these ports also have alternate functions.
 But Port 1, this is the only port with no alternate functions. This is the
reason why we need to interface 8255 to provide an additional three
ports, namely Port A, Port B, and Port C. and the best part about the 8255
is that it is programmable.
Components Required
1. 8051 Microcontroller.
2. 8255 Programmable Peripheral Interface
3. Decoder circuit – 74LS373 (for address demultiplexing)
4. NAND gate IC – 74LS00
5. NOT gate IC – 74LS04
Chip Select Logic
For a microcontroller to interface with 8255, a LOW pulse is given to the Chip
Select pin of 8255 as it is an active low pin
Let’s allot the address to the ports of 8255 PPI
Port A: 0010 0000 (20H)
Port B: 0010 0001 (21H)
Port C: 0010 0010 (22H)
Control port: 0010 0011 (23H)
Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP.
Note that here only the last two bits – A0 and A1, are changed to select
different ports.
Hence, we can design a combinational logic circuit using a NAND gate for
which the input will be A2 – A7 address lines and CS’ as the output.
The output of the NAND gate is LOW only when ALL the inputs are HIGH.
Therefore, from the address allocations that we have done, we have:
A7 = 0, A6 = 0, A5 = 1, A4 = 0, A3 = 0, A2 = 0
Algorithm
Step 1: Construct the control word register
D7 = 1, this will make sure that all the ports of 8255 PPI are in the I/O mode.
D6 = D5 = D2 = 0: selects mode 0 for Port A, Port B, and Port C.
D4 = D1 = 1: To select Port A and Port B as input ports.
D3 = D0 = 0: To select both lower and upper Port C as output port.
Step 2: Input the data from Port A and Port B
Step 3: Add the contents of port A and port B
Step 4: Display the result in port C
Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP.
Circuit Diagram to interface 8255 PPI with 8051
Assembly Language Program to interface 8255 with 8051
PORTA EQU 0020H
PORTB EQU 0021H
PORTC EQU 0022H
CNTPORT EQU 0023H;
ORG 0000H
MOV A, #92H
MOV DPTR, #CNTPORT
MOVX @DPTR, A
Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP.
MOV DPTR, #PORTA
MOVX A, @DPTR
MOV R0, A
MOV DPTR, #PORTB
MOVX A, @DPTR
MOV R1, A
MOV A, R0
ADD A, R1;
MOV DPTR, #PORTC
MOVX @DPTR, A
END
**Note: For Referece
Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP.

More Related Content

PPTX
4.programmable dma controller 8257
PDF
Keypad Interfacing with 8051 Microcontroller
PDF
DAC Interfacing with 8051.pdf
PPT
Interfacing 8255
PPTX
Optical switching
PDF
8051 interfacing
PPTX
ADC and DAC Best Ever Pers
PPTX
ARM Processors
4.programmable dma controller 8257
Keypad Interfacing with 8051 Microcontroller
DAC Interfacing with 8051.pdf
Interfacing 8255
Optical switching
8051 interfacing
ADC and DAC Best Ever Pers
ARM Processors

What's hot (20)

PPTX
Architecture of 8051
PPT
Interfacing adc
PPT
Addressing modes of 8051
PPTX
I/O port programming in 8051
DOCX
Instrumentational Amplifier
PPTX
Vlsi stick daigram (JCE)
PPTX
Stick digram by Euler Approach
PPTX
8086 in minimum mode
PDF
Unit 3 mpmc
PPTX
INTRODUCTION TO MICROCONTROLLER
PPT
8051 microcontroller and it’s interface
PPT
Fan-in and Fan-out.ppt
PPTX
8051 Microcontroller ppt
PPTX
I2C introduction
PDF
8155 PPI
PDF
Optical Fiber Communication Part 3 Optical Digital Receiver
PPT
Serial Peripheral Interface(SPI)
PPTX
Microcontroller 8096
PPT
Pass Transistor Logic
PPT
Addressing modes
Architecture of 8051
Interfacing adc
Addressing modes of 8051
I/O port programming in 8051
Instrumentational Amplifier
Vlsi stick daigram (JCE)
Stick digram by Euler Approach
8086 in minimum mode
Unit 3 mpmc
INTRODUCTION TO MICROCONTROLLER
8051 microcontroller and it’s interface
Fan-in and Fan-out.ppt
8051 Microcontroller ppt
I2C introduction
8155 PPI
Optical Fiber Communication Part 3 Optical Digital Receiver
Serial Peripheral Interface(SPI)
Microcontroller 8096
Pass Transistor Logic
Addressing modes
Ad

Similar to Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdf (20)

PDF
8255 & IO Interfacing.pdf
PPT
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
PDF
Programmable Peripheral Devices
PPTX
Riddhima Varshney (25077) and Sujal Gupta (25098).pptx
PPT
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
PPT
PDF
Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pdf- MECHATRONICS-ENGGINERING
PPTX
8255 PPI.pptx
PDF
Programmable Peripheral Interface 8255
PPTX
Microprocessor Basics with all the required parts included
PPT
PPI-MECHATRONICS
DOC
8051 dev board guide
PDF
Peripherals of Microprocessor 8085
PDF
Micro Processor And Micro Controller for engineering in Pondicherry University
PPTX
L4-L6 8255 A.pptx
PPT
8255 PPI (programmable Peripheral Interface) mode 0
PPSX
8085 Interfacing with I/O Devices or Memory
PPTX
Programmable peripheral interface 8255
PPTX
Unit-IV.pptx
8255 & IO Interfacing.pdf
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
Programmable Peripheral Devices
Riddhima Varshney (25077) and Sujal Gupta (25098).pptx
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pdf- MECHATRONICS-ENGGINERING
8255 PPI.pptx
Programmable Peripheral Interface 8255
Microprocessor Basics with all the required parts included
PPI-MECHATRONICS
8051 dev board guide
Peripherals of Microprocessor 8085
Micro Processor And Micro Controller for engineering in Pondicherry University
L4-L6 8255 A.pptx
8255 PPI (programmable Peripheral Interface) mode 0
8085 Interfacing with I/O Devices or Memory
Programmable peripheral interface 8255
Unit-IV.pptx
Ad

More from Srikrishna Thota (18)

PDF
solar energy introduction.pdf
PDF
8051 Architecture and PIN Configuration.pdf
PDF
Types of Microcontrollers.pdf
PDF
Addressing modes of 8051.pdf
PDF
interrupts of 8051.pdf
PDF
Port Organization of 8051 .pdf
PDF
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
PDF
Seven segment interfacing with 8051.pdf
PDF
interfacing of temperature sensor LM 35 with 8051.pdf
PDF
BInary Number Representation
PPTX
Number Base Conversion Digital Electronics
PDF
Operational amplifiers
DOCX
Digital Electronics Notes
DOCX
The 8255 PPI
DOCX
Microprocessor Interfacing and 8155 Features
DOCX
Analog to Digital Conversion Basics
DOCX
8259 programmable interrupt controller
DOCX
8085 interfacing with memory chips
solar energy introduction.pdf
8051 Architecture and PIN Configuration.pdf
Types of Microcontrollers.pdf
Addressing modes of 8051.pdf
interrupts of 8051.pdf
Port Organization of 8051 .pdf
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
Seven segment interfacing with 8051.pdf
interfacing of temperature sensor LM 35 with 8051.pdf
BInary Number Representation
Number Base Conversion Digital Electronics
Operational amplifiers
Digital Electronics Notes
The 8255 PPI
Microprocessor Interfacing and 8155 Features
Analog to Digital Conversion Basics
8259 programmable interrupt controller
8085 interfacing with memory chips

Recently uploaded (20)

PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
master seminar digital applications in india
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Insiders guide to clinical Medicine.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Types and Its function , kingdom of life
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Cell Structure & Organelles in detailed.
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Lesson notes of climatology university.
STATICS OF THE RIGID BODIES Hibbelers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
O7-L3 Supply Chain Operations - ICLT Program
master seminar digital applications in india
Sports Quiz easy sports quiz sports quiz
human mycosis Human fungal infections are called human mycosis..pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Insiders guide to clinical Medicine.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Pharma ospi slides which help in ospi learning
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Types and Its function , kingdom of life
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Cell Structure & Organelles in detailed.
Complications of Minimal Access Surgery at WLH
Lesson notes of climatology university.

Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdf

  • 1. Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP. Interfacing of 8051 with 8255 Programmable Peripheral Interface Why do we need to interface 8255 PPI with 8051? Why do we need additional pins when we have enough on the 8051 already?  For some applications, it is always recommended to use 8255 PPI to avoid data loss and damage to the microcontroller.  The 8051 has four ports: Out of four ports Port 0, Port 2, Port 3 – all these ports also have alternate functions.  But Port 1, this is the only port with no alternate functions. This is the reason why we need to interface 8255 to provide an additional three ports, namely Port A, Port B, and Port C. and the best part about the 8255 is that it is programmable. Components Required 1. 8051 Microcontroller. 2. 8255 Programmable Peripheral Interface 3. Decoder circuit – 74LS373 (for address demultiplexing) 4. NAND gate IC – 74LS00 5. NOT gate IC – 74LS04 Chip Select Logic For a microcontroller to interface with 8255, a LOW pulse is given to the Chip Select pin of 8255 as it is an active low pin Let’s allot the address to the ports of 8255 PPI Port A: 0010 0000 (20H) Port B: 0010 0001 (21H) Port C: 0010 0010 (22H) Control port: 0010 0011 (23H)
  • 2. Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP. Note that here only the last two bits – A0 and A1, are changed to select different ports. Hence, we can design a combinational logic circuit using a NAND gate for which the input will be A2 – A7 address lines and CS’ as the output. The output of the NAND gate is LOW only when ALL the inputs are HIGH. Therefore, from the address allocations that we have done, we have: A7 = 0, A6 = 0, A5 = 1, A4 = 0, A3 = 0, A2 = 0 Algorithm Step 1: Construct the control word register D7 = 1, this will make sure that all the ports of 8255 PPI are in the I/O mode. D6 = D5 = D2 = 0: selects mode 0 for Port A, Port B, and Port C. D4 = D1 = 1: To select Port A and Port B as input ports. D3 = D0 = 0: To select both lower and upper Port C as output port. Step 2: Input the data from Port A and Port B Step 3: Add the contents of port A and port B Step 4: Display the result in port C
  • 3. Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP. Circuit Diagram to interface 8255 PPI with 8051 Assembly Language Program to interface 8255 with 8051 PORTA EQU 0020H PORTB EQU 0021H PORTC EQU 0022H CNTPORT EQU 0023H; ORG 0000H MOV A, #92H MOV DPTR, #CNTPORT MOVX @DPTR, A
  • 4. Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP. MOV DPTR, #PORTA MOVX A, @DPTR MOV R0, A MOV DPTR, #PORTB MOVX A, @DPTR MOV R1, A MOV A, R0 ADD A, R1; MOV DPTR, #PORTC MOVX @DPTR, A END **Note: For Referece
  • 5. Interfacing of 8051 with 8255 PPI T.Srikrishna, M.Sc, M.Tech, GVP.