Intel 8255

Intel D8255
Pinout of i8255

The Intel 8255 (or i8255) Programmable Peripheral Interface (PPI) chip is a peripheral chip originally developed for the Intel 8085 microprocessor,[1] and as such is a member of a large array of such chips, known as the MCS-85 Family. This chip was later also used with the Intel 8086 and its descendants. It was later made (cloned) by many other manufacturers. It is made in DIP 40 and PLCC 44 pins encapsulated versions.[2]

Similar chips

The 8255 is used to give the CPU access to programmable parallel I/O,[3] and is similar to other such chips like the MOS Technology 6522 (Versatile Interface Adapter) and the MOS Technology CIA (Complex Interface Adapter) all developed for the 6502 family. Other such chips are the 2655 Programmable Peripheral Interface from the Signetics 2650 family of microprocessors, the Motorola 6820 PIA (Peripheral Interface Adapter) from the Motorola 6800 family, the Western Design Center WDC 65C21, an enhanced 6520, and many others.

However, most often the functionality 8255 offered is now not implemented with the 8255 chip itself any more, but is embedded in a larger VLSI chip as a subfunction. The 8255 chip itself is still made, and is sometimes used together with a micro controller to expand its I/O capabilities.

Uses in computers

The 8255 is widely used in many microcomputer/microcontroller systems and home computers such as the SV-328 and all MSX models. The 8255 is used in the original IBM-PC,[4] PC/XT, PC/jr and clones, along with numerous homebuilt computer computers such as the N8VEM. The 8255 is also directly compatible with the Z-80 as well as many Intel Processors.

Functional block of 8255

The 8255 has 24 input/output pins in all.[5] These are divided into three 8-bit ports (Port A, Port B, Port C).[6] Port A and port B can be used as 8-bit input/output ports. Port C can be used as an 8-bit input/output port or as two 4-bit input/output ports or to produce handshake signals for ports A and B.

The three ports are further grouped as follows:

  1. Group A consisting of port A and upper part of port C.
  2. Group B consisting of port B and lower part of port C.

Eight data lines (D0 - D7) are available (with an 8-bit data buffer) to read/write data into the ports or control register under the status of the {\neg}RD (pin 5) and {\neg}WR (pin 36), which are active low signals for read and write operations respectively. The address lines A1 and A0 allow to successively access any one of the ports or the control register as listed below:

A1 A0 Port selected
00port A
01port B
10port C
11control register

The control signal chip select {\neg}CS (pin 6) is used to enable the 8255 chip. It is an active low signal, i.e., when {\neg}CS = '0', the 8255 is enabled. The RESET input (pin 35) is connected to the RESET line of system like 8085, 8086, etc., so that when the system is reset, all the ports are initialized as input lines. This is done to prevent 8255 and/or any peripheral connected to it, from being destroyed due to mismatch of ports. As an example, consider an input device connected to 8255 at port A. If from the previous operation, port A is initialized as an output port and if 8255 is not reset before using the current configuration, then there is a possibility of damage of either the input device connected or 8255 or both since both 8255 and the device connected will be sending out data.

The control register or the control logic or the command word register is an 8-bit register used to select the modes of operation and input/output designation of the ports.[7]

Operational modes of 8255

There are two basic operational modes of 8255:

The two modes are selected on the basis of the value present at the D7 bit of the Control Word Register. When D7 = 1, 8255 operates in I/O mode and when D7 = 0, it operates in the BSR mode.

Bit set/reset (BSR) mode

The Bit Set/Reset (BSR) mode is applicable to port C only. Each line of port C (PC0 - PC7) can be set/reset by suitably loading the control word register. BSR mode and I/O mode are independent and selection of BSR mode does not affect the operation of other ports in I/O mode.[8]

8255 BSR mode

Selection of port C pin is determined as follows:

B3 B2 B1 Bit/pin of port C selected
000PC0
001PC1
010PC2
011PC3
100PC4
101PC5
110PC6
111PC7

As an example, if it is needed that PC5 be set, then in the control word,

  1. Since it is BSR mode, D7 = '0'.
  2. Since D4, D5, D6 are not used, assume them to be '0'.
  3. PC5 has to be selected, hence, D3 = '1', D2 = '0', D1 = '1'.
  4. PC5 has to be set, hence, D0 = '1'.

Thus, as per the above values, 0B (Hex) will be loaded into the Control Word Register (CWR).

D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 1 0 1 1

Input/Output mode

This mode is selected when D7 bit of the Control Word Register is 1. There are three I/O modes:[9]

  1. Mode 0 - Simple I/O
  2. Mode 1 - Strobed I/O
  3. Mode 2 - Strobed Bi-directional I/O

Control Word Format

I/O Control Word Format
D6 D5 Mode
000
011
1X2

