Engineering 4862 Microprocessors Lecture 23 Cheng Li EN-4012

Slides:



Advertisements
Similar presentations
The Intel 8255 Programmable Peripheral Interface chip is used to give the microprocessor (8088) access to programmable input/ output devices. It has three.
Advertisements

PROGRAMMABLE PERIPHERAL INTERFACE -8255
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.
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
Lecture 07: 8255 PPI Chip. The 80x86 IBM PC and Compatible Computers Chapter PPI Chip PPI: Programmable Parallel Interface (so it is an I/O.
COMP3221: Microprocessors and Embedded Systems Lecture 17: Computer Buses and Parallel Input/Output (I) Lecturer: Hui.
The 8085 Microprocessor Architecture
Microprocessor and Microcontroller
Direct Memory Access Introduction to 8237
I/O Subsystem Organization and Interfacing Cs 147 Peter Nguyen
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.
Engineering 4862 Microprocessors Lecture 26 Cheng Li EN-4012
kashanu.ac.ir Microprocessors 10-1 IO Devices Stepper Motors DAC, ADC, PPI Lec note 10.
Chapter 10 Input/Output Interface Circuits and LSI Peripheral Devices
Microcomputer & Interfacing Lecture 2
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
MCS-51 Hardware Interfacing
Computer Architecture
MICROPROCESSOR INPUT/OUTPUT
Port Mapped I/O.
Basic I/O Interface A Course in Microprocessor
1. Introduction 2. Methods for I/O Operations 3. Buses 4. Liquid Crystal Displays 5. Other Types of Displays 6. Graphics Adapters 7. Optical Discs 10/01/20151Input/Output.
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.
Input / Output (Peripheral) Interfacing
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
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.
PPI-8255.
EE3721 Computer System Principles
Engineering 4862 Microprocessors Lecture 21
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
Basic LED Interface.
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.
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.
ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 9.
بسم الله الرحمن الرحيم MEMORY AND I/O.
8255:Programmable Peripheral Interface
Intel 8255A PPI EEE 365 [FALL 2014] LECTURE ATANU K SAHA BRAC UNIVERSITY.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
8255 Programmable Peripheral Interface
EEE /INSTR/CS F241 ES C263 Microprocessor Programming and Interfacing
PROGRAMMABLE PERIPHERAL INTERFACE -8255
8255: Programmable Peripheral Interface (PPI)
The 8085 Microprocessor Architecture
The 8255 Programmable Peripheral Interface
DMA CONTROLLER 8257 Features: It is a 4-channel DMA.
Interfacing Memory Interfacing.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
8255.
Engineering 4862 Microprocessors Lecture 25
Parallel communication interface 8255
Programmable Peripheral Interface
Programmable Peripheral Interface
The 8085 Microprocessor Architecture
The Programmable Peripheral Interface (8255A)
Presentation transcript:

Engineering 4862 Microprocessors Lecture 23 Cheng Li EN-4012

Engr 4862 Microprocessors I/O Design When designing an I/O port, ensure that the port is only active when selected by the microprocessor –Use latches (output) and buffers (input) to isolate the I/O port circuitry from the address and data bus –Use the correct combinatorial logic circuitry and/or decoders with address bus to select the port

Engr 4862 Microprocessors Input / Output Instructions For 8-bit port IN AL, Port #OUT Port #, ALMOV DX, Port # IN AL, DXOUT DX, AL For 16-bit port IN AX, Port #OUT Port #, AXMOV DX, Port # IN AX, DXOUT DX, AX

Engr 4862 Microprocessors Input / Output Instructions Since 8086/88 has a 16-bit data bus internally, it is capable of transferring 16-bit data to or from AX.  This requires having two port addresses, one for each byte! Example: AX = 9876H, Port # = 40H OUT 40H, AX  Port 40  76H (AL), Port 41  98H(AH) For 8086, takes one bus cycle to complete the transfer, for 8088, two bus cycles are required

Engr 4862 Microprocessors Output Design Example: 8 LEDs This is a byte-wide output port The LEDs cannot be connected directly to data bus –Difficult to select the LEDs –LEDs would only display value for very short period of time (about 400ns, or 2 clock cycles) Only when data bus carries the correct signal –Microprocessor cannot sink enough current

Engr 4862 Microprocessors Example: 8 LEDs Instead, we need to capture the values on the data bus, and hold them until changed –The 74LS373 octal latch will do nicely LS373 Data bus

Engr 4862 Microprocessors Example: 8 LEDs We only want the latch to load values from the data bus when the microprocessor outputs to the correct port # –Suggestion 1: Decode the address directly –Suggestion 2: Use a decoder such as the 3x8 74LS138 with lines from the address bus

Engr 4862 Microprocessors Example: 8 LEDs DQ D0 74LS373 D7 Q0 Q7 System Data Bus Latch Out OC System Address Bus IOW G

Engr 4862 Microprocessors Example: 8 LEDs LS373 Data bus 74LS138 Address bus Note: This is not quite enough!

Engr 4862 Microprocessors

Example: 8 LEDs How do we connect the LEDs? –2 possibilities

Engr 4862 Microprocessors Example: 8 LEDs LS V

Engr 4862 Microprocessors Example: 8 LEDs LS V The 74LS138 does not have enough power to drive an LED. The device can sink enough current for the LED to light (15 to 20 mA). 180ohms

Engr 4862 Microprocessors Bus Cycles for outputting Assume the port address is 99H  OUT 99H, AL –T1: address 99H is provided to address bus A0 – A7 through AD0 – AD7 and ALE signal –T2: IOW is provided and the contents of AL are released into the data bus pins AD0 – AD7 –T3: signal propagates to the destination port –T4: the content of AL are latched into the 74LS373 with the IOW going from low to high

Engr 4862 Microprocessors Example: 8 LEDs Instead, we need to capture the values on the data bus, and hold them until changed –The 74LS373 octal latch will do nicely LS373 Data bus

Engr 4862 Microprocessors Example: 8 LEDs We only want the latch to load values from the data bus when the microprocessor outputs to the correct port # –Suggestion 1: Decode the address directly –Suggestion 2: Use a decoder such as the 3x8 74LS138 with lines from the address bus

Engr 4862 Microprocessors Example: 8 LEDs DQ D0 74LS373 D7 Q0 Q7 System Data Bus Latch Out OC System Address Bus IOW G

Engr 4862 Microprocessors Example: 8 LEDs LS373 Data bus 74LS138 Address bus Note: This is not quite enough!

Engr 4862 Microprocessors

Example: 8 LEDs How do we connect the LEDs? –2 possibilities

Engr 4862 Microprocessors Example: 8 LEDs LS V

Engr 4862 Microprocessors Example: 8 LEDs LS V The 74LS138 does not have enough power to drive an LED. The device can sink enough current for the LED to light (15 to 20 mA). 180ohms

Engr 4862 Microprocessors Bus Cycles for outputting Assume the port address is 99H  OUT 99H, AL –T1: address 99H is provided to address bus A0 – A7 through AD0 – AD7 and ALE signal –T2: IOW is provided and the contents of AL are released into the data bus pins AD0 – AD7 –T3: signal propagates to the destination port –T4: the content of AL are latched into the 74LS373 with the IOW going from low to high

Engr 4862 Microprocessors

Example: 8 Switches Now we will look at an 8-bit input port. The procedure to select the port is similar to the output case –Use IORD* instead of IOWR*

Engr 4862 Microprocessors Example: 8 Switches We cannot use a latch to separate the switches from the microprocessor –We only want the switch values to be on the data bus when the microprocessor asks for it –A latch would constantly drive the bus!

Engr 4862 Microprocessors Example: 8 Switches The device of interest here is the 74LS244 tristate buffer (unidirectional) –NOT the same as the 74LS245 transceiver (bidirectional) Tristate: –One of three states: on (1), off (0), or open (Z) –In the open state, the buffer does not drive the data bus

Engr 4862 Microprocessors

Example: 8 Switches How do we set up the switches? –When open, one logic level –When closed, the other logic level

Engr 4862 Microprocessors Example: 8 Switches LS V 10K ohms

Engr 4862 Microprocessors Example: 8 Switches D0 74LS244 D7 Q0 Q7 Switches To System Data Bus G1 System Address Bus IOR D4 G2

Engr 4862 Microprocessors Summary Since the data provided by the CPU to the port is on the system data bus for a limited amount of time ( ns), it must be latched before it is lost In order to prevent any unwanted data from coming into the system data bus, all input devices must isolated through the tri-state buffer –The 74LS244 not only plays this role, but also provides the incoming signals sufficient strength (boosting) to travel all the ways to the CPU. As general, every device (memory, peripherals) connected to the global data bus must have a latch ot tri- state buffer

Engr 4862 Microprocessors

Programmable I/O The previous examples are good for many applications, but sometimes a more powerful and flexible solution is needed. The 8255 Programmable Peripheral Interface (PPI) is a 40-pin DIP IC that provides 3 programmable I/O ports, A, B, and C. One can program the individual port to be input or output port, economical and flexible than 74LS373, 73LS244, which must be hard wired)

