- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8255 microprocessor operating modes
The 8255 is a general purpose programmable IO device. It is designed to interface the CPU with some external devices like ADC, DAC, keyboard etc. We can program the device according to the given condition.
There are three 8-bit bi-directional IO ports. The Port-A, Port-B, and Port-C. These ports are assigned as input or output port.
The block diagram of 8255 is like this:
There are two different modes of 8255. These modes are:
Bit Set Reset (BSR) Mode
Input/ Output Mode
Bit Set Reset (BSR) Mode
This mode is used to set or reset the bits of the Port-C only. For BSR mode always D7 will be 0. The control register is looking like this:
The (D3, D2, D1) will be 000 to 111. In this mode it affects only one bit of Port C at a time. When user set the bit, it remains set until user unset it. The user needs to load the bit pattern in control register to change the bit.
Input/ Output Mode
This mode is selected when the D7 bit of the control register is 1.
This mode has also three different modes. These modes are Mode 0 and Mode 1 and Mode 3.
Mode 0 – Simple or basic I/O Mode
In this mode all of the ports A, B and C can be used as input or output mode. The outputs are latched, but inputs are not latched. This mode has interrupt handling capability.
Mode 1 – Handshake or Strobed I/O
In this mode the Port A and Port B can be used as input or output ports, the port C are used for handshaking. In this mode the inputs and outputs are latched. This mode also has the interrupt handling capability, and signal control to match the speed of CPU and IO devices.
Mode 3 – Bidirectional I/O
In this mode only Port A can work, and port B can either be in mode 0 or mode 1, and the port C are used for handshaking. In this mode the inputs and outputs are latched. The control register is looking like below in this mode:
Bits | Function |
D7 | 1 for IO mode and 0 for BSR mode |
D6 & D5 | These are used to set port A mode. for 00, it is m0 mode, for 01, it is m2 mode and 10 or 11, it is m2 mode. |
D4 | 1 when port A is taking input, 0 when port A is sending output. |
D3 | 1 when higher nibble of port C is taking input, and 0 when higher nibble is sending output. |
D2 | It tells the mode of Port B. For 0, it is m0 mode, and for 1, it is m1 mode. |
D1 | 1 when port B is taking input, 0 when port B is sending output. |
D0 | 1 when lower nibble of port C is taking input, and 0 when lower nibble is sending output. |