Input / Output (Peripheral) Interfacing

Slides:



Advertisements
Similar presentations
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Advertisements

Parul Polytechnic Institute
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
The Intel 8255 Programmable Peripheral Interface chip is used to give the microprocessor (8088) access to programmable input/ output devices. It has three.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
Khaled A. Al-Utaibi 8086 Bus Design Khaled A. Al-Utaibi
Memory & IO Interfacing to CPU
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
8253/54 Timer Section /54 Timer Description and Initialization
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
Engineering 4862 Microprocessors Lecture 23 Cheng Li EN-4012
8088 Microprocessor Hardware. Microprocessor System Modules CPU Memory (RAM, ROM) Peripherals (IO) Data Bus Control Bus Address Bus Keyboard Monitor Printer.
The 8085 Microprocessor Architecture
University of Tehran 1 Microprocessor System Design Interrupt Omid Fatemi
Microprocessor and Microcontroller
P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
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.
kashanu.ac.ir Microprocessors 10-1 IO Devices Stepper Motors DAC, ADC, PPI Lec note 10.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
PIT: Programmable Interval Timer
CPU Interfacing Memory.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
MCS-51 Hardware Interfacing
The 8253 Programmable Interval Timer
Port Mapped I/O.
Basic I/O Interface A Course in Microprocessor
By, Prof. Tambe S. S. S.N.D. College of Engineering and Research Center Department of Electrical Engineering.
I NTRODUCTION P IN CONFIGARATION O PERATING MODE.
Input/Output Interface Circuits and LSI Peripheral Devices
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.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
8086/8088 Hardware System. Typical Microprocessor Memory System CPU Memory Control Address Data.
Programmable Peripheral Interface Parallel port Interface 8255
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
EE3721 Computer System Principles
Programmable Interrupt Controller (PIC)
I/O AND THE 8255; ISA BUS INTERFACING
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Basic I/O Interface Fixed Address Variable Address
ENEE 440 Chapter PPI 8255 Register Select -CS A1 A0 REGISTER R/W PORT A R/W PORT B R/W PORT C R/W CR W 1 X X8255 NOT.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
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.
1 Microprocessors CSE – 341 Basic I/O Interfacing.
ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 9.
8255:Programmable Peripheral Interface
8086 – I/O Interfacing - I/O mapped I/O
Memory Mapped IO (and the CerfBoard). The problem How many IO pins are available on the 8051? What if you are using interrupts, serial, etc…? We want.
Intel 8255A PPI EEE 365 [FALL 2014] LECTURE ATANU K SAHA BRAC UNIVERSITY.
8255 Programmable Peripheral Interface
PROGRAMMABLE PERIPHERAL INTERFACE -8255
8255: Programmable Peripheral Interface (PPI)
Diagram of microprocessor interface with IO devices
The 8255 Programmable Peripheral Interface
8085 Microprocessor Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Interfacing Memory Interfacing.
8254 Timer and Counter (8254 IC).
I/O Interfacing CSE 2312 Maher Al-Khaiyat.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
8255.
Engineering 4862 Microprocessors Lecture 25
Parallel communication interface 8255
Programmable Peripheral Interface
8085 Microprocessor Architecture
Programmable Peripheral Interface
8085 Microprocessor Architecture
Presentation transcript:

Input / Output (Peripheral) Interfacing

Peripheral devices Peripheral devices Input devices such as keyboard, switches, Mouse, Microphone Output devices such as LED, LCD, Monitor, Printer, Speaker

Peripheral devices vs. Memory like a memory chip, it is mapped to a certain location (called the port address) unlike a memory chip, a peripheral is usually mapped to a single location

Peripheral devices vs. Memory (continue) like a memory chip, you can write to an output device You can write to a memory chip using the command such as mov [2000], al You can write to an output device using the OUT command

Peripheral devices vs. Memory (continue) like a memory chip, you can read from an input device You can read from a memory chip using the command such as mov al, [4000] You can read from an input device using the IN command

Two formats for IN / OUT Instruction Format 1: 8 bit address IN AL, port# example: IN AL, 40H Or OUT port#, AL example: OUT E3H, AL Can address up to 256 I/O devices I/O MAP 00 H 01 H FF H

Two formats for IN / OUT Instruction Format 2: 16 bit address MOV DX, port# IN AL, DX Example: MOV DX, 2500H IN AL, DX Or MOV DX, port# OUT DX, AL MOV DX, FF00H OUT DX, AL Can address up to 64k I/O devices I/O MAP 0000 H 0001 H FFFF H

Processor Timing Diagram for any I/O write (OUT instruction) machine cycle

