Lecture 23: LM3S9B96 Microcontroller - Interrupts.

Slides:



Advertisements
Similar presentations
ECE 353 Introduction to Microprocessor Systems
Advertisements

Lab III Real-Time Embedded Operating System for a SoC System.
Exceptions. Exception Types Exception Handling Vectoring Interrupts Interrupt Handlers Interrupt Priorities Interrupt applications 6-2.
Cortex-M3 Exceptions and Interrupts
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes.
Refer to Chapter 6, 9 in the reference book
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
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.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
1 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
MS_uC / dnd / V VIC - Vectored Interrupts Programming Microcontroller VIC – Vectored interrupt controller Autumn term K Byte Burst Flash.
COMP3221 lec28-exception-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 28: Exceptions & Interrupts - II
The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – System Control Refer to Chapter 6 in the reference book “Stellaris® LM3S9B96 Microcontroller.
Lecture 09: Interrupts & 8259.
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
Exception and Interrupt Handling
Introduction to Embedded Systems
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Lecture 29: LM3S9B96 Microcontroller – Pulse Width Modulator (PWM)
CORTEX-M0 Structure Discussion 2 – Core Peripherals
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
Lecture 25: LM3S9B96 Microcontroller – Watchdog Timer.
7/23 Interrupt Controller and Edge Port in Coldfire Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee.
Interrupt.
Microprocessors 1 MCS-51 Interrupts.
Lecture 09: Interrupts & The 80x86 IBM PC and Compatible Computers Chapter 14 Interrupts and the 8259 Chip.
ARM Cortex-M0 August 23, 2012 Paul Nickelsberg Orchid Technologies Engineering and Consulting, Inc. CORTEX-M0 Structure Discussion.
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
NS Training Hardware Traffic Flow Note: Traffic direction in the 1284 is classified as either forward or reverse. The forward direction is.
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
MICRO-CONTROLLER MOTOROLA HCS12 Interrupts Mechatronics Department Faculty of Engineering Ain Shams University.
Lecture 22: LM3S9B96 Microcontroller – SysTick and General-Purpose Timers.
9/20/6Lecture 3 - Instruction Set - Al1 Exception Handling.
Renesas Electronics America Inc. © 2011 Renesas Electronics America Inc. All rights reserved. RX Interrupt Control Unit (ICU) Ver
The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – Watchdog Timers Refer to Chapter 11 in the reference book “Stellaris® LM3S9B96 Microcontroller.
The 8051 Microcontroller Chapter 6 INTERRUPTS. 2/29 Interrupt is the occurrence of a condition an event that causes a temporary suspension of a program.
The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – Interrupts Refer to Chapter 4 in the reference book “Stellaris® LM3S9B96 Microcontroller - DATA.
INTERRUPTS. Topics to be discussed  8088/86 Hardware Interrupts pins 8088/86 Hardware Interrupts pins   Pin description Pin description.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Cortex-M3 Exceptions RTLAB. Hyeonggon Jo.  Exceptions Exception types & priority Abort model SVC and PendSV  Interrupt operation Pre-emption & Exit.
INSTITUTE: INSTITUTE:PARUL INSTITUTE OF TECHNOLOGY BRANCH : BRANCH :B.E. E.C.5 TH SEM. SUBJECT:MICROCONTROLLER & INTERFACING TOPIC:AVR INTTRUPT TOPIC:AVR.
Interrupt 마이크로 프로세서 (Micro Processor) 2015년 2학기 충북대학교 전자공학과 박 찬식
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
1 The LPC1768 Architecture (with focus on Cortex-M3)
ARM Cortex M3 & M4 Chapter 4 - Architecture
Interrupt and Exception Programming
Microprocessor and Assembly Language
Microprocessor Systems Design I
Refer to Chapter 7, 8, 9 in the reference book
Mon. Oct 2 Announcements Quiz Postponed to Wednesday – still only on 2.a + 2.b Video lecture for 2.a posted Lab 6 experiment extension You must come to.
Timer and Interrupts.
Refer to Chapter 10 in the reference book
ARM Cortex-M3 RTLAB 박 유 진.
Interrupts In 8085 and 8086.
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
Chapter 10 And, Finally... The Stack
Interrupt and Exception Programming
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.
Interrupt and Exception Programming
YOVI 2008 Core Interrupt Controller (INTC)
Interrupt and Exception Programming
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /20/2018.
8259 PROGRAMMABLE INTERRUPT CONTROLLER
Interrupt and Exception Programming
8259 Programmable Interrupt Controller
Lecture 9: TI MSP430 Interrupts & Low Power Modes
8259 PROGRAMMABLE INTERRUPT CONTROLLER
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

Lecture 23: LM3S9B96 Microcontroller - Interrupts

Stellaris® LM3S9B96 Microcontroller Data Sheet Chapter 4 Interrupts

