9 Input & Output Interfaces
9 Input & Output Interfaces
CS-430
Lecture 9
8088/8086 Microprocessor I/O Interfacing
IN AL , 60H ; Instruction is having 8-bit port address from where a byte is inputted into AL
IN AX , 60H ; Instruction is having 8-bit port address from where 2 bytes are inputted into AX
OUT 70H , AL ; Instruction is having 8-bit port address to which a byte is outputted from AL
OUT 70H , AX ; Instruction is having 8-bit port address to which 2 bytes are outputted from AX
𝑨𝟎
𝑨𝟕 𝑨𝟔 𝑨𝟓 𝑨𝟒 𝑨𝟑 𝑨𝟐 𝑨𝟏 𝑨𝟎 Address 𝑬𝟖
𝑨𝟏 𝑬𝟗
1 1 1 0 1 0 0 0 E8 𝑨𝟐
𝑬𝑨
1 1 1 0 1 0 0 1 E9 𝑬𝑩
1 1 1 0 1 0 1 0 EA 𝑨𝟒
𝑬𝑪
𝑨𝟓
1 1 1 0 1 0 1 1 EB 𝑨𝟔 𝑬𝑫
𝑨𝟕 𝑬𝑬
1 1 1 0 1 1 0 0 EC 𝑨𝟑
𝑬𝑭
1 1 1 0 1 1 0 1 ED
1 1 1 0 1 0 1 1 EE
1 1 1 0 1 1 1 1 EF
• The timing waveform represents the situation where the crossed lines on the waveform
represent the time at which a new data byte becomes valid on the output lines of the port.
• The absence of other waveforms indicates that this output operation is not directly dependent
on any other signal.
• The strobe signal can be either polled by the processor (programmed IO) or connected to
interrupt request line of the microprocessor (interrupt driven IO).
• The data transfer is time dependent.
• It shows the timing waveform for a handshake data transfer from a peripheral device to a microprocessor.
• The peripheral outputs some parallel data and sends an 𝑆𝑇𝐵 signal to the microprocessor.
• The microprocessor detects the asserted 𝑆𝑇𝐵 signal on a polled or interrupts basis and reads in the bytes of data.
• Then, the microprocessor sends 𝐴𝐶𝐾 (acknowledge) signal to the peripheral to indicate that the data has been read
and that the peripheral can send next byte of data.
• E.g. Printer interface , where microprocessor sends a byte/block of data and asserts a 𝑆𝑇𝐵 signal. When the printer
receives that data it sends 𝐴𝐶𝐾 to processor.
Fall Semester 2020 18
Methods of Parallel Data Transfer
• Double Handshake I/O - For data transfer where even more coordination is required between the
sending system and the receiving system, a double handshake is used.
• The sending (peripheral) device asserts its 𝑆𝑇𝐵 line low to ask the receiving device whether it is ready or
not for data reception.
• The receiving system raises its 𝐴𝐶𝐾 line high to indicate that it is ready.
• The peripheral device then sends the byte of data and raises its 𝑆𝑇𝐵 line high to assure that the valid
data is available for the receiving device (microprocessor).
• When microprocessor reads the data, it drops its 𝐴𝐶𝐾 line low to indicate that it has received the data
and requests the sending system to send next byte of data.
• E.g. Speech Synthesizer systems are connected in this manner.
Fall Semester 2020 19
8255A Programmable Peripheral Interface
• 8255A is an LSI peripheral designed to permit easy implementation
of parallel I/O in the 8088 and 8086 microprocessor systems.
• 8255A manages most of the signaling automatically relieving
processor. Processor is only interrupted, proper timings of 𝑆𝑇𝐵 and
𝐴𝐶𝐾 are managed by 8255A PPI.
• Read/write control 𝑅𝐷 , 𝑊𝑅
• Reset and chip select RESET , 𝐶𝑆
• VCC and GND
Fall Semester 2020 22
8255A Programmable Peripheral Interface
• Three byte-wide I/O ports are divided into two
groups.
• Group A – Port A(𝑃𝐴7 − 𝑃𝐴0 ) and upper part
of Port C (𝑃𝐶7 − 𝑃𝐶4 )
• Group B – Port B (𝑃𝐵7 − 𝑃𝐵0 ) and lower part
of Port C (𝑃𝐶3 − 𝑃𝐶0 )
• These two groups can be programmed in three
different modes.
• Mode 0,
• Mode 1 and
• Mode 2
• Each of the three ports can be configured an input
or output ports.
• 8255 initializes when microprocessor is reset.
Initializing the device causes all ports to be set up as
simple input ports using mode 0 operation.
Group – A Group – B
7 6 5 4 3 2 1 0
1 Mode A PA PC upper Mode B PB PC lower
0 0 ----- Mode 0
0 1 ----- Mode 1
1 x ----- Mode 2
0 --- Output
1 --- Input
0 --- Output
1 --- Input
7 6 5 4 3 2 1 0
0 X X X
0 = Reset bit
1 = Set bit