=== Mode 2 – Bidirectional Mode ===
So the final mode of 8255 is Mode 2. In Only port A can be initialized in this mode . Port A can be programmed to operate as a used for bidirectional porthandshake data transfer. When Port This means that data can be input or output on the same eight lines (PA0 - PA7). Pins PC3 - PC7 are used as handshake lines for port A programmed in this mode . The remaining pins of operation, Port B port C (PC0 - PC2) can be used either as input/output lines if group B is initialized in Mode mode 0 or Mode as handshaking for port B if group B is initialized in mode 1. For mode 2 operation PC3 to PC7 bits used for handshaking. In this mode too both inputs , the 8255 may be used to extend the system bus to a slave microprocessor or to transfer data bytes to and outputs from a floppy disk controller. Acknowledgement and handshaking signals are latchedprovided to maintain proper data flow and synchronisation between the data transmitter and receiver.
[[File:8255 - mode-2.png]]