SlideShare a Scribd company logo
1 of 24
PPI : 82C55
   The 82C55 is a popular interfacing component,
    that can interface any TTL-compatible I/O device
    to the microprocessor.
   It is used to interface to the keyboard and a
    parallel printer port in PCs (usually as part of an
    integrated chipset).
   Requires insertion of wait states if used with a
    microprocessor using higher that an 8 MHz clock.
   PPI has 24 pins for I/O that are programmable in
    groups of 12 pins and has three distinct modes of
    operation.
   In the PC, an 82C55 or its equivalent is decoded
    at I/O ports 60H-63H.
8255 Block Diagram
Pin layout of 8255
Interfacing 8255 PPI
8255 Programmable Peripheral Interface
               Data bus
                           D[7:0]
                                                            PA[7:0]
                      A0
 8086                 A1                                    PB[7:0]
                     RD         Control port
                     WR                                     PC[7:0]
                   RESET
          A7                                 CS
          A6
          A5
          A4
          A3
          A2                     A1     A0        Port
        IO/M
                            0       0             PA
                            0       1             PB
                            1       0             PC
                            1       1             Control
8255 Programmable Peripheral
          Interface
Programming 8255
 8255 has three operation modes: mode 0, mode 1, and mode 2
Programming 8255
 Mode 0:
  — Ports A, B, and C can be individually programmed as input or output ports
  — Port C is divided into two 4-bit ports which are independent from each other

 Mode 1:
  — Ports A and B are programmed as input or output ports
  — Port C is used for handshaking

                         PA[7:0]                                PA[7:0]
            PC4         STBA                       PC7         OBFA
            PC5         IBFA                       PC6         ACKA
            PC3         INTRA                      PC3         INTRA
       8255             PB[7:0]               8255              PB[7:0]
            PC2         STBB                       PC2         OBFB
            PC1         IBFB                       PC1         ACKB
            PC0         INTRB                      PC0         INTRB
          PC6, 7                                 PC4, 5
Programming 8255
 Mode 2:
   — Port A is programmed to be bi-directional
   — Port C is for handshaking
   — Port B can be either input or output in mode 0 or mode 1

                                        PA[7:0]
                        PC7          OBFA
                        PC6          ACKA
                        PC4          STBA
               8255     PC5          IBFA
                        PC3          INTRA
                        PC0                          In    Out       STBB      OBFB
                        PC0                          In    Out       IBFB      ACKB
                        PC0                          In    Out       INTRB     INTRB
                                        PB[7:0]
                                                      Mode 0              Mode 1
  1.   Can you design a decoder for an 8255 chip such that its base address is 40H?
  2.   Write the instructions that set 8255 into mode 0, port A as input, port B as output,
       PC0-PC3 as input, PC4-PC7 as output ?
Timing diagram is a combination of the Mode 1 Strobed Input
and Mode 1 Strobed Output Timing diagrams.
Example: Mode 1 Input
                                       8255           keyboard
   BIT5        EQU     20H
                                          PA0
   PORTC       EQU     22H
   PORTA       EQU     20H               PA7


   READ        PROC NEAR
   Read:                                       STB
                                         PC4          DAV
    •   IN AL, PORTC    ; read portc
    •   TEST AL, BIT5   ;test IBF
    •   JZ Read         ;if IBF=0
    •   IN AL, PORTA    ;Read Data
   READ        ENDP
Example: Mode 1 output
    8255           Printer

       PB0

       PB7



             ACK             Data Strobe : to tell
      PC2          ACK       the printer to latch the
                             incoming data.
      PC4           DS
                             Generated Externally
Example: Mode 1 output
BIT1 EQU    2                   ;send character to printer
PORTC       EQU 62H             MOV AL, AH ;get data
                                OUT PORTB, AL ;print
PORTB       EQU 61H                data
CMD EQU     63H                 ; send data strobe to
PRINT       PROC NEAR              printer
  ; check printer ready?        MOV AL, 8 ;clear DS
  IN AL, PORTC ;get OBF         OUT CMD, AL
  TEST AL, BIT1 ;test OBF       MOV AL, 9 ;clear DS
  JZ PRINT ;if OBF=0 buffer     OUT CMD, AL
     is full                    ;rising the data at the
                                   positive edge of DS
                                RET
                              PRINT ENDP
Keyboard example 1/2
Keyboard example 2/2
Programmable Timer 8254
8254 Programming
8254 Programming

   Each counter may be programmed
    with a count of 1 to FFFFH.
    • Minimum count is 1 all modes except 2
      and 3 with minimum count of 2.
   Each counter has a program control
    word used to select the way the
    counter operates.
    • If two bytes are programmed, then the
      first byte (LSB) stops the count, and the
      second byte (MSB) starts the counter
      with the new count.
