The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – Interrupts Refer to Chapter 4 in the reference book “Stellaris® LM3S9B96 Microcontroller - DATA.

Slides:



Advertisements
Similar presentations
ECE 353 Introduction to Microprocessor Systems
Advertisements

Interrupts Professor Yasser Kadah –
Lab III Real-Time Embedded Operating System for a SoC System.
Interrupts, Low Power Modes and Timer A (Chapters 6 & 8)
Programming Microcontroller
Cortex-M3 Exceptions and Interrupts
EET 2261 Unit 9 Interrupts  Read Almy, Chapters 17 – 19.  Homework #9 and Lab #9 due next week.  Quiz next week.
Refer to Chapter 6, 9 in the reference book
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
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.
The Cortex-M3 Embedded Systems: Cortex-M3 Exceptions and Interrupts Refer to Chapter 7, 8, 9 in the reference book “The Definitive Guide the ARM Cortex-M3”
GURSHARAN SINGH TATLA PIN DIAGRAM OF 8085 GURSHARAN SINGH TATLA
The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – System Control Refer to Chapter 6 in the reference book “Stellaris® LM3S9B96 Microcontroller.
INTERRUPTS PROGRAMMING
Cortex-M3 Debugging System
EEE527 Embedded Systems Lecture 8: Practical Interrupts Ian McCrumRoom 5B18, Tel: voice mail on 6 th ring Web site:
Exception and Interrupt Handling
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Lecture 23: LM3S9B96 Microcontroller - Interrupts.
CORTEX-M0 Structure Discussion 2 – Core Peripherals
MSP430 Mixed Signal Microcontroller – Parte 2 Afonso Ferreira Miguel Source: slau056d – Texas instruments.
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
PIC16F877 ISR Points to note Interrupt Triggers –Individual interrupt flag bits are set, regardless of the status of their corresponding mask bit, PEIE.
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.
Microprocessors 1 MCS-51 Interrupts.
Lecture 8 Interrupts. 2  Introduction  Interrupt organization  Interrupt summary  Enabling and disabling interrupts  Interrupt priority  Interrupt.
1 General Purpose and Alternate Function I/O (GPIO and AFIO)
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – Pulse Width Modulator (PWM) Refer to Chapter 21 in the reference book “Stellaris® LM3S9B96 Microcontroller.
NS Training Hardware Traffic Flow Note: Traffic direction in the 1284 is classified as either forward or reverse. The forward direction is.
Chapter 5 - Interrupts.
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
Lecture 22: LM3S9B96 Microcontroller – SysTick and General-Purpose Timers.
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.
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학기 충북대학교 전자공학과 박 찬식
Exceptions and Interrupts Chap 7, 8 Tae-min Hwang.
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)
A walk through interrupts on the PPC 823
-Low Power and System Control Features
Interrupt and Exception Programming
Processor States normal exception
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
Refer to Chapter 7, 8, 9 in the reference book
Timer and Interrupts.
Refer to Chapter 5 in the reference book
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.
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:
8259-programmable interrupt controller
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)
* * * * * * * 8051 Interrupts Programming.
Lecture 8 Interrupts.
Interrupt and Exception Programming
Interrupt and Exception Programming
Interrupt and Exception Programming
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – Interrupts Refer to Chapter 4 in the reference book “Stellaris® LM3S9B96 Microcontroller - DATA SHEET”

z Exceptions are numbered 1 to 15 for system exceptions and the rest 240 for external interrupt inputs.(Total 256 entries in vector table.) zIn LM3S9B96, 10 system exceptions and 53 interrupts z Most of the exceptions have programmable priority, and a few have fixed priority. zReset, NMI, and Hard Fault have fixed priorities of -3, -2, and -1, respectively zEight user programmable priority levels; 0 is the highest and the default priority is 0 for all the programmable priorities z3-bit priority registers are implemented for all the programmable priorities Exceptions

List of Exceptions

Setup Exceptions at NVIC

z 8 exception priorities can be further grouped defined by the Application Interrupt and Reset Control (APINT) register z Only the group priority determines preemption of interrupt exceptions z If multiple pending interrupts have the same group priority, the subpriority field determines the order in which they are processed z If multiple pending interrupts have the same group priority and subpriority, the interrupt with the lowest IRQ number is processed first Exception Priorities

Application Interrupt and Reset Control (APINT), offset 0xD0C zProvides priority grouping control, endian status for data accesses, and reset control of the system; accessed from privileged mode

z For system exceptions, priorities are set with the NVIC System Handler Priority n (SYSPRIn) registers System Handler Priority 1 (SYSPRI1), offset 0xD18 System Handler Priority 2 (SYSPRI2), offset 0xD1C System Handler Priority 3 (SYSPRI3), offset 0xD20 Set Exception Priorities

z For interrupts, priorities are set with the NVIC Interrupt Priority n (PRIn) registers Interrupt 0-3 Priority (PRI0), offset 0x400 … Interrupt Priority (PRI13), offset 0x434 Set Exception Priorities …

z For system exceptions, the SYSHNDCTRL register enables the system handlers, and indicates the pending and active status of the system handlers; The INCTRL register provides a set-pending bit for the NMI exception, and set-pending and clear-pending bits for the PendSV and SysTick exceptions. System Handler Control and State (SYSHNDCTRL), offset 0xD24 Interrupt Control and State (INTCTRL), offset 0xD04 Enable and Disable Exceptions

