Sei sulla pagina 1di 3

Operational modes of 8255

There are two basic operational modes of 8255:

Bit set/reset Mode (BSR Mode).


Input/output Mode (I/O Mode).

The two modes are selected on the basis of the value present at the D 7 bit of the Control Word
Register. When D7 = 1, 8255 operates in I/O mode and when D 7 = 0, it operates in the BSR
mode.
INPUT/OUTPUT MODE
This mode is selected when D7 bit of the Control Word Register is 1. There are three I/O modes:
1. Mode 0 - Simple I/O
2. Mode 1 Hand Shaking I/O
3. Mode 2 - Hand Shaking Bi-directional I/O
Control Word Format

The ports of the 8255 can be programmed in any of the following modes
Mode 0, simple I/O
Any of the ports A, B, CL, and CU can be programmed as input out output
All bits are outputs or all are inputs
There is no signal-bit control as in P0-P3 of 8051
Mode 1, Hand Shaking I/O
Port A and B can be used as input or output ports with handshaking capabilities
Handshaking signals are provided by the port C
Mode 2, Hand Shaking Bi-directional I/O
Port A can be used as a bidirectional I/O port with handshaking capabilities provided by
port C
Port B can be used either in mode 0 or mode1

BSR (bit set/reset) mode


Only the individual bits of port C can be programmed

D7 bit is always 0 for BSR mode.


Bits D6, D5 and D4 are don't care bits.
Bits D3, D2 and D1 are used to select the pin of Port C.
Bit D0 is used to set/reset the selected pin of Port C.

Selection of port C pin is determined as follows:


B2

B1

B0

Bit/pin of port C selected

PC0

PC1

PC2

PC3

PC4

PC5

PC6

PC7

Potrebbero piacerti anche