8254 Read Back Command
 8254 Read Back Command


    1      1    COUNT STATUS CNT2    CNT1   CNT0     0


 8254 status word format

         NULL
 OUTPUT COUNT    RW1    RW0    M2     M1     M0    BCD




  NULL COUNT: goes low when the new count written to a counter is
               actually loaded into the counter
8254 Modes

       Mode 0: An events counter enabled with G.
    •     The output becomes a logic 0 when the control word is
          written and remains there until N plus the number of
          programmed counts.




Mode 1: One-shot mode.
    •     The G input triggers the counter to output a 0 pulse for
          `count' clocks.
    •     Counter reloaded if G is pulsed again.
8254 Modes

   Mode 2: Counter generates a series of pulses 1 clock pulse
    wide.
    • The seperation between pulses is determined by the count.
    • The cycle is repeated until reprogrammed or G pin set to 0.




    • Mode 3: Generates a continuous square-wave with G set to 1.
           If count is even, 50% duty cycle otherwise OUT is high 1 cycle
            longer.
8254 Modes

   Mode 4: Software triggered one-shot
    • (G must be 1).




   Mode 5: Hardware triggered one-
    shot. G controls similar to Mode 1.

More Related Content

What's hot

Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Aarav Soni
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O portsanishgoel
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptxMemonaMemon1
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureDominicHendry
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 completeShubham Singh
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor Mustapha Fatty
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction setprakash y
 
MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration AKHIL MADANKAR
 
8086 modes
8086 modes8086 modes
8086 modesPDFSHARE
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacingdeval patel
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesSrikrishna Thota
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic familiesBLESSINAR0
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controllerabhikalmegh
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller featuresTech_MX
 

What's hot (20)

Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptx
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration
 
8086 modes
8086 modes8086 modes
8086 modes
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic families
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller features
 
8251 USART
8251 USART8251 USART
8251 USART
 

Viewers also liked

Viewers also liked (10)

7 8255
7 82557 8255
7 8255
 
8255_utkarsh_kulshrestha
8255_utkarsh_kulshrestha8255_utkarsh_kulshrestha
8255_utkarsh_kulshrestha
 
Timer
TimerTimer
Timer
 
8085 interrupts
8085 interrupts8085 interrupts
8085 interrupts
 
Control chap10
Control chap10Control chap10
Control chap10
 
Notes nyquist plot and stability criteria
Notes nyquist plot and stability criteriaNotes nyquist plot and stability criteria
Notes nyquist plot and stability criteria
 
Nyquist and polar plot 118 & 117
Nyquist and polar plot 118 & 117Nyquist and polar plot 118 & 117
Nyquist and polar plot 118 & 117
 
8085 interrupts
8085 interrupts8085 interrupts
8085 interrupts
 
Interrupts of microprocessor 8085
Interrupts of microprocessor  8085Interrupts of microprocessor  8085
Interrupts of microprocessor 8085
 
Chapter 4 - Digital Transmission
Chapter 4 - Digital TransmissionChapter 4 - Digital Transmission
Chapter 4 - Digital Transmission
 

Similar to Interfacing 8255

Similar to Interfacing 8255 (20)

Lec14
Lec14Lec14
Lec14
 
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.
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
 
Lec12
Lec12Lec12
Lec12
 
Basics of peripheral devices and Working
Basics of peripheral devices and WorkingBasics of peripheral devices and Working
Basics of peripheral devices and Working
 
Io (2)
Io (2)Io (2)
Io (2)
 
8155 GPPI
8155 GPPI8155 GPPI
8155 GPPI
 
L4-L6 8255 A.pptx
L4-L6 8255 A.pptxL4-L6 8255 A.pptx
L4-L6 8255 A.pptx
 
1203 Ppi 8155
1203 Ppi 81551203 Ppi 8155
1203 Ppi 8155
 
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
 
Mod-2 M&M.pptx
Mod-2 M&M.pptxMod-2 M&M.pptx
Mod-2 M&M.pptx
 
PROGRAMMABLE PERIPHERAL INTERFACE (PPI) -8255
PROGRAMMABLE PERIPHERAL  INTERFACE (PPI) -8255PROGRAMMABLE PERIPHERAL  INTERFACE (PPI) -8255
PROGRAMMABLE PERIPHERAL INTERFACE (PPI) -8255
 
8255
82558255
8255
 
Operation of 8255A
Operation of 8255AOperation of 8255A
Operation of 8255A
 
8255 class
8255 class8255 class
8255 class
 
8255 ppi
8255 ppi8255 ppi
8255 ppi
 
Programmable Peripheral Devices
Programmable Peripheral Devices Programmable Peripheral Devices
Programmable Peripheral Devices
 
knowledge in daily life.ppt
knowledge in daily life.pptknowledge in daily life.ppt
knowledge in daily life.ppt
 
8085 lab
8085 lab8085 lab
8085 lab
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Interfacing 8255

  • 1. PPI : 82C55  The 82C55 is a popular interfacing component, that can interface any TTL-compatible I/O device to the microprocessor.  It is used to interface to the keyboard and a parallel printer port in PCs (usually as part of an integrated chipset).  Requires insertion of wait states if used with a microprocessor using higher that an 8 MHz clock.  PPI has 24 pins for I/O that are programmable in groups of 12 pins and has three distinct modes of operation.  In the PC, an 82C55 or its equivalent is decoded at I/O ports 60H-63H.
  • 5. 8255 Programmable Peripheral Interface Data bus D[7:0] PA[7:0] A0 8086 A1 PB[7:0] RD Control port WR PC[7:0] RESET A7 CS A6 A5 A4 A3 A2 A1 A0 Port IO/M 0 0 PA 0 1 PB 1 0 PC 1 1 Control
  • 7. Programming 8255  8255 has three operation modes: mode 0, mode 1, and mode 2
  • 8. Programming 8255  Mode 0: — Ports A, B, and C can be individually programmed as input or output ports — Port C is divided into two 4-bit ports which are independent from each other  Mode 1: — Ports A and B are programmed as input or output ports — Port C is used for handshaking PA[7:0] PA[7:0] PC4 STBA PC7 OBFA PC5 IBFA PC6 ACKA PC3 INTRA PC3 INTRA 8255 PB[7:0] 8255 PB[7:0] PC2 STBB PC2 OBFB PC1 IBFB PC1 ACKB PC0 INTRB PC0 INTRB PC6, 7 PC4, 5
  • 9.
  • 10.
  • 11. Programming 8255  Mode 2: — Port A is programmed to be bi-directional — Port C is for handshaking — Port B can be either input or output in mode 0 or mode 1 PA[7:0] PC7 OBFA PC6 ACKA PC4 STBA 8255 PC5 IBFA PC3 INTRA PC0 In Out STBB OBFB PC0 In Out IBFB ACKB PC0 In Out INTRB INTRB PB[7:0] Mode 0 Mode 1 1. Can you design a decoder for an 8255 chip such that its base address is 40H? 2. Write the instructions that set 8255 into mode 0, port A as input, port B as output, PC0-PC3 as input, PC4-PC7 as output ?
  • 12. Timing diagram is a combination of the Mode 1 Strobed Input and Mode 1 Strobed Output Timing diagrams.
  • 13. Example: Mode 1 Input 8255 keyboard  BIT5 EQU 20H PA0  PORTC EQU 22H  PORTA EQU 20H PA7  READ PROC NEAR  Read: STB PC4 DAV • IN AL, PORTC ; read portc • TEST AL, BIT5 ;test IBF • JZ Read ;if IBF=0 • IN AL, PORTA ;Read Data  READ ENDP
  • 14. Example: Mode 1 output 8255 Printer PB0 PB7 ACK Data Strobe : to tell PC2 ACK the printer to latch the incoming data. PC4 DS Generated Externally
  • 15. Example: Mode 1 output BIT1 EQU 2 ;send character to printer PORTC EQU 62H MOV AL, AH ;get data OUT PORTB, AL ;print PORTB EQU 61H data CMD EQU 63H ; send data strobe to PRINT PROC NEAR printer ; check printer ready? MOV AL, 8 ;clear DS IN AL, PORTC ;get OBF OUT CMD, AL TEST AL, BIT1 ;test OBF MOV AL, 9 ;clear DS JZ PRINT ;if OBF=0 buffer OUT CMD, AL is full ;rising the data at the positive edge of DS RET PRINT ENDP
  • 20. 8254 Programming  Each counter may be programmed with a count of 1 to FFFFH. • Minimum count is 1 all modes except 2 and 3 with minimum count of 2.  Each counter has a program control word used to select the way the counter operates. • If two bytes are programmed, then the first byte (LSB) stops the count, and the second byte (MSB) starts the counter with the new count.
  • 21. 8254 Read Back Command  8254 Read Back Command 1 1 COUNT STATUS CNT2 CNT1 CNT0 0  8254 status word format NULL OUTPUT COUNT RW1 RW0 M2 M1 M0 BCD NULL COUNT: goes low when the new count written to a counter is actually loaded into the counter
  • 22. 8254 Modes  Mode 0: An events counter enabled with G. • The output becomes a logic 0 when the control word is written and remains there until N plus the number of programmed counts. Mode 1: One-shot mode. • The G input triggers the counter to output a 0 pulse for `count' clocks. • Counter reloaded if G is pulsed again.
  • 23. 8254 Modes  Mode 2: Counter generates a series of pulses 1 clock pulse wide. • The seperation between pulses is determined by the count. • The cycle is repeated until reprogrammed or G pin set to 0. • Mode 3: Generates a continuous square-wave with G set to 1.  If count is even, 50% duty cycle otherwise OUT is high 1 cycle longer.
  • 24. 8254 Modes  Mode 4: Software triggered one-shot • (G must be 1).  Mode 5: Hardware triggered one- shot. G controls similar to Mode 1.