Lecture-50 Intel 8255A: Programming and Operating Modes

Similar documents
Lecture-55 System Interface:

PIO 8255 (cont..) M Krishna kumar MAM/M3/LU9e/V1/2004 1

Lecture-53 Mode 2: (Strobed Bidirectional bus I/O) This functional configuration provides means for communicating with a peripheral device on a

Segment A Programmable Peripheral Interface (PPI)

13. IN PORT: This is an ALP statement. PORT is the symbolic name given to 8-bit address of the input device available as a 2 nd byte of the

Summer 2003 Lecture 21 07/15/03

8255 Programmable Peripheral Interface Architecture MCT/UNIT III/NARASIMHARAJ/LECTURE NOTES /IV MECH A


CHAPTER: 3 PROGRAMMABLE PERIPHERAL INTERFACE & ELECTROMECHANICAL DEVICES INTERFACING

INTERFACING INTERFACING. Richa Upadhyay Prabhu. NMIMS s MPSTME February 25, 2016

8254 is a programmable interval timer. Which is widely used in clock driven digital circuits. with out timer there will not be proper synchronization

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

9. PERIPHERAL CHIPS 9a

Chapter 13 Direct Memory Access and DMA-Controlled I/O

Microprocessor Architecture

Address connections Data connections Selection connections

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

Architecture of 8085 microprocessor

PIN DIAGRAM. Richa Upadhyay Prabhu. NMIMS s MPSTME January 19, 2016

I/O Design. Input / Output Instructions. Engineering 4862 Microprocessors. Lecture 23. Cheng Li

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors

The functional block diagram of 8085A is shown in fig.4.1.

1. Internal Architecture of 8085 Microprocessor


Lecture-9 Intel 8085 Microprocessor It is a 40-pin DIP(Dual in package) chip, base on NMOS technology, on a single chip of silicon.

Pin Description, Status & Control Signals of 8085 Microprocessor

Lecture Note On Microprocessor and Microcontroller Theory and Applications

Topics. Interfacing chips

Handout 15. by Dr Sheikh Sharif Iqbal. Memory Interface of 8088 and 8086 processors

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

Basic I/O Interface

Features: 3 8-bit IO ports PA, PB, PC. PA can be set for Modes 0, 1, 2. PB for 0,1 and PC for mode 0 and for BSR. Modes 1 and 2 are interrupt driven.

CPE/EE 421 Microcomputers

UNIT 3 THE 8051-REAL WORLD INTERFACING

UNIT - II PERIPHERAL INTERFACING WITH 8085

a8255 Features General Description Programmable Peripheral Interface Adapter

Allmost all systems contain two main types of memory :

Consider, for example an input device that has data available at

Intel 8255 PPI. Presented By: Diwakar Yagyasen Asst. Prof. CSE BBDNITM, Lucknow.

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

To Interface The 8085 Microprocessor

RTC Interface 89C51 DS M. Krishna Kumar MAM/M7/LU17/V1/ Vcc VCC 5 SDA P1.0 6 SCL P KHz 3 BAT 3.

Unit-IV Peripheral Interfacing S.Sayeekumar, AP/RMDEEE

HM628128BI Series. 131,072-word 8-bit High speed CMOS Static RAM

CHAPTER TWELVE - Memory Devices

C13. INTERFATA PARALELA PROGRAMABILA (PPI) I8255A (PIO)

These three counters can be programmed for either binary or BCD count.

MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

(1) Define following terms: Instruction, Machine Cycle, Opcode, Oprand & Instruction Cycle. Instruction:

General Purpose Programmable Peripheral Devices. Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

In this tutorial, we will discuss the architecture, pin diagram and other key concepts of microprocessors.

Registers Format. 4.1 I/O Port Address

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT IV I/O INTERFACING PART A (2 Marks)

Vidyalankar T.E. Sem. V [EXTC] Microprocessors and Microcontrollers I Prelim Question Paper Solution V SS (GND)

8086 Hardware Specification

8051 Microcontroller

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

