1 Microprocessors CSE – 341 Basic I/O Interfacing.

Slides:



Advertisements
Similar presentations
MICROPROCESSOR BASED SYSTEM DESIGN
Advertisements

Computing Systems Organization
I/O Organization popo.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
INPUT-OUTPUT ORGANIZATION
Parul Polytechnic Institute
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
Engineering 4862 Microprocessors Lecture 23 Cheng Li EN-4012
82C55 82C55 Programmable Peripheral Interface Interfacing Part III.
Chapter 2 Microprocessor Architecture
The 8085 Microprocessor Architecture
Microprocessor and Microcontroller
CSNB373: Microprocessor Systems
MICRO PROCESSER The micro processer is a multipurpose programmable, clock driven, register based, electronic integrated device that has computing and decision.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
DIRECT MEMORY ACCESS CS 147 Thursday July 5,2001 SEEMA RAI.
Basic Input/Output Operations
P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
Practical Session No. 10 Input &Output (I/O). I/O Devices Input/output (I/O) devices provide the means to interact with the “outside world”. An I/O device.
Interface circuits I/O interface consists of the circuitry required to connect an I/O device to a computer bus. Side of the interface which connects to.
INPUT-OUTPUT ORGANIZATION
Memory and I/O Interfacing
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
CPU Interfacing Memory.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
Fig 8-4 p-341. S 5 =IF flag (interrupt Enable). S 6 =0 always.
MICROPROCESSOR INPUT/OUTPUT
Computer Architecture Lecture 8 by Engineer A. Lecturer Aymen Hasan AlAwady 30/12/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
BASIC INPUT AND OUTPUT INTERFACING.  8085A communicate with outside world using the I/O devices.  Since memory and I/O devices share the system bus,
Basic I/O Interface A Course in Microprocessor
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
Computer Architecture Lecture 9 by Engineer A. Lecturer Aymen Hasan AlAwady 10/2/2014 University of Kufa - Information Technology Research and Development.
(More) Interfacing concepts. Introduction Overview of I/O operations Programmed I/O – Standard I/O – Memory Mapped I/O Device synchronization Readings:
10-Sep Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept Recall Objective: understand computers at machine level interested.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
Programmable Peripheral Interface Parallel port Interface 8255
PPI-8255.
Programmable Interrupt Controller (PIC)
I/O AND THE 8255; ISA BUS INTERFACING
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Basic I/O Interface Fixed Address Variable Address
Basic LED Interface.
IT3002 Computer Architecture
Khaled A. Al-Utaibi  I/O Ports  I/O Space VS Memory Space  80x86 I/O Instructions − Direct I/O Instructions − Indirect I/O Instructions.
I/O Interface. INTRO TO I/O INTERFACE I/O instructions (IN, INS, OUT, and OUTS) are explained. Also isolated (direct or I/O mapped I/O) and memory-mapped.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Lesson 2 Component Overview Core Hardware Fundamentals.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Intel 8255A PPI EEE 365 [FALL 2014] LECTURE ATANU K SAHA BRAC UNIVERSITY.
Chapter 11: Basic I/O Interface – Part 1. Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. The Intel.
Computer System Structures
The 8085 Microprocessor Architecture
Interfacing I/O Devices
Computing Systems Organization
Operating Systems (CS 340 D)
The 8085 Microprocessor Architecture
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Introduction of microprocessor
E3165 DIGITAL ELECTRONIC SYSTEM
Microcomputer Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Interfacing Memory Interfacing.
Parallel communication interface 8255
Computer Architecture and Assembly Language
The 8085 Microprocessor Architecture
Presentation transcript:

1 Microprocessors CSE – 341 Basic I/O Interfacing

2 Overview A Microprocessor is a great tool for solving problem but is of little or no use if it can’t communicate with other devices. Today we are going to learn some basic concepts about I/O Interfacing of the microprocessor. We will learn a device 82C55 which is very widely used in microprocessor interfacing. This lecture and the next will serve as a prerequisite to the Computer Interfacing course. In that course you will do interfacing in details and will need knowledge of the 82C55 that we may do today.

