Chapter 5
Chapter 5
• Address, data and control lines are used for connecting peripherals.
• When microprocessor wants to rad data, the control signals from the
microprocessor activates the buffer by asserting enable input of the
buffer.
• Once the buffer is enabled, data from the device is available on the
data bus.
• Output Port
• The 8086 uses the same control signals and instructions to access I/O
as those of memory.
2. I/O mapped I/O:
• 8086 has special instructions IN and OUT to transfer data through the
input/output ports in I/O mapped I/O system.
• In this mode, address of I/O device is 8-bit for Direct addressing and 16-
bit for Indirect addressing.
Description of 8255A Internal Block Diagram
• Data Bus Buffer
• This three-state bi-directional 8-bit buffer is used to interface
the 8255 to the system data bus.
• Data is transmitted or received by the buffer upon execution of
input or output instructions by the Microprocessor.
• Control words and status information are also transferred
through the data bus buffer.
Description of 8255A Internal Block Diagram
• Ports A, B, and C
• The 8255 has three 8 bit I/O ports and each one can be connected to
the physical lines of an external device.
• All can be configured to a wide variety of functional characteristics by
the system software.
• These ports are labeled as PA0-PA7 (Port A), PB0-PB7 (Port B) and
PC0-PC7 (Port C).
• (CS) Chip Select. Is Active "low" signal this input pin enables the
communication between the 8255 and the CPU.
• (RD) Read. Is Active "low" signal this input pin enables 8255 to send the data
or status information to the CPU on the data bus. In essence, it allows the
CPU to "read from" the 8255.
• (WR) Write. Is Active "low" signal this input pin enables the CPU to write data
or control words into the 8255.
Description of 8255A Internal Block Diagram
• (A0 and A1) These input signals, control the selection of one of the three
ports or the control word register.
• (RESET) Reset. Is Active "high" signal this input initializes the control register
to 9Bh and all ports (A, B, C) are set to the input mode.
A0 and A1, with RD*, WR* and CS*:
CONTROL
REGISTER
• Control Word is an 8-bit data that stored in control register.
Control
Word
Register
Bit number Functionality
D7 0
NB: Don’t Cares can be set as Zero or One, In this solution all the
don’t cares are set as zero.
So we can have another solutions in addition to the solutions
specified here.
• Example:
• Write a program to blink port C bit 0 of the 8255. assume the
address of control word register is 83H and all don’t cares are 0.
✓control word to make bit 0 high is: 01H
0 0 0 0 0 0 0 1
✓Control word to make bit 0 low is: 00H
0 0 0 0 0 0 0 0
Input \ Output Mode
• If bit D7 of control word register is 1 then 8255 is configured as a
programmable I\O mode
Group A
• Example:
• Find the control word for the following arrangement of
8255-PPI in Mode 0.
✓Port A, port B, port CL and port CH as an Output
ports.
Solution: 80H
1 0 0 0 0 0 0 0
• The input device activate it to indicate the MP that, the data to be read is
already sent on the port lines of 8255 port.
• Upon activation of this signal 8255 loads the data from the input port
lines into the input buffer of that port.
• Input control signal
• IBF (Input Buffer Full F/F): is an active high output signal for 8255
and an input signal for the input device.
• It also indicates to the input device that, the input buffer is full and it is
not ready to accept next data from the input device.
• Therefor, input device sends data on the port lines only when IBF signal is
not active.
• The IBF signals is deactivated when MP reads the data from input buffer
of the respective port by activation of RD* signal.
• Input control signal
• INTR (Interrupt Request): is an active high output signal
generated by 8255.
• The 8255 sets the INTR when STB* signal is 1, IBF signal is 1
and INTE is 1.
• Indicating MP that, the data form the input device is available
in the input buffer.
• INTE (Interrupt Enable): is used to enable or disable INTR
(Interrupt Request) signal.
• Output control signal
• OBF* (Output Buffer Full F/F): is an active low output signal for 8255
and input signal for the output device.
• 8255 activates this signal to indicate output device that the data is
available on the output port.
• Output device reads the data from the output port and acknowledges
8255 by ACK* signal.
• ACK* (Acknowledge Input): is an active low input signal for 8255 and
output signal for the output device.
• The output device generates this signal to indicate 8255 that, the data
from output port has been accepted.
• Interrupt signal
• INTR (Interrupt Input): is an active high output signal
generated by 8255.
• The 8255 sets the INTR when ACK* signal is 1, OBF is 1 and
INTE is 1, indicating that the output device is ready to accept
next data byte.
• It reset by the falling edge of WR* signal, immediately after
sending the data to the output port.
• The different handshake signals used are STB, IBF and INTR.
• Peripheral devices places data in the port bus and inform 8255
making STB low.
• After that IBF goes high and then STB also goes high.
Input Operations
• STB* (Strobe Input): a “low” on this input loads data into latch.
• IBF (Input Buffer Full F/F): a “high” on this output indicates
that data has been loaded into the input latch.
• INTR 2 (The INTR Flip-Flop Associated with IBF): controlled
by bit set/reset of PC4.
Output operations
• OBF* (Output Buffer Full): the OBF* output will go “low” to
indicate the MP has written data out to port A.
• ACK* (Acknowledge): a “low” on this input enables the tri-state
output buffer of port A to send out the data.
• Otherwise, the output buffer will be in high impedance state.
• INTE 1 (The INTE Flip-Flop Associated with OBF): controlled
by bit set/reset of PC4.
Mode 2: I\O Configuration
• Example:
• A control word is given CWR = CDH. Explain the condition of ports of
8255-PPI.
• Solution:
The binary equivalent value of control word will be:
D7 D6 D5 D4 D3 D2 D1 D0
1 1 0 0 1 1 0 1
Solution: D7 D6 D5 D4 D3 D2 D1 D0
1 1 0 0 0 1 0 0
D0 = 0 lower 4 bits of Port C are outputs
D1 = 1 Port B are inputs
D2 = 0 mode 0 operation for both Port B and the lower 4 bits of Port C
D3 = 0 upper 4 bits of Port C are outputs
D4 = 0 Port A are outputs
D6 and D5 = 00 mode 0 operation for both Port A and the upper part Of
Port C
D7 =1 mode enable (I\O mode)
Thank You!
62