0
45kviews
What are the basic modes of operation of 8255, Explain with the format of control register.
1 Answer
1
238views
  1. The 8255 IC provides one control word register.
  2. It is selected when $A_0= 1, A_1 = 1, \overline{CS} = 0 \ \ and \ \ \overline{WR} = 0$. The read operation is not allowed for control register.
  3. The bit pattern loaded in control word register specifies an I/O function for each port and the mode of operation in which the ports are to be used.
  4. There are two different control word formats which specify two basic modes:
    • BSR (Bit set reset) mode
    • I/O mode
  5. The two basic modes are selected by $D_7$ bit of control register. When $D_7 = 1$ it is an I/O mode and when $D_7 = 0$; it is a BSR mode.

BSR mode-

  1. The BSR mode is a port C bit set/reset mode.
  2. The individual bit of port C can be set or reset by writing control word in the control register.
  3. The control word format of BSR mode is as shown in the figure below

enter image description here

  1. The pin of port C is selected using bit select bits [b b b] and set or reset is decided by bit S/R ̅.
  2. The BSR mode affects only one bit of port C at a time. 6.0The bit set using BSR mode remains set unless and until you change the bit. So to set any bit of port C, bit pattern is loaded in control register.
  3. If a BSR mode is selected it will not affect I/O mode.

I/O modes-

There are three I/O modes of operation:

  • Mode 0- Basic I/O
  • Mode 1- Strobed I/O
  • Mode 2- Bi-directional I/O

The I/O modes are programmed using control register.

The control word format of I/O modes is as shown in the figure below:

enter image description here

Function of each bit is as follows:

  1. $D_7$ – When the bit $D_7$ = 1 then I/O mode is selected, if $D_7 = 0$ then BSR mode is selected. The function of bits $D_0$ to $D_6$ is independent on mode (I/O mode or BSR mode).
  2. $D_6$ and $D_5$ – In I/O mode the bits D6 and D5 specifies the different I/O modes for group A i.e. Mode 0, Mode 1 and Mode 2 for port A and port C upper.
  3. D4 and D3 – In I/O mode the bits $D_4$ and $D_3$ selects the port function for group A. If these bits = 1 the respective port specified is used as input port. But if bit = 0, the port is used as output port.
  4. $D_2$ – In I/O mode the bit $D_2$ specifies the different I/O modes for group B i.e. Mode 0 and Mode 1 for port B and port C lower.
  5. $D_1$ and $D_0$ – In I/O mode the bits $D_1$ and $D_0$ selects the port function for group B. If these bits = 1 the respective port specified is used as input port. But if bit = 0, the port is used as output port.

All the 3 modes i.e. Mode 0, Mode 1 and Mode 2 are only for group A ports, but for group B only 2 modes i.e. Mode 0 and Mode 1 are provided. When 8255 is reset, it will clear control word register contents and all the ports are set to input mode. The ports of 8255 can be programmed for other modes by sending appropriate bit pattern to control register.

Please log in to add an answer.