8259 block diagram & Pin diagram
Interfacing of 8259 with 8086
PPIC n8255
Modes of operation
8255 can operate in 2 different modes.
1. Input-Output mode –
If MSB of control word (D7) is 1, PPI works in input-output mode.
– This is further divided into three modes:
• Mode 0 : Basic Input /Output
• Mode1 : Strobed input /output
• Mode 2: Bi-directional bus
Mode 0
• Simplest and most widely used mode
• All the three ports can be programmed as either input or output.
• In this mode, the two 8 bit ports A and B and the 4 bit ports Port C upper and
Port C lower may be used independently.
• Any port can be input or output .
• Outputs are latched.
• The ports in mode 0 are used to interface DIP switches, Hexa-keypad ,LEDs etc
Mode 1(Handshake I/O mode or Strobed I/O mode)
This is the handshaking mode.
During data transfer, the communicating devices exchange request and acknowledge
control signals with each other.
In this mode, Ports A and B pins are used for data transfer while 4 bits of each of port C
are used for generating the hand shaking signals for each of the 8 bit ports.
Input and Output data are latched.
The handshake signals in Strobed input mode are
STB (strobe) : The peripheral send a data byte to 8255 and indicates
this by lowering the strobe line.
IBF (Input Buffer Full): This is the acknowledge signal sent by 8255 to
indicate data is received
INTR (Interrupt Request) : A high on this is used to interrupt the CPU
The handshaking signals in Strobed output mode are
OBF (Output Buffer Full) : When a processor writes data byte to 8255 ,this signal goes low. It indicates
that this data can be read into the peripherals.
ACK : This is the acknowledge signal sent by peripheral to indicate data is
received from 8255.
INTR (Interrupt Request) : This signal goes after the acknowledge signal is
removed.
INTE (Interrupt Enable) : This is an internal flip flop used to enable or
disable the generation of the INTR signal.
Example:
• The computer send the data to the printer large speed compared to the printer.
• When computer send the data according to the printer speed at the time only, printer can
accept.
• If printer is not ready to accept the data then after sending the data bus , computer uses
another handshaking signal to tell printer that valid data is available on the data bus.
• Each port uses three lines from port C as handshake signals
• Mode 2 (Strobed Bidirectional bus I/O)
• This is the bidirectional mode.
• Only group A can use this mode
• Port A is used for transmitting as well as receiving the data.
• Hand shake signals are generated by the upper 4 bits of Port C
BIT SET/RESET MODE:
• The PORT C can be Set or Reset by sending OUT instruction to the CONTROL registers.
8279 KEYBOARD AND DISPLAY INTERFACING
Features:
It is designed by Intel
It support 64 contact key matrix with two more keys “CONTROL”
and “SHIFT”
It provides 3 operating modes
[Link] keyboard mode [Link] sensor matrix mode
[Link] Input mode.
It has inbuilt debounce key .
It provides 16 byte display RAM to display 16 digits and
interfacing 16 digits.
It provides two output modes:
[Link] entry (Typewriter type).
[Link] entry (Calculator type).
Simultaneous keyboard and display operation facility allows to
interleave keyboard and display software.
The interrupt output of 8279 can be used to tell CPU that the key
press is detected, this eliminates the need of software polling.