university of tehran 1 microprocessor system design programmable interrupt controller omid fatemi

Download University of Tehran 1 Microprocessor System Design Programmable Interrupt Controller Omid Fatemi

If you can't read please download the document

Upload: kristina-gilbert

Post on 18-Jan-2018

233 views

Category:

Documents


3 download

DESCRIPTION

University of Tehran 3 What is Interrupt

TRANSCRIPT

University of Tehran 1 Microprocessor System Design Programmable Interrupt Controller Omid Fatemi University of Tehran 2 Outline Interrupts in PC Interrupts and calls 8259 PIC Programming 8259 Interfacing 8259 in PC University of Tehran 3 What is Interrupt University of Tehran /88 Interrupts 256 Interrupts. Types 00 . FF. Type is provided in a specified timing. University of Tehran 5 Interrupt Vector Table University of Tehran 6 Answering an Interrupt Save status FR, IP, CS Service the interrupt Interrupt service routing (ISR) or Interrupt handler Based on Interrupt vector number From Interrupt vector table Four bytes for every interrupt: CS:IP Return to original position by IRET University of Tehran 7 Difference with Call 1.CALL FAR can jump to any location (1M range) 2.Hardware interrupts can come at any time. 3.Interrupts are maskable. 4.After CALL only CS:IP is saved 5.End of routine: RETF vs. IRET. University of Tehran 8 Interrupt Categories Hardware interrupts: Only 3 pin, but how 256 interrupt? INTR (in), NMI (in), and INTA (out) INTR can be masked by CLI / STI Active high. 80x86 finished instruction. Push FR, CS, IP NMI: INT 02. Software interrupts INT nn Example: INT 21H (DOS functions) University of Tehran 9 Interrupt and Flags University of Tehran 10 Predefined Interrupts INT 00 (divide error) INT 01 (single step) Set Trap flag (how?) PUSHF, POP AX, Trace in debug INT 02 (NMI) INT 03 (breakpoint) INT 04 (signed number overflow) INT) instruction Examine Interrupt vector table. Examine INT 12H (size of conventional RAM in AX) University of Tehran University of Tehran 12 Control Word (initialization) University of Tehran 13 ICW1, ICW2 University of Tehran 14 ICW3, ICW4 University of Tehran 15 Example University of Tehran 16 Masking and Prioritization OCW (operation command word) University of Tehran 17 Programming OCWs University of Tehran 18 OCW3 University of Tehran in PC XT ICW1: 13H ICW2: 08H ICW3: 09H University of Tehran 20 Interrupt Sources in PC University of Tehran 21 Sources of NMI University of Tehran s in AT University of Tehran 23 IRQ9 Instead of IRQ2 University of Tehran 24 Interrupts (Summary) University of Tehran 25 Edge Triggered and Interrupt Sharing Level triggered mode: IRQ line should be brought down before EOI. Edge triggered mode: noise on IRQ lines might cause false interrupts. New computer and busses. Level triggered. Interrupt sharing. University of Tehran 26 Problems and HW7 hDue Saturday 24 Khordad (in class) 30, 31, 40, 53, 61 Page 226 Other problems: 1, 2, 18, 21, 22 30, 31, 40, 41 53, 61, 68, 75 Section 6.5: examples 7, 8, 9