MICROPROCESSOR B.Tech. th ECE

MICROPROCESSORS & INTERFACING (A1423) C.Lokanath Reddy Assistant Professor.

CPE/EE 421/521 Fall 2004 Chapter 4 The CPU Hardware Model. Dr. Rhonda Kay Gaede UAH. The CPU Hardware Model - Overview

MICROPROCESSOR LAB PROJECT EC 316 MADE BY:-

Pin diagram Common SignalS Architecture: Sub: 8086 HARDWARE

FIGURE 1. ADC0808/ADC0809

TL0313. LCD driver IC. Apr VER 0.0. lsi. ( 5.5V Specification ) 65COM / 132SEG DRIVER & CONTROLLER FOR STN LCD. TOMATO LSI Inc.

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

Basics of Microprocessor

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Overview of Intel 80x86 µp

EC 6504 Microprocessor and Microcontroller. Unit II System Bus Structure

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

UMBC. 80C86/80C88: CMOS version draws 10mA with temp spec -40 to 225degF. 450mV while input max can be no higher than 800mV). 0 0.

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

Microprocessors and Microcontrollers (EE-231)

Microprocessor Architecture. mywbut.com 1

Introduction read-only memory random access memory

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

Memory Expansion. Lecture Embedded Systems

Lecture-51 INTEL 8259A Programmable Interrupt Controller

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT I THE 8085 & 8086 MICROPROCESSORS. PART A (2 Marks)

Chapter 1: Basics of Microprocessor [08 M]

Summer 2003 Lecture 18 07/09/03

UNIT III. 2. Non-maskable interrupts. 3. Software interrupt. 4. Internal interrupt

Lecture-41 Interrupt I/O Transfer

MICROPROCESSOR TECHNOLOGY

DA800 User s Manual Real Time Devices, Inc.

UNIT.4. Syllabus I/O INTERFACING 8085

RA8835. Dot Matrix LCD Controller Specification. Version 1.2 June 1, RAiO Technology Inc. Copyright RAiO Technology Inc.

MP Assignment III. 1. An 8255A installed in a system has system base address E0D0H.

8/26/2010. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to Three Units of 8085

PCI bit Digital Input/ Output Card for PCI Bus. User s Manual

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

RA8835A. Dot Matrix LCD Controller Specification. Version 1.1 September 18, RAiO Technology Inc. Copyright RAiO Technology Inc.

ROM (4K X 8) ROM (4K X 8) FOLD BACK FOR RAM0 RWM - RAM (2K X 8) RWM - RAM (2K X 8) FOLD BACK FOR RAM1 INPUT DEVICE 1

12-Dec-11. Gursharan Singh Maninder Kaur. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to 8085

82C55. Programmable Peripheral Interface. Interfacing Part III

Chapter NINE 8088,80286 MICROPROCESSORS AND ISA BUS

82C54 CHMOS PROGRAMMABLE INTERVAL TIMER

INTRO TO I/O INTERFACE

MEMORY-MAPPED I /O. Universiti Teknikal Malaysia Melaka. Input/Output System Design

Transcription:

Lecture-50 Intel 8255A: Programming and Operating Modes Operation Description: There are three basic modes of operation that can be selected by the system software. Mode 0: Basic Input/output Mode 1: Strobes Input/output Mode 2: Bi-direction bus. When the reset input goes HIGH all ports are set in mode-0 as input which means all 24 lines are in high impedance state and can be used as normal input. After the reset is removed the 8255A remains in the input mode with no additional initialization. During the execution of the program any of the other modes may be selected using a single output instruction. The modes for PORT A & PORT B can be separately defined, while PORT C is divided into two portions as required by the PORT A and PORT B definitions. The ports are thus divided into two groups Group A & Group B. All the output register, including the status flip-flop will be reset whenever the mode is changed. Modes of the two groups may be combined for any desired I/O operation e.g. Group A in mode-1 and group B in mode-0. The basic mode definitions with bus interface are given in fig9.5 (a) (b) and (c).

