A walk through interrupts on the PPC 823

Slides:



Advertisements
Similar presentations
A look at interrupts What are interrupts and why are they needed.
Advertisements

8085 Interrupts LAKSHMI.B.E.1. Interrupts  Interrupt is a process where an external device can get the attention of the microprocessor. ◦ The process.
68HC11 Polling and Interrupts
EET 2261 Unit 9 Interrupts  Read Almy, Chapters 17 – 19.  Homework #9 and Lab #9 due next week.  Quiz next week.
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 7: Exceptions and Interrupts September 27, 2011.
A look at interrupts What are interrupts and why are they needed.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
The 8051 Microcontroller and Embedded Systems
INTERRUPTS PROGRAMMING
Introduction to Embedded Systems
COMP201 Computer Systems Exceptions and Interrupts.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Interrupts Stopping program flow to execute a special piece of code that handles an event Definition and classification PowerPC interrupt structure Precise.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 6: Interrupts Sept. 19 th 2013 Slides developed in part by.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 6: Interrupts January 30 th Slides developed in part by Prof.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Lecture 3 CSE 341 – Microprocessors Lecture 3 Md. Omar Faruqe UB 1228
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
Chapter 11 INTERRUPTS PROGRAMMING
Interrupts and signals
8085 Interrupts LAKSHMI.B.E..
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
The process starts from the I/O device
MIPS I/O and Interrupt.
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
Timer and Interrupts.
Computer Architecture
Interrupts In 8085 and 8086.
Unit - 1 Interrupts M.Brindha AP/EIE
Interrupts.
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
Chapter 10 And, Finally... The Stack
Dr. Michael Nasief Lecture 2
8086/8088 Hardware Specifications
8085 Interrupts.
Interrupt.
ECE 3430 – Intro to Microcomputer Systems
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.
Chapter 10 The Stack.
Advisor: Prof. Gandhi Puvvada
* * * * * * * 8051 Interrupts Programming.
Advisor: Prof. Gandhi Puvvada
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.
ENCM K Interrupts Theory and Practice
EET 2261 Unit 9 Interrupts Read Almy, Chapters 17 – 19.
COMPUTER PERIPHERALS AND INTERFACES
Architectural Support for OS
Interrupts.
Chapter 10 And, Finally... The Stack
Interrupt.
Interrupts 1/18/2019.
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Embedded System Development Lecture 7 2/21/2007
ECE 3430 – Intro to Microcomputer Systems
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
COMP3221: Microprocessors and Embedded Systems
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Presentation transcript:

A walk through interrupts on the PPC 823

Review – software viewpoint Interrupt occurs Processor saves limited state SRR0 – Next instruction to be executed when return from interrupt. SRR1 – Copy of MSR MSR is modified. Most important is EE bit=0 Processor jumps to the Interrupt Service Routine. ISR executes. Needs to save state so that it can put it all back before return from interrupt. May enable nested interrupts Does its thing  This is a big step… Restores state (disables nested interrupts if needed!) Return from interrupt (rfi instruction)

Details of software viewpoint How does the ISR know where to branch to? Table 7.1 indicates the low 5-hex digits of the address. The IP bit of the MSR (page 6-21) determines the high order bits. But even then, we need to do different things for different interrupt lines. SIVEC…

So how do we run the right code? SIVEC holds an 8 bit code which indicates which interrupt was the highest level external interrupt. Page 12-6. This can be used to figure out which “line” is the highest priority interrupt. While a switch statement would work, it is fairly ugly. Rather we use an indirect branch. Sample code is on page 12-11

Ok, so we’ve got the software mostly down… Some issues Changing the MSR could be important. We need to be sure we save everything we change. Don’t forget the condition register. Not sure what to do to stop the interrupt We need to clear something somewhere… So onto hardware.

MPC 823 -- hardware So how about from the hardware side? We’ve already seen one special-purpose register (SIVEC) It turns out there are a few more SIPEND is a vector of pending interrupts SIMASK is a vector that allows one to mask out certain interrupts. SIEL toggles the IRQ interrupts from edge to level We also have to understand what the different souces of interrupts might do. Let’s start there.

“External” Interrupts There are two basic types of external interrupts Those generated off-chip and those generated on-chip. Hardware devices you generate on the FPGA will all be off-chip. These use the IRQ interrupts Timers and other on-chip devices use the LVL interrupts. Each has somewhat different functionality.

Clearing interrupts Every interrupt does/should have a single point of reset. Think of it this way. Somewhere out there is something that is saying “this interrupt is occurring—the device is asking for service” The ISR needs some way to clear this and indicate that the device is being dealt with. Doing so remove the interrupt from SIPEND.

Clearing LVL interrupts. Always level-sensitive. Probably why named the way they are. Interrupt source is either CIPR (16-497) or an event bit associated with the interrupt. You do NOT clear them by writing to SIPEND!

Clearing IRQ interrupts If the IRQ is edge-triggered the SIPEND register stores the fact that an interrupt has occurred. The interrupt is cleared at SIPEND in this case If the IRQ is level-sensitive the interrupt is cleared by direct communication to the I/O device. When designing I/O devices that generate interrupts keep these things in mind.

Interrupt related registers We’ve seen SIVEC but there are more…

SIEL System Interrupt Edge/Level Determines if IRQ interrupts are level or edge sensitive. Also controls if IRQ can wake the processor from low-power mode.

SIPEND Keeps track of the external interrupts that are PENDing. Used to clear edge-triggered IRQ interrupts. Can be used rather than SIVEC to figure out what interrupt to service if you really really want to.

SIMASK Allows certain interrupts to be ignored or masked out. Is ANDed with SIPEND to determine which interrupts are allowed to interrupt the core and set their value in SIVEC

PPC: Graphical view Core Flip- Flops SIVEC mux SIPEND IRQ#[0:7] 8 8 IRQ#[0:7] 16 16 16 8 Core LVL[0:7] IRQ (core) 8 SIMASK SIEL