Docsity

Microprocessor Programming - IOinterface, Study notes of Microprocessors

Partial preview of the text

Download Microprocessor Programming - IOinterface and more Study notes Microprocessors in PDF only on Docsity!

8086, I/O Interface

and

I/O System Design

Types of I/O for 8088/

  • (^) Input/output system allows peripherals to:
    • (^) Provide data to processor or
    • (^) Receive results after processing the data.
  • (^) Implemented using I/O ports.
  • (^) Employs two different types of I/O:
    • (^) Isolated I/O or peripheral mapped I/O.
    • (^) Memory mapped I/O.
  • (^) Method differs in how I/O ports are mapped

into MPU’s address spaces.

  • (^) Some microcomputer employs both method.

Peripheral mapped I/O or Isolated I/O FFFF Port 65 535 I/O address space 00FF Port 255 00FE Port 254 . . . . . . 0004 Port 4 0003 Port 3 0002 Port 2 0001 Port 1 0000 Port 0 Port 0 (16 bit port) Port 1 (16 bit port) Page 0

Peripheral mapped I/O or Isolated I/O

  • (^) Advantages:
    • (^) 1 MByte memory address space is available for use with memory.
    • (^) Special instructions, IN and OUT have been provided in the instruction set of 8088/8086 to perform isolated I/O input and output operations. - (^) These instructions have been tailored to maximize I/O performance.
  • (^) Disadvantages:
    • (^) All input and output data transfers must take place between Accumulator i.e. AL or AX register and the I/O port.

Memory-mapped I/O

FFFFF : Memory address space : E0FFF : : I/O ports : : E E E E : : : 00001 00000 Port 4095 : : I/O ports : : Port 3 Port 2 Port 1 Port 0 I/O addresses Port 0 (16 bit port) Port 1 (16 bit port)

Memory-mapped I/O

• Advantages:

  • (^) Many more instructions and addressing modes are available to perform I/O operations.
  • (^) I/O transfers can now take place between I/O port and internal registers other than just AL/AX.

• Disadvantages:

  • (^) Memory instructions tend to execute slower than those specifically designed for isolated I/O.
  • (^) Part of the memory address space is lost.

Isolated Input / Output Interface

  • (^) The interface permits 8088/

microcomputers to communicate with the

outside world.

  • (^) The interface between MPU and I/O is similar

to MPU and memory.

  • (^) Input output data transfers also take place

over the multiplexed address/data bus.

  • (^) Through this I/O interface, the MPU can input

or output data in bit, byte or word (8086)

formats.

Generic Model of I/O Module

Isolated Input Output Interface :: Minimum- mode Interface

  • (^) Example of I/O device:
    • (^) Keyboard (input).
    • (^) Printer (output).
    • (^) Asynchronous serial communications port (input/output).
  • (^) Circuits in the interface section must perform functions such as: - (^) Select I/O port. - (^) Latch output data. - (^) Sample input data. - (^) Synchronize data transfers.

Isolated Input Output Interface :: Minimum-

mode Interface (8086)

  • (^) Data/Address Lines:
    • (^) Multiplexed address/data bus are used for data

transfer.

  • (^) Complete data bus used for data transfer.
    • (^) AD 0 -AD 15
  • (^) Control Signals:
  • (^) Read and Write signals Similar to memory

interface.

  • (^) I/O signal is use

Input Output Data Transfers

  • (^) Data transfers:
    • (^) Byte-wide or word-wide.
  • (^) I/O address used to select the input/output port to be accessed.
    • (^) I/O address specified as part of the instruction that performs the I/O operation.
  • (^) The addresses:
    • (^) 16 bits in length.
    • (^) Output over AD 0 (LSb) – AD 7 and A 8 -A 15 (MSb).
  • (^) The most significant address lines A 16 -A 19 = 0 during address period (T 1 ) of all bus cycles.
  • (^) IO/M determines I/O operations. Held at 1 during the complete input/output bus cycles.

Input Output Instructions Mnemonic Meaning Format Operation IN Input direct IN Acc, Port (Acc)  (Port) Acc = AL or AX Input indirect (variable) In Acc, DX (Acc)  ((DX)) OUT Output direct OUT Port, Acc (Port)  (Acc) Output indirect (variable) OUT DX, Acc ((DX))  (Acc) Input/output instructions

Input Output Instructions

  • (^) Isolated I/O mode uses special input and

output instructions together with I/O port

addressing modes.

  • (^) Can either be direct or variable I/O

instructions.

  • (^) Can be used to transfer byte/word.
  • (^) All data transfer take place over I/O device and accumulator register (AL/AX). - (^) Known as accumulator I/O.
  • (^) Byte/word wide transfer determined by AL/AX.

Basic I/O Interfaces