8255 microprocessor operating modes

There are 2 modes in 8255 microprocessor:

1. Bit set reset (BSR) mode – This mode is used to set or reset the bits of port C only, and selected when the most significant bit (D7) in the control register is 0. Control Register is as follows:


This mode affects only one bit of port C at a time because, as user set the bit, it remains set until and unless user changes it. User needs to load the bit pattern in control register to change the bit.

2. Input/output mode (I/O) – This mode is selected when the most significant bit (D7) in the control register is 1.

  • Mode 0 – Simple or basic I/O mode:
    Port A, B and C can work either as input function or as output function. The outputs are latched but the inputs are not latched. It has interrupt handling capability.

  • Mode 1 – Handshake or strobbed I/O:
    In this either port A or B can work and port C bits are used to provide handshaking. The outputs as well as inputs are latched. It has interrupt handling capability. Before actual data transfer there is transmission of signal to match speed of CPU and printer.

    Example: When CPU wants to send data to slow peripheral device like printer, it will send handshaking signal to printer to tell whether it is ready or not to transfer the data. When printer will be ready it will send one acknowledgement to CPU then there will be transfer of data through data bus.

  • Mode 3 – Bidirectional I/O:
    In this mode only port A will work, port B can either is in mode 0 or 1 and port C bits are used as handshake signal. The outputs as well as inputs are latched. It has interrupt handling capability. Control Register is as follows:

    The most significant bit (D7) is 1 for the I/O mode and 0 for the BSR mode.

    D6 & D5It is used to set the port A mode.

    D4 is used to tell whether port A is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.
    D3 is used to tell whether port C higher bites is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.
    D2 tells the mode of port B. If it is 0 then port B is in m0 mode otherwise in m1 mode.
    D1 is used to tell whether port B is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.
    D0 is used to tell whether port C lower bits is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.

When 8255 microprocessor is reset, it will clear the control word register contents, setting all the ports to input mode.



My Personal Notes arrow_drop_up

I like to do coding in C++C and java programming languages HTML and CSS always intersts me Sharing knowleged is the best way according to me to increase ones knwoledge

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.