Академический Документы
Профессиональный Документы
Культура Документы
Sarbesh Chaudhary
UNIT 6
INTRODUCTION TO GENERAL PURPOSE
PROGRAMMABLE PERIPHERAL DEVICES
8255 PROGRAMMABLE PERIPHERAL INTERFACE (PPI)
A programmable peripheral interface is a multiport device. The port may be programmed in a variety of ways as
required by the programmer. The device is very useful for interfacing peripheral devices. It has three 8- bit ports,
namely port A, port B and port C. The port C has been further divided into two of 4-bit ports, and port C upper and
port C lower. Thus a total of 4 ports are available, two 8-bit ports and two 4-bit ports. Each port can be programmed
either as an i/p port or an o/p port.
Architecture of INTEL 8255
INTEL 8255 is a 40 pin IC which operates on 5V supply. The pins for various ports are as follows
1|Page
(A0 and A1): These are Port Select 0 and Port Select 1 input signal. These Input signals, in conjunction with the RD
and WR Input controls the selection of one of the three ports or the control word registers. They are normally
connected least significant bits of the address bus (A0 and A1).
CONTROL WORD
A port can be programmed to be an input or output port. For programming the ports of 8255 ,a control word is
formed. This control word is written into control word register of 8255. The control word bit can be 0 or 1. If the bit
is 1, then the port will be input port & if the bit is 0, then the port will be output port. The control word register
format is shown in the figure below.
The detailed description of the bits of the control word is as follows:
1.BIT 0: It is for Port Clower. If 0, Port Clower is output port. If 1, Port Clower is input port.
2.BIT 1: It is for Port B. If 0, port B is output port. If 1, port B is input port.
3.BIT 2: It is for the selection of the mode for the Port B. If 0, Port B operates in Mode 0. If 1, B operates in Mode 1.
4.BIT 3: It is for Port Cupper. If 0, Port Cupper is output port. If 1, Port Cupper is input port.
5.BIT 4: It is for Port A. If 0, port A is output port. If 1, port A is input port.
6.BIT 5 & BIT 6: These bits are to define the operating mode of the port A. For the various modes of Port A these bits
are defined as follows:
Mode of Port A Bit no. 6 Bit no. 5
Mode 0
0
0
Mode 1
0
1
Mode 2
1
0 or 1
DEX program, MMP
2|Page
7.BIT 7: It is set to 1, if Port A, B, & C are defined as input or output port. It is set to 0, if the individual pins of the
Port c are to be set or reset.
3|Page
8253 also contains a data bus buffer which is of 8-bits & used to interface 8253 to the system bus via data lines. It
also contains read/write logic which takes input from system bus & generates control signals for operation of 8253.
The control word register and counters are selected according to the signals on lines A0 and A1.
Control Word Register : This register is accessed when lines A0 and A1 are at logic 1. It is used to write a command
word which specifies the counter to be used (binary or BCD), its mode, and either a read or write operation.
SC (select Counter)
SCO
0
0
1
1
SC1
0
1
0
1
M (Mode)
M2 M1
0
0
0
0
X
1
X
1
1
0
1
0
FUNCTION
Select Counter 0
Select Counter 1
Select Counter 2
Read-Back Command
(see Read Operations
RW1
0
0
1
1
RW0
0
1
0
1
RW (Read/Write)
OPERATION
M0
0
1
0
1
0
1
MODE SELECTION
MODE0
MODE1
MODE2
MODE3
MODE4
MODE5
4|Page
5|Page
6|Page
7|Page
A0 (Address Line): It is in conjunction with RD, WR & CS. INTEL 8259 uses it to interrupt command words the CPU
writes & the status which CPU wants to read.
OPERATION OF 8259
Eight I/O devices can be connected to 8259 through IR0-IR7 lines. One or more I/O devices can send interrupt
request at the same time to the interrupt controller. Depending upon the priority of interrupt the request of I/O
device which has highest priority is sent to the Microprocessor on INT line. In return Microprocessor sends an
acknowledgement signal via INTA line. On receipt of INTA signal all the interrupts of lower priority are discarded.
And the address of the interrupt service subroutine (ISS) for the concerned I/O device is sent by 8259.
If there are more than eight devices to transfer data using interrupt then two 8259 chips can be connected in series,
such connection is known as cascading. The 8259 IC which is connected to the processor is known as Master & the
IC which is connected to the master is known as Slave.
INTERNAL REGISTERS OF 8259
1.Interrupt Request Register (IRR): It stores the interrupt request & keeps information about all the interrupt.
2.Interrupt Service Register (ISR): The information of the interrupt which is being serviced is stored in ISR.
3.Interrupt Mask Register (IMR): It contains a specific bit for each interrupt line. It is used to disable or enable an
interrupt.
8|Page
9|Page