0% found this document useful (0 votes)
42 views23 pages

IO Interfacing With 8086

The document discusses various methods of interfacing input and output devices with the 8086 microprocessor. It describes how I/O instructions like IN and OUT transfer data between devices and CPU registers. It also explains isolated and memory mapped I/O, input and output interfaces using tri-state buffers and latches, and handshaking techniques for synchronizing slower I/O devices with the faster CPU. The programmable peripheral interface IC 8255 is presented as a popular low-cost option for connecting multiple I/O ports.

Uploaded by

Aditya Bhowmik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views23 pages

IO Interfacing With 8086

The document discusses various methods of interfacing input and output devices with the 8086 microprocessor. It describes how I/O instructions like IN and OUT transfer data between devices and CPU registers. It also explains isolated and memory mapped I/O, input and output interfaces using tri-state buffers and latches, and handshaking techniques for synchronizing slower I/O devices with the faster CPU. The programmable peripheral interface IC 8255 is presented as a popular low-cost option for connecting multiple I/O ports.

Uploaded by

Aditya Bhowmik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

I/O Interfacing with 8086 µP

I/O Instructions
• OUT : transfers information to I/O device
• IN: read information from I/O device

• Information are transferred between I/O


device and Accumulator (AL, AX or EAX)
EXAMPLES OF I/O Instructions
WHAT HAPPENS with Address
Decoding
• I/O address ( also called Port Number) appears on the
address bus.
• External I/O interface decodes the port number
decodes the code number (i.e. memory address)
• 8 bit fixed port number appears on the address bus in
lower bits (A7 - A0). Higher bits remain 00h
• DX appears on address connection A15 – A0
• First 256 I/0 addresses are accessible by fixed I/O
instruction
• 0100H-FFFFH is only accessed by variable I/O address.
INS and OUTS instructions
• INS and OUTS instructions address an I/O
device by using DX register.
• But they do not transfer data between
accumulator and the I/O device.
• Instead they transfer data between the
memory and I/O device.
Methods of interfacing I/O to

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

• BOUNCING: tendency of any two metal


contacts in electronic device to generate
multiple signals as the contacts close or open.
• Remedy: DEBOUNCING
OUTPUT
• Once the output currents are known, a device
can be interfaced to one of the outputs
Programmable Peripheral Interface
• Also known as 8255 IC
• It is a popular low cost interfacing component
• It consists of three 8-bit bidirectional I/O ports
i.e. PORT A, PORT B and PORT C. We can
assign different ports as input or output
functions.
PIN Diagram
Block Diagram

You might also like