AB BCB BDB Decoder IO/M RD WR 8 D7-D0 8255 A PPI 2 A1,A0 CS PORT B PORT A PORT C 8 8 4 4 PB7-PB0 PA7-PA0 PC7-PC4 PC3-PC0 (a) Mode-0 AB BCB BDB Decoder IO/M RD WR 8 D7-D0 8255 A PPI 2 A1,A0 CS PORT B PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 PORT A 8 8 STBB/ STBB/ I/O INTRB ACKB I/O ACKB PB7-PB0 PA7-PA0 IBFB/ INTRA IBFB/ I/O OBFB I/O OBFB (b) Mode-1

AB BCB BDB Decoder IO/M RD WR 8 D7-D0 8255 A PPI 2 A1,A0 CS PORT B PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 PORT A 8 8 I/O I/O I/O STBB/ ACKB PB7-PB0 INTRA IBFB/ OBFB (c) Mode-2 Fig.9.5 Mode Definition with Bus Interface PA7-PA0 (Bi-directional Bus) The format for the control word is given in fig.9.6. Mode Set Flag 1= Active D7 D6 D5 D4 D3 D2 D1 D0 Group A Mode 00 = Mode 0 01 = Mode 1 10 = Mode 2 PORT A 1 = Input 0 = Ouput PORT C Upper 1 = Input 0 = Ouput PORT C Lower 1 = Input 0 = Ouput PORT B 1 = Input 0 = Ouput Group B Mode 0 = Mode 0 1 = Mode 1 Fig.9.6 Mode Set Control Word Format

Single Bit Set-Reset Feature: Any of the eight bits of PORT C programmed in output mode can be SET (High) or Reset (Low) using a single OUTPUT instruction without affecting other bits of PORT C. This feature reduces software requirement in control application. When PORT C is being used as status /control for PORT A or PORT B, these bits can be set or reset by using the bit set/reset operation just as if they were data output ports. The bit set/reset format is given below: D7 D6 D5 D4 D3 D2 D1 D0 Don't Care Bit Set/Reset Flag 0= Active Bit Set/Reset 1 = Set 0 = Reset PORT C Bit Select 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 1 0 1 2 3 4 5 6 7 Fig.9.7 Bit-Set Reset Control Word Format The control word formed to set or reset any bit of PORT C is issued to control word register instead of PORT C register. An example for interfacing 8255A with CPU: If 8255A is programmed in isolated I/O mapped manner, then IN PORT & OUT PORT instructions are used for data transfer. When these instructions are executed, the 8085A duplicates the PORT address on the address bus and on the address data bus as discussed earlier. Thus,

A 15 A 8 = AD 7 AD 0 This equation is called the duplication equation. Therefore PORT A is read if A 15 A 8 = AD 7 AD 0 xxxx xx00 = xxxx xx00 We may allocate any address to 8255A by selecting A 15 -A 10 bits. Let us assume A 15 - A 11 bits to be 00000 for generating the chip select signal along with IO/M = 1. A 10 bit is not used in generating chip select signal and is redundant. Therefore PORT A is accessed when address bus is having A 15 - A 8 be 0000 0x00. Therefore, primary address for PORT A becomes 00H and fold back address becomes 04H. Accordingly, the other ports PORT B, PORT C and Control Word Register are selected with address 01H, 02H, and 03H as primary addresses and 05H, 06H and 07H as fold back addresses. Normally primary addresses are used. AB BCB BDB A15...A11 RESET OUT IO/M RD WR 8 D7-D0 2 A1,A0 8255 A PPI CS PORT B PORT A PORT C 8 8 4 4 PB7-PB0 PA7-PA0 PC7-PC4 PC3-PC0 Fig.9.8 Interfacing of 8255A