3 I/O Instructions IN is the instruction that reads information from an I/O device. We saw in the labs that to read data from a port/device we used the IN instruction. OUT is the instruction that writes/sends data to an I/O device. We also used this instruction in the labs to send data to various devices that were interface with the microprocessor. What is the instruction to read/write data from memory? Further instructions such as INS and OUTS is also available on modern microprocessor to send strings of data.

4 I/O Instructions Remember we used a simulator in the labs which only simulated a subset of functions, registers and instructions of the microprocessor. In the labs we used OUT 01 - To send the contents of AL to device connected to Port 1 IN 01 – To read data from device connected to Port 1 and store in AL. In the real microprocessor this structure is slightly different.

5 I/O Instructions In reality the data transfer takes place between the microprocessor accumulator and the I/O device. AL, AX or EAX registers can be used as the accumulator depending on which processor and how many bits are in use. The I/O device may be identified using two methods: Fixed address – A byte called p8 immediately following the opcode stores an 8 bit I/O address. This is called fixed because this is stored with the opcode in the ROM Variable address – Register DX holds a 16 bit I/O address. Because this can be changed it is called variable.

6 I/O Instructions IN AL, p8 - A byte is input from port p8 into AL IN AX, p8 - A word is input from port p8 into AX IN EAX, p8 - A double word is input from port p8 into EAX IN AL, DX - A byte is input from the port addressed by DX into AL IN AX, DX - A word is input from the port addressed by DX into AX IN EAX, DX - A double word is input from the port addressed by DX into AX

7 I/O Instructions Whenever we used IN and OUT instructions, the I/O address is often called a port number. The port numbers appear on the address lines just as addresses of memory would when we access memory. Remember memory decoding ? Port numbers are also decoded to enable I/O devices the same way. If we use p8 only 8 bits are used thus the address or port number appears on lines A0-A7 If we use DX we used16 bits thus the address or port number appears on lines A0-A15

8 I/O Instructions This also means that the first 256 I/O port addresses (00H – FFH) are accessed by both fixed and variable I/O instructions. But addresses 0100H-FFFFH are only accessed by variable I/O Address instructions. The other thing that you need to note is INS and OUTS transfers data between memory and the I/O device. The memory location for INS instruction is obtained by ES:DI The memory location for OUTS instruction is obtained by DS:SI

9 Isolated and Memory Mapped I/O There are two types of I/O interfacing Isolated I/O Memory Mapped I/O This where a device is mapped to a memory location. Sending data to the particular location causes interaction with the device. IN, OUT, INS and OUTS do not need to be used. Simple MOV instructions does the trick. Advantages: Less complication, less circuitry, less decoding and no need to use special signal.

10 Memory Mapped I/O I/O Memory + I/O FFFFF Disadvantage: A portion of the memory system is used as the I/O Map. Can you think of any examples for this system from the labs?

11 Isolated I/O This is the most common form of I/O transfer technique used with Intel processors. The term isolated means that the memory is separate from the I/O addresses. The isolated I/O addresses are thus referred to as Ports So in this system no memory is wasted for I/O mapping. Name one of the devices that was interfaced to the microprocessor in the lab simulator which used ports and didn’t waste and memory space.

12 Isolated I/O A disadvantage is special instructions such as IN, OUT, INS and OUTS need to be used to perform data transfer. Separate signals are also needed to interact with the I/O devices which separate it from normal memory access instructions. M/IO – Used to select Memory or I/O I/O read – IORC I/O write - IOWC On Personal computers Isolated I/O is used. 8 bit port addresses are used to access devices located on system board. 16 bit port address are used to access serial and parallel ports as well as video and disk drive systems.

13 Isolated I/O 1M X 8 FFFFF Memory 64K X FFFF I/O Page 390 of the book shows the I/O for an PC.

14 The basic Input Interface The basic input device is a set of three state buffers. The basic output device is a set of data latches. Remember last week we spoke about why we need buffering? The instruction IN moves data from I/O device and the instruction OUT moves data to the I/O device Please copy basic input Interface example being done on the board. This example as we see is a part of the basic input circuit and is not optional. It appears either as a discrete part of the circuit or is embedded into the actual I/O device circuitry.

