ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

1 ELE271 Mon. April 7, Review LPM -Morse Code Lab -.ref and.def -Multiplication, shift.
Interrupts, Low Power Modes and Timer A (Chapters 6 & 8)
Chung-Ta King National Tsing Hua University
Chung-Ta King National Tsing Hua University
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
I/O Unit.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
Notes on the ez430-RF2500. Sources
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Architecture of the 8051 INTERNAL DATA BUS Oscillator & Timing Programmable I/O (32 Pins) 80C51 CPU 64K byte Expansion Control Serial I/O 4K Program Memory.
INTERRUPTS PROGRAMMING
Chung-Ta King National Tsing Hua University
LAB 7: WDT+ and Low-Power Optimization
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
MSP430 Mixed Signal Microcontroller – Parte 2 Afonso Ferreira Miguel Source: slau056d – Texas instruments.
MICROPROCESSOR INPUT/OUTPUT
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 11: TI MSP430 Timers Compare Modes
Lecture 11 Low Power Modes & Watchdog Timers
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
ECE 447 Fall 2009 Lecture 7: MSP430 Polling and Interrupts.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
Week 7 Low-Power Modes MSP430 Teaching Materials Hacettepe University Copyright 2009 Texas Instruments All Rights Reserved.
MICRO-CONTROLLER MOTOROLA HCS12 Interrupts Mechatronics Department Faculty of Engineering Ain Shams University.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Polled IO versus Interrupt Driven IO
SGDRS Software System Design Justin A. King WWU EET Senior project 2013.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
INSTITUTE: INSTITUTE:PARUL INSTITUTE OF TECHNOLOGY BRANCH : BRANCH :B.E. E.C.5 TH SEM. SUBJECT:MICROCONTROLLER & INTERFACING TOPIC:AVR INTTRUPT TOPIC:AVR.
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
UNIT 2. CPUXV2 20-bit addressing User-definable Boot Strap Loader RAM starts at 0x1C00 Beginning of MAIN flash moves according to RAM Vector table starts.
Introduction Why low power?
Introduction Why low power?
Lecture 8: TI MSP430 Interrupts, ISRs
HCS12 Exceptions Maskable Interrupts
CS4101 嵌入式系統概論 Interrupts Prof. Chung-Ta King
Lesson Outline Interrupts Admin Assignment #9 due next lesson
CS4101 Introduction to Embedded Systems Lab 6: Low-Power Optimization
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
Chapter 6 General Purpose Input/Output
UNIT – Microcontroller.
Computer Architecture
Prof. Chung-Ta King Department of Computer Science
ECE 3430 – Intro to Microcomputer Systems
Interrupts In 8085 and 8086.
Interrupt Source: under
Subject Name: Microcontroller Subject Code: 10ES42
CS4101 Introduction to Embedded Systems Lab 4: Interrupt
* * * * * * * 8051 Interrupts Programming.
Lecture 18 Interrupt 동국대학교 홍유표.
ECE 3430 – Intro to Microcomputer Systems
Lecture 9: TI MSP430 Interrupts & Low Power Modes
Interrupts.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Prof. Chung-Ta King Department of Computer Science
MSP430 Clock System and Timer
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes

Last Lecture: MSP430 Interrupt Class Exercise Write a program that collects samples from input Port 2. A signal line that indicates a new data value is available is connected to pin P1.0. Use an interrupt to detect a rising edge on the P1.0. When an interrupt is triggered the value on Port2 should be stored into a byte array of 32 entries. When 32 samples have been collected, P1.7 should be driven as an output high to indicate the memory is “full”

Lecture 8 Example – Part I #include "io430.h" #include "intrinsics.h" char entries[32];// Array for storing input from Port 2 (Global Variable) char index;// Index within byte array for Port 2 (Global Variable) void main( void ) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer to prevent time out reset P1DIR = BIT7; // set p1.7 to output P1IE = BIT0; // enable interrupts for p1.0 (default rising edge) __enable_interrupt(); // enable global interrupts index = 0; // initialize the indexer to the beginning of the array for (;;) { __low_power_mode_4(); // go to low power mode }

Lecture 8 Example – Part II // In the same file as Part I #pragma vector = PORT1_VECTOR __interrupt void p1_isr() { if (!(P1OUT & BIT7)) // Check if Memory is full { entries[index] = P2IN; // store the value on the data port index++; // increment the indexer if (index >= 32) { P1OUT |= BIT7; // set p1.7 high to signal full array }

ECE447: MSP430 Non-Maskable Interrupts An interrupt that cannot be disabled is typically referred to as nonmaskable Most interrupts in the MSP430 are masked by the GIE bit in the SR and individual control bits. Some interrupts are not controlled by the GIE, and sometimes referred to as nonmaskable interupts. However in the MSP430, all interrupts have some bits to be set in order to enable them, even if not masked by the GIE bit in the SR. All nonmaskable interrupts share a single interrupt vector.

ECE447: MSP430 Handling Interrupts that share an Interrupt Vector ISR must first identify the source of the interrupt Service the interrupt and clear as necessary for the source

ECE447: Low Power Modes The TI MSP430 has four power mode/levels. Each has different characteristics for: –Memory state –Instruction Execution state –IO state –Timer/Clock state The MSP430 is highly optimized for low power, further enabled by the proper usage of the low power modes of the device.

ECE447: Low Power Modes - Active Mode All clocks of the MSP430 are active MSP430 starts up in this mode, and enters this mode when an interrupt is detected Only mode where instructions are executing. Current can range from 200 to 300 µA

ECE447: Low Power Modes - LPM0 LPM0 has the CPU and MCLK disabled. Used in cases where active peripherals need a high speed SMCLK. Current is approximately 85 µA

ECE447: Low Power Modes - LPM3 CPU, MCLK, SMCLK, and DCO are disabled ACLK remains active. This is the standard low power mode when the MSP430 must awaken itself at regular time intervals, and therefore needs a slow clock. If the RTC is to be maintained this is the necessary low power mode. Current is approximately 1 µA

ECE447: Low Power Modes - LPM4 CPU and all clocks are disabled The MSP430 can only awaken from and external signal. The mode is know as RAM retention mode Current is approximately 0.1 µA

ECE447: Waking from an LPM (Interrupt Handling) An interrupt is necessary to exit a LPM. The MCLK and CPU are started automatically to allow the CPU to service the interrupt. Since the SR is cleared when an interrupt occurs it is necessary to modify the SR if you wish to return to normal operation after the interrupt service routine exits. If all processing necessary for service is completed in the interrupt the CPU will return to the low power mode upon exit.

ECE447: Returning to the Main Function from a LPM To return the Main function after an interrupt wakes the MSP430 from a LPM you must: –Clear all the LPM bits in the SAVED value of SR on the stack. –In C an intrinsic function __low_power_mode_off_on_exit() handles this for you. –In Assembly the programmer must take this burden directly. (The SP will be pointing at the SR on the stack upon entry to the ISR) Upon exit the modified SR will be restored and normal operation in Active mode will resume.

ECE447: Class Exercise Write a C program that initializes an interrupt on change of input pin P1.4. When the interrupt occurs the input on P2.0-1 will be inverted and output on P When waiting for the interrupt to occur the MSP430 should be in the appropriate LPM that will allow the output to be maintained with the least power consumption.