Operating Modes: The three modes in which the two groups can be programmed independently are discussed below: Mode 0 (Basic Input/output) This mode provides simple input/output operation for three ports. After the mode is set, data is simply read from or written to the ports. The mode-0 functional definitions are, 1. If both the groups are programmed in mode-0, it consists of two 8-bit ports and two 4-bit ports. 2. Any port can be programmed either as input or output. 3. 16 different combinations of input/output configurations are possible. All ports may be input or all ports may be output or few input and few output. 4. The data written to output ports are latched to output latch. 5. Inputs are not latched but only buffers are provided. 6. Writing to the mode register resets any bits that are output. The default output of the port bits programmed in output mode is low. Example-1: Configure 8255A in mode-0 with different ports in input output mode as below: PORT A: Input; PORT B: Output PCU: Output; PCL: Input The control word to programme 8255A as above will be 1 0 0 1 0 0 01 2 = 91 H

The control word will be outputted to control word register having add 03H.The relevant instruction will be follows: MVI A, 91H OUT 03H Example-2: In the above example, write instructions to set bit PC 6 High through bit set/reset. Since PCU is configured in output mode, therefore, only the bits of the PORT C upper, configured in output mode, can be set/reset. The relevant bit set/reset control word to set PC 6 will be 0 x x x 1 1 0 1 = 0DH The sequence of instructions to set the port bit PC 6 will be MVI A, 0DH OUT 03H Example-3: Let us interface ADC0809 to microprocessor using 8255A. ADC 0809 is a unipolar, 8-bit, eight channel analog to digital conversion chip based on successive approximation. The maximum clock frequency input to ADC is 500 KHz for reliable operation. ADD C ADD B ADD A Channel 0 0 0 IN 0 0 0 1 IN 1 0 1 0 IN 2 0 1 1 IN 3 1 0 0 IN 4 1 0 1 IN 5 1 1 0 IN 6 1 1 1 IN 7

The 8 channels are IN 0 to IN 7. At a time only one channel is selected for data conversion. The desired channel is selected using three address limes ADDA, ADDB & ADD C and latching the address using address latch enable signal (ALE). The two reference voltage signals V ref (+) and V ref (-) are used to decide the range of input voltage. They are normally connected to +5V and GND for maximum input voltage range. To convent any analog voltage into digital form, first the channel is selected by issuing the 3-bit address and issuing ALE signal. After that SOC is issued to start the conversion (Low High Low). The EOC becomes low when conversion starts and when conversion is over, the EOC signal becomes high again. Then the data in digital from can be read at any time by making OE signal high. The process of conversion is shown in fig.9.9. ALE SOC EOC OE D7-D0 Digital Equivalent Fig.9.9 Timing Waveform during Conversion for ADC0809

Instead of generating ALE and SOC separately using two different bits of a port, ALE & SOC pins are connected together and a single bit is made (Low High Low). When the signal is High, the address available on address lines is latched. The conversion process starts at the trailing edge of SOC. Therefore to reduce the hardware, OE is connected to EOC. Therefore as soon as EOC is 1, OE becomes 1 and data can be inputted. +5V Vref+ Vcc PORT A PA7-PA0 8 D7-D0 IN0 Vin PORT C PC0 PC4 PC1 SOC ALE EOC OE ADD A ADD B ADD C TM1 GATE OUT CLK CLK 1.5 MHz Vref- GND Fig.9.10 Interfacing of ADC0809 using 8255A in Mode 0 To interface 0809, 8255 Group A, programmed in mode 0, is used. The CLK is generated using TM 1 of 8253 programmed in square wave mode which divides the input CLK of 1.5 MHz by 3 to generate 500 khz clock. The TM 1 is triggered via PC 1. (This chip will be discussed in next module). One may use any other clock source. The necessary control signals are generate using PORT C. The

interfacing circuit is shown in fig.9.10. The flowchart for ADC is given in fig.911. START Initialize 8255A PPI and 8253 PIT Load TM1 with 03H and Trigger via PC1 Issue Start of Conversion Pulse via PC0 Input End of Conversion Signal via PC4 Is Conversion Over? No Yes Read Data via PORT A STOP Fig.9.11 Flow Chart of ADC0809 Interfaced using 8255A in Mode 0