1204 Ppi 8255

7,653 views

Published on

1204 Ppi 8255
visit: www.techbed.blogspot.com

Published in: Education
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,653
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
618
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide
  • 1001 1011 9b
  • 1204 Ppi 8255

    1. 1. Programmable Peripheral Interface Devices Support chips : 8155 , 8255 , 8279 , 8254 , 8257 , 8259,8251
    2. 2. Programmable Interface Devices <ul><li>used to interface a I/O device to the microprocessor </li></ul>8085 Programmable I/O Interface I/O Devices System Bus <ul><li>Can be programmed/configured to perform various I/O functions by writing software instructions </li></ul>
    3. 3. 8255 – A programmable parallel I/O device <ul><li>Designed to be compatible with 8085 </li></ul><ul><li>It consists of </li></ul><ul><ul><li>Three I/O ports </li></ul></ul><ul><ul><ul><li>Port A </li></ul></ul></ul><ul><ul><ul><li>Port B </li></ul></ul></ul><ul><ul><ul><li>Port C </li></ul></ul></ul><ul><ul><li>Port C can be used as two 4-bit ports </li></ul></ul><ul><ul><ul><li>PC u (Port C upper 4 bits) </li></ul></ul></ul><ul><ul><ul><li>PC l (Port C lower 4 bits) </li></ul></ul></ul>
    4. 4. I/O Interfacing using 8255 8085 8255 8-bit ADC System Bus LED DISPLAY Temperature Sensor Port A Port C u Port B Port C l
    5. 5. Interfacing with Analog-to-Digital Converter 8085 8255 8-bit ADC System Bus Temperature Sensor Port A Port C lines SOC EOC OE
    6. 6. Application Programming Logic <ul><li>Configure 8255 I/O ports </li></ul><ul><li>8085 sends SOC command to ADC </li></ul><ul><li>8085 waits for EOC signal from ADC </li></ul><ul><li>8085 sends OE command to ADC </li></ul><ul><li>8085 reads 8-bit temperature value from port A </li></ul><ul><li>8085 displays temperature value on LED display connected to port B </li></ul>
    7. 7. Writing the program <ul><li>At this point, it will help us to understand, what we need to know more about 8255 </li></ul>
    8. 8. 1. Configure 8255 I/O Ports 8085 8255 8-bit ADC System Bus LED DISPLAY Temperature Sensor Port A Port C u Port B Port C l
    9. 9. <ul><li>Port A as INPUT port </li></ul><ul><li>Port B as OUTPUT port </li></ul><ul><li>Port C (PC u – O/P , PC l – I/P ) </li></ul><ul><ul><li>SOC (PC 4 ) is a OUTUT line </li></ul></ul><ul><ul><li>EOC (PC 0 ) is a INPUT line </li></ul></ul><ul><ul><li>OE (PC 7 ) is a OUTPUT line </li></ul></ul><ul><li>Know more about </li></ul><ul><ul><li>Modes of operation of 8255 </li></ul></ul><ul><ul><li>Control word format of 8255 </li></ul></ul>
    10. 10. Modes of Operation of 8255 <ul><li>Two primary modes of operation </li></ul><ul><ul><li>Parallel I/O mode </li></ul></ul><ul><ul><ul><li>Mode 0 (Simple Input/Output) </li></ul></ul></ul><ul><ul><ul><li>Mode 1 (Input/Output with Handshake) </li></ul></ul></ul><ul><ul><ul><li>Mode 2 (Bidirectional data transfer) </li></ul></ul></ul><ul><ul><li>Bit Set/Reset Mode </li></ul></ul><ul><li>This application uses </li></ul><ul><ul><li>Parallel I/O mode - Mode 0 </li></ul></ul><ul><ul><li>Bit Set/Reset mode </li></ul></ul>
    11. 11. Control Word for 8255 <ul><li>8255 has a 8-bit Control word register </li></ul><ul><li>8255 ports can be configured for operation by writing a appropriate control word in it </li></ul>
    12. 12. for Parallel I/O 1 0 0 0 1 00 1 91H
    13. 13. for Bit Set/Reset Mode
    14. 14. Application Programming <ul><li>Configure 8255 I/O ports </li></ul><ul><ul><ul><li>MVI A, 91H </li></ul></ul></ul><ul><ul><ul><li>OUT CWR </li></ul></ul></ul><ul><li>Writing value 91H in Control Word Register of 8255 </li></ul><ul><li>CWR represents the 8-bit port address of Control Word Register </li></ul>
    15. 15. Application Programming <ul><li>8085 sends SOC (PC4=1)command to ADC </li></ul><ul><ul><ul><li>MVI A, 00001001B </li></ul></ul></ul><ul><ul><ul><li>OUT CWR </li></ul></ul></ul><ul><li>Uses Bit Set/Reset mode of 8255 </li></ul>
    16. 16. Application Programming <ul><li>8085 waits for EOC signal from ADC </li></ul><ul><li>WAIT: IN PORTC </li></ul><ul><li>RAR </li></ul><ul><li>JC WAIT </li></ul><ul><li>EOC is taken to be active low </li></ul>
    17. 17. Application Programming <ul><li>8085 sends OE command to ADC </li></ul><ul><ul><li>MVI A, 00001111H </li></ul></ul><ul><ul><li>OUT PORTC </li></ul></ul><ul><li>8085 reads 8-bit temperature value from port A </li></ul><ul><ul><li>IN PORTA </li></ul></ul><ul><ul><li>MOV B, A </li></ul></ul>
    18. 18. Application Programming <ul><li>8085 displays temperature value on LED display connected to port B </li></ul><ul><li>OUT PORTB </li></ul>
    19. 19. Pin diagram of 8255 D7 – D0 Data Bus PA7 – PA0 Port A PB7 – PB0 Port B PC7 – PC0 Port C CS Chip Select A0, A1 Address bits RD Read Input WR Write Input RESET Reset Input Vcc +5V GND 0 Volts
    20. 20. Interfacing 8255 with 8085 <ul><li>8255 can be interfaced to 8085 using </li></ul><ul><ul><li>Memory-mapped I/O </li></ul></ul><ul><ul><li>Peripheral-mapped I/O </li></ul></ul><ul><li>As application program uses IN/OUT instructions </li></ul><ul><ul><li>Peripheral-mapping is used </li></ul></ul><ul><ul><li>8-bit addresses are used for ports and control register of 8255 </li></ul></ul>
    21. 21. <ul><li>For e.g. </li></ul><ul><ul><li>OUT CWR </li></ul></ul><ul><ul><li>IN PORTA </li></ul></ul><ul><ul><li>OUT PORTB </li></ul></ul><ul><li>In actual program, label CWR will be substituted by 8-bit address of Control Word Register of 8255 </li></ul>
    22. 22. 8255 Chip selection & Port Addresses 8255 A2 A3 A4 A5 A6 A7 CS A1 A0 A1 A0 A = 80H B = 81H C = 82H A1 A0 Port 0 0 A 0 1 B 1 0 C 1 1 CWR
    23. 23. Programming with port addresses <ul><li>OUT 83H </li></ul><ul><li>IN 80H </li></ul><ul><li>OUT 81H </li></ul><ul><li>OUT CWR </li></ul><ul><li>IN PORTA </li></ul><ul><li>OUT PORTB </li></ul>
    24. 24. Block diagram of 8255

    ×