Creating a Simple Output Device (16 bit address format) Use 8-LED’s as output device Assign an address for this output device for example F000H Use a Latch and an address decoder such that the LED’s will only respond to the command out with a specific address (let’s assume that the address is F000) and latch the data

Use of 74LS373 and Address Decoder : A0 74LS373 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 D0 D1 D2 D3 D4 D5 D6 D7 OE LE : mov al, 55 mov dx, F000 out dx, al D7 D6 D5 D4 D3 D2 8088 D1 Minimum D0 Mode IOR IOW Address Decoder A A A A A A A A A A A A A A A A IOW 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 5 4 3 2 1

Processor Timing Diagram for any I/O read (IN instruction) machine cycle

Creating a Simple Input Device Use 8-Switches (keys) Assign an address for this input device for example F000H Use 8 bit tri state gate (74244) and an address decoder such that the keys will be read only with the command IN at a specific address (let’s assume that the address is F000)

Use of 74LS245 and Address Decoder 5V A18 74LS244 B0 B1 B2 B3 B4 B5 B6 B7 A0 A1 A2 A3 A4 A5 A6 A7 E : A0 D7 : mov dx, F000 in al, dx D6 D5 D4 D3 D2 8088 D1 Minimum D0 Mode IOR IOW Address Decoder Same address for input and output? A A A A A A A A A A A A A A A A IOR 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 5 4 3 2 1

Output Port Design (8 bit address format) We assign output port address as 99H ( 1001 1001 B )

Input Port Design (8 bit address format) We assign input port address as 5FH ( 0101 1111B )

تمرین: (چراغ راهنمایی) سه LED سبز، قرمز و زرد از طریق یک لچ 74373 به cpu اینترفیس شده است برنامه ای به زبان اسمبلی 8088 بنویسید که به ترتیب LED سبز 70 ثانیه LED زرد 4 ثانیه و LED قرمز 50 ثانیه روشن شده و این کار تکرار شود. فرکانس کلاک اعمالی به CPU را 8MHZ در نظر بگیرید. آدرس پرت خروجی را 5EH فرض نمایید.

8255: Programmable Peripheral Interface (PPI)

8255 Features One of the most widely used I/O chips Is a 40-pin DIP chip Has three separately accessible ports, A, B, and C which can be programmed as input or output Has the capabilities of 74373 and 74244 together

8255 block diagram

8255 Pin description Port A (PA0-PA7): This 8-bit port A can be programmed all as input or all as output PB(PB0-PB7): This 8-bit port B can be programmed all as PC(PC0-PC7): This 8-bit port C can be all input or all output. It can also be split into two parts, CU (upper bits PC4-PC7) and CL (lower bits PC0-PC3). Each can be used for input or output. Any of PC0 to PC7 can be programmed individually. RD’ and WR’: (inputs) IOR and IOW of the system bus are connected to these two pins.

8255 Pin description (cont.) RESET:(input) used to clear control register. When RESET is activated, all ports are initialized as input ports. This pin must be connected to the RESET output of the system bus. A0, A1 and CS’(chip select): While CS selects the entire chip, address pins A0 and A1 select the specific port within the 8255. These three pins are used to access ports A, B, C, and the control register, as shown in Table 11-3. D0-D7: Data bus of chip which are connected to CPU data bus.

8255 Pin description (cont.)

Mode selection of the 8255 While ports A, B and C are used for I/O data, it is the control register that must be programmed to select the operation mode of the three ports A, B and C.

The modes of 8255 ports Mode 0, simple I/O mode. In this mode, any of the ports A, B, CL and CU can be programmed as input or output. In this mode, all bits are out or all are in. In other words, there is no control of individual bits. Mode 1. In this mode, ports A and B can be used as input or output ports with handshaking capabilities. Mode 2. In this mode, port A can be used as a bidirectional I/O port with handshaking capabilities.

Programming of 8255 The 8255 is programmed in any of the mode by sending a byte (Intel calls it control word) to the control register of the 8255 (as shown in fig. 11-12)

Example: Mode 0

Example: Mode 0 (cont.)

BSR(Bit Set Rest) mode In BSR mode, we can set or reset bits of port C individually We can do it by writing a proper control word in control register (as shown in fig 5 )

Example for BSR Program 8255 for the following Solution A) B) A) set PC2 to high B) Use PC6 to generate a square wave of 66% duty cycle Solution A) MOV AL, 00000101B OUT 93H,AL B) AGAIN MOV AL, 0xxx1101 OUT 93H, AL CALL Delay CALL Delay MOV AL, 0xxx1100 OUT 93H, AL CALL Delay JMP AGAIN

Dac adc