For example, if port B and upper port C have to be initialized as input ports and lower port C and port A as output ports (all in mode 0):

  1. Since it is an I/O mode, D7 = 1.
  2. Mode selection bits, D2, D5, D6 are all 0 for mode 0 operation.
  3. Port B and upper port C should operate as Input ports, hence, D1 = D3 = 1.
  4. Port A and lower port C should operate as Output ports, hence, D4 = D0 = 0.

Hence, for the desired operation, the control word register will have to be loaded with "10001010" = 8A (hex).

Mode 0 - simple I/O

In this mode, the ports can be used for simple I/O operations without handshaking signals. Port A, port B provide simple I/O operation. The two halves of port C can be either used together as an additional 8-bit port, or they can be used as individual 4-bit ports. Since the two halves of port C are independent, they may be used such that one-half is initialized as an input port while the other half is initialized as an output port.

The input/output features in mode 0 are as follows:

  1. Output ports are latched.
  2. Input ports are buffered, not latched.
  3. Ports do not have handshake or interrupt capability.
  4. With 4 ports, 16 different combinations of I/O are possible.

Mode 0 – input mode

Mode 0 - output mode

Mode 1

When we wish to use port A or port B for handshake (strobed) input or output operation, we initialise that port in mode 1 (port A and port B can be initilalised to operate in different modes, i.e., for e.g., port A can operate in mode 0 and port B in mode 1). Some of the pins of port C function as handshake lines.

For port B in this mode (irrespective of whether is acting as an input port or output port), PC0, PC1 and PC2 pins function as handshake lines.

If port A is initialised as mode 1 input port, then, PC3, PC4 and PC5 function as handshake signals. Pins PC6 and PC7 are available for use as input/output lines.

The mode 1 which supports handshaking has following features:

  1. Two ports i.e. port A and B can be used as 8-bit i/o ports.
  2. Each port uses three lines of port c as handshake signal and remaining two signals can be used as i/o ports.
  3. Interrupt logic is supported.
  4. Input and Output data are latched.

Input Handshaking signals

1. IBF (Input Buffer Full) - It is an output indicating that the input latch contains information.
2. STB (Strobed Input) - The strobe input loads data into the port latch, which holds the information until it is input to the microprocessor via the IN instruction.
3. INTR (Interrupt request) - It is an output that requests an interrupt. The INTR pin becomes a logic 1 when the STB input returns to a logic 1, and is cleared when the data are input from the port by the microprocessor.
4. INTE (Interrupt enable) - It is neither an input nor an output; it is an internal bit programmed via the port PC4(port A) or PC2(port B) bit position.

Output Handshaking signals

1. OBF (Output Buffer Full) - It is an output that goes low whenever data are output(OUT) to the port A or port B latch. This signal is set to a logic 1 whenever the ACK pulse returns from the external device.
2. ACK (Acknowledge)-It causes the OBF pin to return to a logic 1 level. The ACK signal is a response from an external device, indicating that it has received the data from the 82C55 port.
3. INTR (Interrupt request) - It is a signal that often interrupts the microprocessor when the external device receives the data via the signal. this pin is qualified by the internal INTE(interrupt enable) bit.
4. INTE (Interrupt enable) - It is neither an input nor an output; it is an internal bit programmed to enable or disable the INTR pin. The INTE A bit is programmed using the PC6 bit and INTE B is programmed using the PC2 bit.

Mode 2

Only group A can be initialized in this mode. Port A can be used for bidirectional handshake data transfer. 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. The remaining pins of port C (PC0 - PC2) can be used as input/output lines if group B is initialized in mode 0 or as handshaking for port B if group B is initialized in mode 1. In this mode, the 8255 may be used to extend the system bus to a slave microprocessor or to transfer data bytes to and from a floppy disk controller. Acknowledgement and handshaking signals are provided to maintain proper data flow and synchronisation between the data transmitter and receiver.

References

  1. R Theagarajan (1 January 2004). Microprocessor And Its Applications. New Age International. pp. 165–. ISBN 978-81-224-1040-2. Retrieved 3 June 2012.
  2. Embedded Systems Programming. Miller Freeman Publications. July 1996. p. 256. Retrieved 3 June 2012.
  3. Electronics world. Reed Business Pub. 1996. p. 947. Retrieved 3 June 2012.
  4. Robert Jourdain (1986). Programmer's problem solver for the IBM PC, XT, & AT. Brady Communications Co. p. 3. Retrieved 3 June 2012.
  5. "Intel 82c55 PPI Datasheet" (PDF).
  6. "PCI 8255A Datasheet" (PDF).
  7. Byte. McGraw-Hill. 1981. p. 40. Retrieved 3 June 2012.
  8. U. S. Shah. "11". Microprocessor & Interfacing Techniques (second ed.). Techmax Publication. pp. 11–5. ISBN 978-81-8492-305-6.
  9. "i8255 introduction" (PDF).

External links

This article is issued from Wikipedia - version of the Wednesday, April 06, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.