z For interrupts, the ENn register enable interrupts and show which interrupts are enabled. Interrupt 0-31 Set Enable (EN0), offset 0x100 Interrupt Set Enable (EN1), offset 0x104 Enable and Disable Exceptions

z For interrupts, the DISn register disable interrupts and show which interrupts are disabled. Interrupt 0-31 Clear Enable (DIS0), offset 0x180 Interrupt Clear Enable (DIS1), offset 0x184 Enable and Disable Exceptions

z If an interrupt takes place but cannot be executed immediately, it will be pended. yThe interrupt-pending status can be accessed through the Interrupt Set Pending (PEND) and Interrupt Clear Pending (UNPEND) registers. yUser can set the certain bit of PEND to enter its handler by software. yFor each interrupt the NVIC has a PEND and a UNPEND register. yPEND0 and PEND1: 0xE000E200-0xE000E204 yUNPEND0 and UNPEND1: 0xE000E280-0xE000E284 z Similarly, for each interrupt the NVIC has a Active status register. yInterrupt 0-31 Active Bit (ACTIVE0), offset 0x300 yInterrupt Active Bit (ACTIVE1), offset 0x304 Interrupt Pending and Active Status

z Software interrupts can be generated by using: 1. The PEND register 2. The Software Trigger Interrupt Register (STIR) Software Trigger Interrupt Register (0xE000EF00) z System exceptions (NMI, faults, PendSV, and so on) cannot be pended using STIR. BitsNameTypeReset ValueDescription 8:0INTIDW–Writing the interrupt number sets the pending bit of the interrupt; for example, write 0 to pend external interrupt #0 Software Interrupts

Setup Exceptions at a Peripheral

Example: Setting up Interrupt for GPIO

Define Interrupt Conditions zGPIO Interrupt Sense (GPIOIS) register: setting a bit, detect levels on the pin; otherwise, detect edges zGPIO Interrupt Both Edges (GPIOIBE) register: when GPIOIS is set to detect edges, setting a bit in GPIOIBE enables the pin to detect both rising and falling edges; otherwise, the pin is controlled by the GPIOIEV register zGPIO Interrupt Event (GPIOIEV) register: setting a bit, detect rising edges (or high levels); otherwise, detect falling edges (or low levels), depending on the settings of GPIOIS

Other Interrupt Control Registers zGPIO Interrupt Mask (GPIOIM) register: setting a bit, allows the pin to generate interrupts; otherwise, disable interrupts zGPIO Raw Interrupt Status (GPIORIS) register: A bit is set when an interrupt condition occurs on the corresponding GPIO pin; otherwise, RAZ. zGPIO Masked Interrupt Status (GPIOMIS) register: If a bit is set, the corresponding interrupt has triggered an interrupt to the interrupt controller; otherwise, either no interrupt has been generated, or the interrupt is masked zGPIO Interrupt Clear (GPIOICR) register: Writing a 1 to a bit in this register clears the corresponding interrupt bit in the GPIORIS and GPIOMIS registers

GPIO Interrupt Sense (GPIOIS), offset 0x404 The GPIOIS register is the interrupt sense register. Setting a bit in the GPIOIS register configures the corresponding pin to detect levels, while clearing a bit configures the corresponding pin to detect edges. All bits are cleared by a reset.

GPIO Interrupt Both Edges (GPIOIBE), offset 0x408 The GPIOIBE register allows both edges to cause interrupts. When the corresponding bit in the GPIOIS register (see page 320) is set to detect edges, setting a bit in the GPIOIBE register configures the corresponding pin to detect both rising and falling edges. Clearing a bit configures the pin to be controlled by the GPIOIEV register. All bits are cleared by a reset.

GPIO Interrupt Event (GPIOIEV), offset 0x40C Setting a bit in the GPIOIEV register configures the corresponding pin to detect rising edges or high levels (clearing a bit configures the pin to detect falling edges or low levels), depending on the corresponding bit value in the GPIO Interrupt Sense (GPIOIS) register. All bits are cleared by a reset.

GPIO Interrupt Mask (GPIOIM), offset 0x410 The GPIOIM register is the interrupt mask register. Setting a bit in the GPIOIM register allows interrupts that are generated by the corresponding pin to be sent to the interrupt controller on the combined interrupt signal. All bits are cleared by a reset.

GPIO Raw Interrupt Status (GPIORIS), offset 0x414 The GPIORIS register is the raw interrupt status register. A bit in this register is set when an interrupt condition occurs on the corresponding GPIO pin. A bit in this register can be cleared by writing a 1 to the corresponding bit in the GPIO Interrupt Clear (GPIOICR) register.

GPIO Masked Interrupt Status (GPIOMIS), offset 0x418 The GPIOMIS register is the masked interrupt status register. If a bit is set in this register, the corresponding interrupt has triggered an interrupt to the interrupt controller.

GPIO Interrupt Clear (GPIOICR), offset 0x41C The GPIOICR register is the interrupt clear register. Writing a 1 to a bit in this register clears the corresponding interrupt bit in the GPIORIS and GPIOMIS registers. Writing a 0 has no effect.

How to configure an Interrupt? z At the NVIC side ySet up the priority group register (group 0 by default) ySet up the priority level for the interrupt yEnable the interrupt z At the peripheral side yEnable the peripheral (setup the RCGCn) yConfigure the interrupt type for the peripheral yEnable the interrupt in the peripheral z Write an interrupt service routine (ISR) yIdentify the interrupt source yClear the interrupt request z Register the ISR in the interrupt vector table