15 The basic Output Interface Please copy basic output interface example being done on the board. This example shows connection of 8 simple LED to the microprocessor. The latch stores the number that is being output my the microprocessor. Latches need to hold data because when the microprocessor executes OUT instruction, the data is only present on the data bus for less than 1.0  s. Without a latch a viewer would never see the LED turn on. Data are retained by the latch until it gets the next OUT instruction.

16 This buffering is not only important for LED but for many I/O devices. This is because they accept or release information at a much slower rate than the microprocessor. Another method of I/O control to perform synchronization of the processor with slower devices is called handshaking or polling. An example of this could be printing through a parallel printer that can print at 100 characters per second. Microprocessor can obviously send data at a faster rate than the 100 CPS of the printer. There has to be ways to slow the microprocessor down to match the printers printing speed.

17 Certain parts of interfacing requires you to have knowledge of electronics and components. Current and voltages have to be dealt with and measured accurately to ensure that devices in the system are not damaged. Remember we did TTL. The voltages that the microprocessor interprets as 1 and 0. These voltages need to adhered by for the system to work. Remember the concept of switch bouncing. Electronic hardware using gates can be used to debounce switches which frees the programmer from writing delay routines. However, we are not interested in the complexities of electronics for this course. You will learn more in the interfacing course.

18 I/O Port Address Decoding This uses the same concept as memory decoding. Memory mapped I/O is the same as memory decoding. Hence, we only discuss isolated I/O decoding. In Memory decoding we decoded the entire set of pins. A0 – A19/A23/A31 In Isolated I/O Addressing we only need to decode A0-A15. (Remember they are either 8 bit or 16 bit) If the system only employs Fixed I/O Addressing we only need to decode A0-A7. For personal computers we always decode all 16 bits.

19 8 bit I/O Addresses Fixed I/O uses 8 bit I/O port addresses that appears on A0-A15 as 0000H – 00FFH. If a system will never have more than 256 I/O Devices we can get away with decoding only A0-A7. The rest can be ignored. The variable system can also employ 8 bits if necessary and can address 00H – FFH. If address is decoded as a 8 bit address we can never include I/O Devices that use 16 bit I/O Addresses. Please Copy the eight bit I/O address decoding example done of the board Ignored pins that don’t matter or are not used are said to be in “Don’t Care” state in microprocessor terms.

20 16 bit I/O Addresses Modify the circuit so that 16 bit addresses are decoded to give the range EFF8H - EFFFH An alternative approach is to use more than one decoder device such as 138 or 16L8. Both approaches are shown on page 397/399 of the text book.

21 The programmable peripheral Interface The 82C55 programmable peripheral interface (PPI) is a very popular low-cost interfacing component that is used found in many applications. Applications range from 7-segment display, stepper motor connection, counters to key pad management. This device is still in use today in P4 Computers and is used to interface and detect key presses on modern keyboards, parallel printers and other interfacing chipsets. For those of you who are doing computer interfacing course you will be extensively using this device to interface various devices with the PC.

22 82C55 This device has slightly different structure to the microprocessors we have done so far. I will only go through this device briefly but am not really going to teach you how to use this in depth. For students who are interested this is covered in section 11-3 of the book.

23 82C55 This devices has 24 pins for I/O. There are three distinct modes of operation Mode 0, Mode 1 and Mode 2. Group A connections consists of Port A(PA0-PA7) and the upper half of port C (PC4-PC7) Group B connections consists of Port B (PB0-PB7) and the upper half of port C (PC0-PC3) The I/O pins can be programmed in groups of 12 pins.

24 82C55 CS pin is used to select the device for reading or writing. Control lines A0 and A1 are used to select the Port that requires interaction. A1A0Function 00Port A 01Port B 10Port C 11Command Registers

25 Questions Questions on anything that we have done today or before? We will start with 8255 next week and after discussing its modes in details we will move on to Interrupt Control and Direct Memory Access. I don’t want to lump you with stuff that’s why I went a bit slow today and didn’t cover a lot of material. Please make sure you catch up on your studies if you are lagging behind. Also please make it on time for the labs next week. I will be doing lectures during the first hour of the labs.

26 Modes Port A Port B Port C Mode 0 InOut InOut INOut