ARM Cortex-M3 processor & NVIC zAll exceptions are prioritized and handled in Handler Mode zThe processor state is automatically stored to the stack on an exception and automatically restored from the stack at the end of the Interrupt Service Routine zThe vector is fetched in parallel to the state saving, enabling efficient interrupt entry zSupport tail-chaining which enables back-to-back interrupts to be performed without the overhead of state saving and restoration

ARM Cortex-M3 processor & NVIC zEight priority levels on seven exceptions and 53 interrupts zThe highest user-programmable priority (0) is treated as fourth priority, after a Reset, Non-Maskable Interrupt (NMI), and a Hard Fault, in that order. zThe default priority is 0 for all the programmable priorities. zIf the same priority level is assigned to two or more interrupts, their hardware priority (implementation related) determines the order in which the processor activates them. zThe lower position number, the higher priority zFor example, if both GPIO Port A and GPIO Port B are priority level 1, then GPIO Port A has higher priority.

Exceptions

Interrupts

How to configure an Interrupt? zEnable the peripheral (setup the RCGCn) zConfigure the interrupt type for the peripheral zEnable the interrupt yEnable the interrupt in the peripheral yEnable the interrupt in the NVIC zWrite an interrupt service routine (ISR) yIdentify the interrupt source yClear the interrupt request zRegister the ISR in the interrupt vector table

Example: Setting up Interrupt for GPIO

Register Description: GPIOIS zThe GPIOIS register is the interrupt sense register ySetting a bit configures the corresponding pin to detect levels yclearing a bit configures the corresponding pin to detect edges yAll bits are cleared by a reset

Register Description: GPIOIBE zThe GPIOIBE register allows both edges to cause interrupts ySetting a bit configures the corresponding pin to detect both rising and falling edges yclearing a bit configures the pin to be controlled by the GPIOIEV register yAll bits are cleared by a reset

Register Description: GPIOIEV zThe GPIOIEV register is the interrupt event register ySetting a bit configures the corresponding pin to detect rising edges or high levels yclearing a bit configures the pin to detect falling edges or low levels yAll bits are cleared by a reset

Register Description: GPIOIM zThe GPIOIM register is the interrupt mask register ySetting a bit allows interrupts that are generated by the corresponding pin to be sent to the interrupt controller on the combined interrupt signal yClearing a bit prevents an interrupt on the corresponding pin from being sent to the interrupt controller yAll bits are cleared by a reset

Register Description: GPIORIS zThe GPIORIS register is the raw interrupt status register yA bit in this register is set when an interrupt condition occurs on the corresponding GPIO pin yA bit in this register can be cleared by writing a 1 to the corresponding bit in the GPIO Interrupt Clear (GPIOICR) register

Register Description: GPIOMIS zThe GPIOMIS register is the masked interrupt status register yA bit in this register is set when the corresponding interrupt has triggered an interrupt to the interrupt controller yIf a bit is clear, either no interrupt has been generated, or the interrupt is masked

Register Description: GPIOICR zThe GPIOICR register is the interrupt clear register yWriting a 1 to a bit in this register clears the corresponding interrupt bit in the GPIORIS and GPIOMIS registers

Setting up NVIC zThe LM3S9B96 microcontroller supports 53 interrupts with eight priority levels yThe NVIC maintains knowledge of the stacked (nested) interrupts to enable tail-chaining of interrupts yYou can only fully access the NVIC from privileged mode

Setting up NVIC 1. Set up the priority group register (group 0 by default). 2. Setup the hard fault and NMI handlers to a new vector table location if vector table relocation is required. 3. Set up the Vector Table Offset register if needed. 4. Set up the interrupt vector for the interrupt : [read the Vector Table Offset register and] calculate the correct memory location for the interrupt handler. 5. Set up the priority level for the interrupt. 6. Enable the interrupt.

Setup the Priority Group ;Application Interrupt and Reset Control Register LDR R0, =0xE000ED0C ; Priority Group 5 (2/6) LDR R1, =0x05FA0500 ; Set Priority Group STR R1, [R0]

Setup the Interrupt Vector ; Get starting address of IRQ#7 handler LDR R0, =IRQ7_Handler ; Vector Table Offset Register LDR R1, =0xE000ED08 LDR R1, [R1] ; Calculate IRQ#7 handler vector address ADD R1, R1, #(4*(7+16)) ; Setup vector for IRQ#7 STR R0, [R1]

Setup the Interrupt Priority ; External IRQ priority base LDR R0, =0xE000E400 ; Set IRQ#7 priority to 0xC0 MOV R1, #0xC0 STRB R1, [R0,#7]

Enable the interrupt ; SETEN register LDR R0, =0xE000E100 ; IRQ#7 enable bit (value 0x1 shifted by 7 bits) MOV R1, #(1<<7) ; Enable the interrupt STR R1, [R0]