Top Banner
Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
13

Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Dec 29, 2015

Download

Documents

Kory Howard
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Lecture 13Basic I/O Interface

Presented ByDr. Shazzad Hosain

Asst. Prof. EECS, NSU

Page 2: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

I/O Port Address Decoding

• I/O port address decoding is very similar to address decoding

• Any I/O device is addressed by a port number• Reading or writing to an I/O device is to read

or write to that port address

Page 3: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

INS Instructions

• INSB – Input String Byte, from I/O device to memory location

Table 4-14: From Brey’s Book

Page 4: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Example

• Read 50 bytes of data from an I/O device whose address in 03ACH and store the data in LISTS array

Example 4-7: From Brey’s Book

Page 5: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

OUTS Instructions

• OUTSB – Output String Byte, from string memory location to I/O device

Table 4-15: From Brey’s Book

Page 6: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Example

• Transfer data form memory array (ARRAY) to an I/O device at I/O address 3ACH

Example 4-8: From Brey’s Book

Page 7: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Decoding 8-Bit I/O Addresses• Decode 8-bit I/O ports F0H – F7H using 74ALS138 decoder

1111 0000 = F0H1111 0111 = F7H

Page 8: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Decoding 8-Bit I/O Addresses• Develop an I/O port decoder, using a 74ALS138, for the 8-bit I/O port

addresses 10H, 12H, 14H, 16H, 18H, 1AH, 1CH and 1EH

Page 9: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

The Programmable Peripheral Interface (PPI)• 82C55 is a very popular low-cost

interfacing component found in many applications

• It sits between microprocessor and the I/O devices

• It has three ports– Port A– Port B– Port C

• Also has an internal command register

Page 10: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Why Peripheral?

I/O Devices

Page 11: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Interfacing 82C55• Connect 82C55 so that it functions at 8-bit I/O port addresses C0H (port A), C2H

(port B), C4H (port C), and C6H (command register).

1100 0000 = C0H1100 0010 = C2H1100 0100 = C4H1100 0110 = C6H

Page 12: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

Interfacing 82C55• Draw the diagram for interfacing 82C55 for the following addresses 8C (Port A), 9C• (Port B), AC (Port C) and BC (command register).

CBA011

Page 13: Lecture 13 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.

References

• Chapter 9 The Intel Microprocessors – by Barry B. Brey