Engr 4862 Microprocessors Programmable I/O How are is it programmable? –Configure each port as input or output –Different modes of operation You must initialize the PPI via software commands –Send a control byte to the device’s control register port

Engr 4862 Microprocessors Pin Description PA0 – PA7: Port A / All / input/output/bidirectional PB0 – PB7: Port B / All / input/output PC0 – PC7: Port C / All / input/output Can be split into two parts: Upper (PC7 – PC4) and Lower (PC3 – PC0). Each can be used for input or output. Any of PC0 – PC7 can be programmed. RD and WR: control signal input to 8255 IOR and IOW in peripheral I/O MEMR and MEMW in memory-mapped I/O

Engr 4862 Microprocessors Pin Description RESET: Active high input signal to 8255 –Used to clear the internal control register –When activated, all ports are initialized as input ports. –Usually connect to the RESET output of the system bus or ground A0, A1, and CS –CS selects the entire chip, A0 and A1 select the specified port –Used to access port A, B, C, CS A1 A0 Select or control register Port A Port B Port C Control Reg. 1 x x Not Selected

Engr 4862 Microprocessors Control Word of 8255 Port C Lower PC 3 -PC 0 1 = input, 0 = output Port B 1 = input, 0 = output Mode Selection 0 = Mode0, 1 = Mode1 Port C Upper PC 7 -PC 4 1 = input, 0 = output Port A 1 = input, 0 = output Mode Selection 00 = Mode0, 01 = Mode1 1x = Mode 2 1 = I / O Mode 0 = BSR Mode Group B Group A D7D7 D6D6 D3D3 D2D2 D1D1 D0D0 D5D5 D4D4

Engr 4862 Microprocessors Mode Selection It’s the control register that must be programmed to select the operation mode of the three ports: A, B, and C The 8255 chip is programmed in any of the above modes by sending a byte (control word) to the control register of the 8255

Engr 4862 Microprocessors Mode Selection Mode 0: simple I/O –Any ports: A, B, CL, CU. No control of individual bits Mode 1: I/O (ports A and B) with handshaking (port C) –Synchronizes communication between an intelligent device (printer) Mode 2: Bi-directional I/O with handshaking –Port A: bidirectional I/O with handshaking through port C –Port B: Simple I/O or in handshake mode 1 BSR Mode: Bit set/reset –Only the individual bits on Port C can be programmed

Engr 4862 Microprocessors 8255 Design Example Mode 0 –Any of ports A, B, C can be programmed as input or output –Port can not be both an input and output port at the same time –Port C can be programmed with CL, CH separately –Example:

Engr 4862 Microprocessors 8255 Design Example D0 D7 A2 System Address Bus IOW A7 D0 D7 IOR WR RD A0 A1 A0 A1 CS A B CL CH