IO Interfacing With 8086
IO Interfacing With 8086
I/O Instructions
• OUT : transfers information to I/O device
• IN: read information from I/O device
Interfacing
I/O
Memory
Isolated I/O
Mapped I/O
Isolated I/O
• Isolated: how the I/O locations are isolated
from the memory system in a separate I/O
address space.
Adv. and Disadv.
• As the ports are separate, the user can expand
the memory to its full size without using any
of memory space for I/O device.
• Disadv: must use IN, OUT, INS or OUTS
• Signals appeared on address bus select I/O
device.
Memory mapped I/O
Adv. And Disadv.
• It uses any instruction that transfers data
between the microprocessor and the memory
• I/O device is treated as a memory location in
the memory map
• Adv: any memory transfer function can be
used
• Disadv: reduces the amount of memory space.
The Basic Input Interface
Input interface
• TRI-State Buffers are used to construct 8 bit
input port (74LS 244)
• The outputs are connected to data bus.
• Microprocessor read the contents of eight
switches when SEL becomes logic 0. (active
low control of buffer)
• When 1 is placed buffer goes in high
impedance state
The basic output interface
Output interface: interfacing LED
• Octal Latch circuit 74LS 374 is used to
interface 8 LEDs
• Latch stores the number output by
microprocessor
• Latches are needed to hold the data because
when the microprocessor executes OUT
instruction the data are only present on the
data bus for less than 1 µs.
OUT instruction
• When the OUT instruction executes, the data
from AL, AX or EAX are transferred to the latch
via the data bus.
• D inputs from IC captures the output data
with activation of SEL signal to the CLK.
• Q outputs from IC are connected with LEDs.
• DATA are held until the next OUT instruction
executes.
Handshaking
• Many I/O devices accept or release
information much slower rate than the
microprocessor.
• Handshaking/Polling is a technique that
synchronizes the I/O device with the
microprocessor.
• Example: parallel printer printing few hundred
characters per second.
Connection pins for printer
Handshaking in printer
• ASCII data are placed on D7 –D0
• A pulse is then applied to STB (Strobe connection)
• Strobe Connection: In computer or memory, a strobe is a
signal that is sent that validates data or other signals on
adjacent parallel lines.
• Here the strobe signal clocks the data into the printer so that
they can be printed.
• As soon as the printer receives data, it places a logic 1 on the
BUSY pin. (guess why?)
• Microprocessor always checks whether printer is BUSY or
not. If BUSY it waits, otherwise it sends next ASCII character
to printer.
• The process of interrogating the printer here is handshaking.
A Single Pole Single Throw Switch
• Using pull up resistors
• OPEN- LOGIC 1
• CLOSE LOGIC 0