SlideShare a Scribd company logo
1 of 5
Download to read offline
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

What's hot

Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
9840596838
 
Microprocessor 8086 nitin_p
Microprocessor 8086 nitin_pMicroprocessor 8086 nitin_p
Microprocessor 8086 nitin_p
nitinahire15
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
jemimajerome
 
T-states in microprocessor 8085
T-states in microprocessor 8085T-states in microprocessor 8085
T-states in microprocessor 8085
yedles
 

What's hot (20)

Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Combinational Logic with MSI and LSI
Combinational Logic with MSI and LSICombinational Logic with MSI and LSI
Combinational Logic with MSI and LSI
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Flags registers
Flags registersFlags registers
Flags registers
 
Microprocessor 8086 nitin_p
Microprocessor 8086 nitin_pMicroprocessor 8086 nitin_p
Microprocessor 8086 nitin_p
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
8086 String Instructions.pdf
8086 String Instructions.pdf8086 String Instructions.pdf
8086 String Instructions.pdf
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
8086 alp
8086 alp8086 alp
8086 alp
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)
 
Arduino lcd display
Arduino lcd displayArduino lcd display
Arduino lcd display
 
8255 PPI (programmable Peripheral Interface) mode 0
8255 PPI (programmable Peripheral Interface) mode 08255 PPI (programmable Peripheral Interface) mode 0
8255 PPI (programmable Peripheral Interface) mode 0
 
Interfacing to lcd with arduino
Interfacing  to lcd with arduinoInterfacing  to lcd with arduino
Interfacing to lcd with arduino
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA Controller
 
T-states in microprocessor 8085
T-states in microprocessor 8085T-states in microprocessor 8085
T-states in microprocessor 8085
 
Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051
 
VLSI lab report using Cadence tool
VLSI lab report using Cadence toolVLSI lab report using Cadence tool
VLSI lab report using Cadence tool
 

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

Io (2)
Io (2)Io (2)
Io (2)
Aisu
 
Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.
Prof. Swapnil V. Kaware
 

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

1204 Ppi 8255
1204 Ppi 82551204 Ppi 8255
1204 Ppi 8255
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
 
The 8255 PPI
The 8255 PPIThe 8255 PPI
The 8255 PPI
 
Programmable Peripheral Devices
Programmable Peripheral Devices Programmable Peripheral Devices
Programmable Peripheral Devices
 
8255 ppi
8255 ppi8255 ppi
8255 ppi
 
1.ppi 8255
1.ppi 8255 1.ppi 8255
1.ppi 8255
 
8255 Introduction
8255 Introduction8255 Introduction
8255 Introduction
 
Micro Processor And Micro Controller for engineering in Pondicherry University
Micro Processor And Micro Controller for engineering in Pondicherry UniversityMicro Processor And Micro Controller for engineering in Pondicherry University
Micro Processor And Micro Controller for engineering in Pondicherry University
 
Class7
Class7Class7
Class7
 
Programmable peripheral interface 8255
Programmable peripheral interface 8255Programmable peripheral interface 8255
Programmable peripheral interface 8255
 
Io (2)
Io (2)Io (2)
Io (2)
 
8255 ppi.pptx
8255 ppi.pptx8255 ppi.pptx
8255 ppi.pptx
 
8255 PPI
8255 PPI8255 PPI
8255 PPI
 
Unit iii microcontrollers final1
Unit iii microcontrollers final1Unit iii microcontrollers final1
Unit iii microcontrollers final1
 
8155 GPPI
8155 GPPI8155 GPPI
8155 GPPI
 
Microprocessors
Microprocessors Microprocessors
Microprocessors
 
8255
82558255
8255
 
Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.
 
1203 Ppi 8155
1203 Ppi 81551203 Ppi 8155
1203 Ppi 8155
 
Microprocessor Instructions
Microprocessor InstructionsMicroprocessor Instructions
Microprocessor Instructions
 

More from Srikrishna Thota

More from Srikrishna Thota (18)

solar energy introduction.pdf
 solar energy introduction.pdf solar energy introduction.pdf
solar energy introduction.pdf
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf
 
Types of Microcontrollers.pdf
Types of Microcontrollers.pdfTypes of Microcontrollers.pdf
Types of Microcontrollers.pdf
 
Addressing modes of 8051.pdf
Addressing modes of 8051.pdfAddressing modes of 8051.pdf
Addressing modes of 8051.pdf
 
interrupts of 8051.pdf
interrupts of 8051.pdfinterrupts of 8051.pdf
interrupts of 8051.pdf
 
Port Organization of 8051 .pdf
Port Organization of 8051 .pdfPort Organization of 8051 .pdf
Port Organization of 8051 .pdf
 
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdfDEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
 
DAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfDAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdf
 
Seven segment interfacing with 8051.pdf
Seven segment interfacing with 8051.pdfSeven segment interfacing with 8051.pdf
Seven segment interfacing with 8051.pdf
 
interfacing of temperature sensor LM 35 with 8051.pdf
interfacing of temperature sensor LM 35 with 8051.pdfinterfacing of temperature sensor LM 35 with 8051.pdf
interfacing of temperature sensor LM 35 with 8051.pdf
 
BInary Number Representation
 BInary Number Representation BInary Number Representation
BInary Number Representation
 
Number Base Conversion Digital Electronics
Number Base Conversion Digital ElectronicsNumber Base Conversion Digital Electronics
Number Base Conversion Digital Electronics
 
Operational amplifiers
Operational amplifiers Operational amplifiers
Operational amplifiers
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
 
Analog to Digital Conversion Basics
Analog to Digital Conversion BasicsAnalog to Digital Conversion Basics
Analog to Digital Conversion Basics
 
8259 programmable interrupt controller
8259 programmable interrupt controller8259 programmable interrupt controller
8259 programmable interrupt controller
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
 

Recently uploaded

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 

Recently uploaded (20)

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 

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.