Intel 8259A PIC EEE 365 [FALL 2014] LECTURE 21 ATANU K SAHA BRAC UNIVERSITY.

Slides:



Advertisements
Similar presentations
Microprocessor Systems
Advertisements

8259 Programmable Interrupt Controller
DMA Controller (8237 Programming Examples)
Interrupt Controller Introduction to 8259.
Interrupts Disclaimer: All diagrams and figures in this presentation are scanned from the book “Microprocessors and Programmed Logic” authored by Kenneth.
I/O Unit.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
1 TK2633TK Microprocessor Architecture DR MASRI AYOB.
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: internal fault (e.g.. divide by.
Interrupt Controller (Introduction to 8259)
DEEPAK.P MICROPROCESSORS AND APPLICATIONS Mr. DEEPAK P. Associate Professor ECE Department SNGCE 1.
Interrupts – (Chapter 12)
GURSHARAN SINGH TATLA PIN DIAGRAM OF 8085 GURSHARAN SINGH TATLA
Lecture 09: Interrupts & 8259.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
ELEC4601 Microprocessor systems Lab 3 Tutorial
Khaled A. Al-Utaibi  Interrupts in Microcomputer Systems  Programmable Interrupt Controllers  General Description of the 8259A.
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
UNIT-6. INTRODUCTION  POLLING  INTERRUPTS  INTERRUPT SERVICE ROUTINR(ISR)
8086 has 2 interrupt inputs 1. NMI 2. INTR For application where we have interrupts from multiple sources, use an external device called a Priority Interrupt.
Lecture 09: Interrupts & The 80x86 IBM PC and Compatible Computers Chapter 14 Interrupts and the 8259 Chip.
Interrupt Interrupt – to break the flow of speech or action of (someone) by saying or doing something (Longman dictionary)
Interrupts Useful in dealing with: The interface: Random processes;
8259A PROGRAMMABLE INTERRUPT CONTROLLER. CONTINUE…. The 8259A consist of eight data bus lines from D0-D7 The data bus is the path over which data are.
Dec Hex Bin 14 E ORG ; FOURTEEN Interrupts In x86 PC.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
PPI-8255.
Programmable Interrupt Controller (PIC)
8086 Interrupts and Interrupt Applications
14.2: x86 PC AND INTERRUPT ASSIGNMENT
ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 11.
Microprocessor System Design Programmable Interrupt Controller.
 The Programmable Interrupt Controller (PlC) functions as an overall manager in an Interrupt-Driven system. It accepts requests from the peripheral equipment,
Multiplex of Data and Address Lines in 8088 Address lines A0-A7 and Data lines D0-D7 are multiplexed in These lines are labelled as AD0-AD7. –By.
INTERRUPTS. Topics to be discussed  8088/86 Hardware Interrupts pins 8088/86 Hardware Interrupts pins   Pin description Pin description.
DEPARTMENT OF ELECTRONICS ENGINEERING
ASSEMBLY CODE EEE 365 [FALL 2014] LECTURE 24 ATANU K SAHA BRAC UNIVERSITY.
Intel 8255A PPI EEE 365 [FALL 2014] LECTURE ATANU K SAHA BRAC UNIVERSITY.
Memory Interface EEE 365 [FALL 2014] LECTURER 12 ATANU K SAHA BRAC UNIVERSITY.
1 Interrupts A Course in Microprocessor Electrical Engineering Dept. University of Indonesia.
Microprocessor Systems Design I
The process starts from the I/O device
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: Internal fault (e.g.. divide by.
Introduction to the processor and its pin configuration
Interrupts In 8085 and 8086.
Interrupts – (Chapter 12)
8259-programmable interrupt controller
Presentation On 8259 Made by Md Shabbir Hasan.
8085 Interrupts.
Programmable Interrupt Controller 8259
Programmable Interrupt Controller 8259
Interrupt.
8259A PRIORITY INTERRUPT CONTROLLER
8259 Chip The Intel 8259 is a family of Programmable Interrupt Controllers (PIC) designed and developed for use with the Intel 8085 and Intel 8086 microprocessors.
8253 Timer In software programming of 8085, it has been shown that a delay subroutine can be programmed to introduce a predefined time delay. The delay.
Interrupt Driven I/O References Text: Tanenbaum ch.1.4.3, ch Receiver Interrupt Program Example:
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /20/2018.
Interrupts Interrupt is a process where an external device can get the attention of the microprocessor. The process starts from the I/O device The process.
8259 PROGRAMMABLE INTERRUPT CONTROLLER
UNIT-V Interrupt structure of Vector interrupt table.
X1 & X2 These are also called Crystal Input Pins.
8259 Programmable Interrupt Controller
Interrupts.
8259 PROGRAMMABLE INTERRUPT CONTROLLER
CNET 315 Microprocessor & Assembly Language
Programmable Interrupt Controller (PIC)
COMP3221: Microprocessors and Embedded Systems
The Programmable Peripheral Interface (8255A)
Presentation transcript:

Intel 8259A PIC EEE 365 [FALL 2014] LECTURE 21 ATANU K SAHA BRAC UNIVERSITY

EEE 365 : MICROPROCESSOR ATANU K SAHA 2 PIC  Priority Interrupt controller  In designing an embedded system, we may need interrupts from different sources. Each of these interrupt applications requires a separate interrupt input. If we are working with an 8086, we have a problem here because the 8086 has only two interrupt inputs. If we save NMI for power failure problem, this leaves only one interrupt input for all the other applications.  For applications where we have interrupts from multiple sources, we use priority interrupt controller (PIC) to ‘funnel’ the interrupt signals into a single interrupt input on the processor. Need for a PIC BRAC UNIVERSITY

EEE 365 : MICROPROCESSOR ATANU K SAHA 3  If 8086 IF is set and the INTR input receives a high signal, then 8086 will send out two interrupt acknowledge pulses from its INTA pin to the INTA pin of an 8259A PIC. The INTA pulses tell the 8259A to send the desired interrupt type to the 8086 on the data bus.  Multiply the interrupt type it receives from 8259A by 4 to produce an address in the interrupt vector table.  Then 8086 will execute the corresponding ISR. Communication between INTR and PIC BRAC UNIVERSITY Type vector from 8259A Float ALE from 8086 AD0-AD15 Fig: 8086 interrupt-acknowledge machine cycles

EEE 365 : MICROPROCESSOR ATANU K SAHA A Internal Block Diagram BRAC UNIVERSITY

EEE 365 : MICROPROCESSOR ATANU K SAHA 5  IMR (Interrupt Mask Register) is used to disable (mask) or enable (unmask) individual interrupt inputs. Each bit in this register corresponds to the interrupt input with the same number. To unmask an input, a zero is to be sent in the corresponding bit position and to mask an input, an one is to be sent in the corresponding bit position.  IRR (Interrupt Request Register) keeps track of which interrupt inputs are asking for service. If an input has an interrupt signal on it, then the corresponding bit in the IRR will be sent.  An interrupt input signal must remain ‘HIGH’ on an IR input until the falling edge of the first INTA pulse.  ISR (Interrupt Service Register) keeps track of which interrupt inputs are currently being serviced. For each input that is currently being serviced, the corresponding bit will be set in the ISR.  The priority resolver acts as a ’judge’ that determines if and when an interrupt request on one of the IR inputs get serviced. How 8259A Works BRAC UNIVERSITY

EEE 365 : MICROPROCESSOR ATANU K SAHA 6 Program Flow BRAC UNIVERSITY STI MAINLINE INITIALIZE 8259A UNMASK IR2, IR4 STI IR4 PROCEDURE IR2 PROCEDURE EOI COMMAND IRET EOI COMMAND IRET 8259A and 8086 program flow for IR4 interrupt followed by IR2 interrupt (Response with INTR enabled in IR4 procedure)

EEE 365 : MICROPROCESSOR ATANU K SAHA 7 Program Flow BRAC UNIVERSITY 8259A and 8086 program flow for IR4 interrupt followed by IR2 interrupt (Response with INTR disabled in IR4 procedure) MAINLINE INITIALIZE 8259A UNMASK IR2, IR4 STI IR4 PROCEDURE IR2 PROCEDURE EOI COMMAND IRET EOI COMMAND IRET

EEE 365 : MICROPROCESSOR ATANU K SAHA A Cascading BRAC UNIVERSITY Each 8259A can take interrupts from eight sources. If 8086 need more interrupt to handle then we need to connect multiple 8259A PIC in cascaded (Master-Slave) form.  If a slave receives an interrupt on one of its IR input, it will send an INT signal to the IR input of the master if That IR is unmasked on the slave That IR is a higher priority than any other IR being serviced in the slave  If that input is unmasked and of highest priority at that time master will send an INT signal to 8086  8086 will send two INTA pulses to both the master and slave  The slave ignores the first acknowledgement pulse, but the master then outputs a 3-bit slave identification number in CAS pins which enables the specific slave  When the slave receives the second INTA pulse from 8086, the slave will send the interrupt type number to the 8086 on the lower 8 data bus lines.

EEE 365 : MICROPROCESSOR ATANU K SAHA A System Connection BRAC UNIVERSITY

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization and sequence BRAC UNIVERSITY 1.Initialization Command Words (ICWs): To determine the basic operating mode of the PIC. ICWs must be completed before continuing on to the second type of command word. 2.Operation Command Words (OCWs): Can be written into the PIC anytime after the ICWs are written. The OCWs customize the priority features and give the user the ability to write/read various registers. The OCWs also tell the PIC to operate in various interrupt modes. ICW1 ICW2 ICW3 ICW4 Ready to accept INTR In cascade mode Is ICW4 needed ICW1 and ICW2 are compulsory command words in the initialization sequences ICW3 and ICW4 are optional ICW3 is read only when more than one 8259 used in the system (SNGL bin in ICW1 is 0)

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization BRAC UNIVERSITY A0D7D6D5D4D3D2D1D0 0A7A6A51LTIMADISNGLIC4 D0IC4ICW4 required?0  No 1  Yes D1SNGLSingle or Cascaded0  Cascaded 1  Single D2ADIAddress interval0  4 bytes (8086) 1  8 bytes (8085) D3LTIMLevel triggered or edge triggered interrupt 0  Edge triggered 1  Level triggered D4-D7A7-A5 of interrupt vector addressNot for 8086 ICW1

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization BRAC UNIVERSITY A0D7D6D5D4D3D2D1D0 1 A15/T7A14/T6A13/T5A12/T4A11/T3A10A9IA8 ICW2 T7-T3 : Interrupt vector address for 8086/8088 A15-A8 : Interrupt vector address for MCS-80/85 T  Type Each 8259A has 8 interrupt input. So each 8259A can handle 8 types of interrupt can handle 256 types interrupt (need 8 bits to define type) If T 7 T 6 T 5 T 4 T 3 = , then it means IR0 pin of 8259A corresponds to Type 56 ( ) IR0Type 56 ( ) IR1Type 57 ( ) IR2Type 58 ( ) IR3Type 59 ( ) IR4Type 60 ( ) IR5Type 61 ( ) IR6Type 62 ( ) IR7Type 63 ( )

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization BRAC UNIVERSITY A0ModeD7D6D5D4D3D2D1D0 1 MasterS7S6S5S4S3S2S1S0 Slave00000ID3ID2ID1 Master mode1  Slave is present on that IR input 0  Direct interrupt on that IR input Slave modeID3-ID2-ID1: Slave ID number Slave ID is equal to the corresponding Master input Slave 4 on IR4 has ICW3 = 04 H ( ) ICW3 For SNGL mode ICW3 is read only. We don’t have to send ICW3

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization BRAC UNIVERSITY A0D7D6D5D4D3D2D1D0 1000SFNMBUFM/SAEOIμPM D4SFNMSpecial fully nested mode0  No 1  Yes D3BUFBuffered mode0  No 1  Yes D2M/SMaster/Slave0  Slave 1  Master D1AEOIAuto end of interrupt0  No 1  Yes D0μPMμProcessor type0  MCS-80/85 1  8086/8088 ICW4

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization BRAC UNIVERSITY A0D7D6D5D4D3D2D1D0 1M7M6M5M4M3M2M1M0 OCW1 Mn  0 : IRn unmasked (enable) Mn  1 : IRn masked (disable)

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization BRAC UNIVERSITY A0D7D6D5D4D3D2D1D0 0RSLEOI00L2L1L0 OCW2 RSLEOIAction End of interrupt (EOI) 001Non specific EOI (L 2 L 1 L 0 = 000) 011Specific EOI (Interrupt to clear given by L 2 L 1 L 0 ) Auto rotation of priorities (L 2 L 1 L 0 =000) 101Rotate priorities on non-specific EOI 100Rotate priorities in auto EOI mode set 000Rotate priorities in auto EOI mode clear Specific rotation of priorities (Lowest priority ISR =L 2 L 1 L 0 ) 111Rotate priorities on specific EOI (reset current ISR bit) 110Set priority (does not reset current ISR bit) 010No operation We have to send OCW2 within the interrupt procedure to define end of interrupt

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization BRAC UNIVERSITY A0D7D6D5D4D3D2D1D0 0xESMMSMM01PRRRIS OCW3 RRRISAction 0XNo action 10Read IR register on next RD pulse 11Read ISR register on the next RD pulse ESMMSMMAction 0XNo action 10Reset special mask 11Set special mask P : 1  Poll command, 0  No poll command

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization Example BRAC UNIVERSITY Example1: Write a program that will initialize an 8259A for the following purpose 1.Need ICW4, Edge sensitive, Single 8259A 2.IR0 will handle type 64 interrupt 3.System is 8086 based 4.IR0 and IR1 is unmasked A resides FF00 H as a port Solution: ICW1  ICW2  ICW3  read only ICW4  OCW1  ; assembly code CLI MOVAL, B MOVDX,FF00H OUTDX,AL;ICW1 MOVAL, B MOVDX,FF02H OUTDX,AL;ICW2 MOVAL, B OUTDX,AL;ICW4 MOVAL, B OUTDX,AL ;OCW1 STI

EEE 365 : MICROPROCESSOR ATANU K SAHA A Initialization Example BRAC UNIVERSITY Example2: Analyzing the following connection determine the operation and initialize the 8259A for an 8086 system to take type 64 interrupt Solution: 1.Need ICW4, Edge sensitive, Single 8259A 2.IR0 will handle type 64 interrupt 3.System is 8086 based 4.IR0 is unmasked A resides FF00 H as a port So, ICW1  ICW2  ICW3  read only ICW4  OCW1 