Lecture 5: MSP430 Interrupt

Size: px
Start display at page:

Download "Lecture 5: MSP430 Interrupt"

Transcription

1 ECE342 Intro. to Embedded Systems Lecture 5: MSP430 Interrupt Ying Tang Electrical and Computer Engineering Rowan University 1

2 How A Computer React to Inputs? Polling: the processor regularly looks at the input and react accordingly Easy to implement and debug Intensive processing If an event is rare, CPU wastes lots of time checking Processor can t go into low-power mode Interrupt: the processor is interrupted by an event Time effective Energy saving: processor can be asleep most of time Hard to debug 2

3 Polling vs. Interrupt void main (void) { int j; WDTCTL = WDTPW WDTHOLD; P1SEL =0; P2SEL=0; P1DIR =BIT0; P2DIR&=~BIT1; P2REN =BIT1; P2OUT =BIT1; P1OUT &=~(BIT0); } while (1){ j= P1IN&BIT1; if(j!=2) P1OUT^=0x01; else P1OUT &=~(BIT0); } void main(void) { WDTCTL = WDTPW WDTHOLD;// Stop watchdog timer P1SEL =0; P1DIR =BIT0; //set Port 1.0 output ---LED P1DIR &=~(BIT1); //set Port 1.1 input --- pushbutton } P1REN =BIT1;//enable pull-up resistor on P1OUT =BIT1; P1IE =BIT1;//enable the interrupt on Port 1.1 P1IES =BIT1;//set as falling edge P1IFG &=~(BIT1);//clear interrupt flag //enter LPM4 mode and enable global interrupt _BIS_SR(LPM4_bits + GIE); //Port 1 ISR #pragma vector=port1_vector _interrupt void PORT_1(void) { P1OUT ^=0x01; P1IFG &=~(BIT1); } The details are not important now, we will come back to the interrupt version later and go over it line by line, bit by bit 3

4 What is an Interrupt Interrupt is an event that will cause the CPU to stop the normal program execution and provide some service to the event Internal interrupt: generated by the hardware circuitry inside the chip and caused by software errors External interrupt: generated when the external hardware asserts an interrupt signal to the CPU Software interrupt: dealing with abnormal situations that occur during program execution, such as illegal opcodes, overflows, divide-by-zero, and underflow 4

5 Applications Coordinate I/O activities and prevent CPU from being tied up during the data transfer process. Perform time-critical operation one example is process control. Provide a graceful way to exit from the application when a software error occurred. Remind the CPU to perform routine tasks: Keep track of time of day Periodic data acquisition Task switching in a multi-tasking operating system Others 5

6 Attributes Maskability Maskable interrupts: not desirable under some situations and should be ignored by the CPU Effective only if the general interrupt enable (GIE) bit is set in the status register (SR); otherwise the interrupt is ignored Nonmaskable interrupts: can t be suppressed by clearing GIE Nonmaskable interrupts also require bits to be set/clear in special function or peripheral registers to enable/disable 6

7 Attributes Priority The MSP430 uses vectored interrupts, each of which has a distinct priority based on its address (higher address, higher priority) Each vector is associated with a unique interrupt in most cases, but some sources share a vector (e.g., TAIFG shares a vector with the capture/compare interrupts for all channels of Timer_A) The priorities are fixed in hardware and can t be changed by the user 7

8 8

9 What Happens on Interrupts Interrupt Acceptance 9

10 What Happens on Interrupts Return From Interrupt (c) After return from interrupt return address status register 10

11 Operating Modes MSP430 is designed for ultra-low-power applications w/ different operating modes The low-power modes LPM0 ~LPM4 are configured w/ the CPUOFF, OSCOFF, SCG0, and SCG1 bits in SR 11

12 Getting In/Out of LPM An enabled interrupt event wakes the MSP430 from any of the low-power modes Enter an interrupt service routine (ISR): The PC and SR are stored on the stack The CPUOFF, OSCOFF, and SCG1bits are automatically reset Return from the interrupt service routine (ISR): The SR is popped from the stack, restoring the previous operating mode The SR bits stored on the stack can be modified within the ISR returning to a different operating mode when RETI instruction is executed 12

13 Getting In/Out of LPM Code Example 13

14 Getting In/Out of LPM Code Example Enter LPM0 Mode Set CPUOFF bit in SR (see ASM code) There is no C instruction to change the value of status register as it does not know about any process registers To do the same, the compiler adds intrinsic called pseudo function to perform a specific function outside of the C language scope (e.g., bis_sr_register()) Check io430.h for such intrinsic functions Exit LPM0 Mode Clear CPUOFF bit in SR (see ASM code) 14

15 Interrupts on Port 1/Port 2 P1IE, P1IFG, P1IES If a bit in P1IES is set 0, the corresponding bit in P1IFG is set on rising edge on corresponding input pin (P1IN); otherwise, P1IFG is set on falling edge If the interrupt enable bit in P1IE is set, and global interrupts are enabled (i.e., GIE is SR), an interrupt is requested when the corresponding interrupt flag is set. P2IE, P2IFG, P2IES Port 2 interrupt is similar to Port 1 described above 15

16 Port 1 Interrupt Example Toggle Port 1.0 on each push of Port 1.1 void main(void) { WDTCTL = WDTPW WDTHOLD;// Stop watchdog timer P1SEL =0; P1DIR =BIT0; //set Port 1.0 output ---LED P1DIR &=~(BIT1); //set Port 1.1 input --- pushbutton P1REN =BIT1;//enable pull-up resistor on P1OUT =BIT1; Information for interrupt vectors can be found in msp430f5529.h } P1IE =BIT1;//enable the interrupt on Port 1.1 P1IES =BIT1;//set as falling edge P1IFG &=~(BIT1);//clear interrupt flag //enter LPM4 mode and enable global interrupt _BIS_SR(LPM4_bits + GIE); //Port 1 ISR #pragma vector=port1_vector _interrupt void PORT_1(void) { P1OUT ^=0x01; P1IFG &=~(BIT1); } 16

17 Port 1 Interrupt Example C ASM 17

18 Time A 18

19 Time A Operations 16-bit timer counter Register TAxR increments/decrements (depending on the mode of operation) with the rising edge of the clock signal TAxR can be read or written w/ software Clock sources can be chosen by setting TASSEL bits The chosen clock source can be further divided using TAIDEX bits 19

20 Time A Operations (cont.) Timer Mode Control Timer Start Timer counts when MC >{0} and the clock source is active When timer mode is either up or up/down, the timer is stopped by setting TAxCCR0=0; otherwise the timer starts when TAxCCR0= nonzero value 20

21 Time A Registers 21

22 TAxCTL Time A Control Register 22

23 TAxCCTLn Time A Capture/Compare Control 23

24 TAxCCTLn Time A Capture/Compare Control 24

25 TAxCCRn Register 25

26 TAxR Register Time A Counter Register 26

27 TAxIVRegister Time A Interrupt Vector 27

28 Time A Interrupts Two Interrupt Vectors TAxCCR0 interrupt vector for TAxCCR0 CCIFG TAxIV interrupt vector for all other CCIFG flags and TAIFG Interrupt Priorities TAxCCR0 interrupt has the highest Timer_A priority TAxCCR0 CCIFG flag is automatically reset when the TAxCCR0 interrupt request is served TAxCCRy CCIFG flags and TAIFG flags are prioritized (1-6 in the descending order) 28

29 Time A Interrupts Compare Mode CAP =0 CCIFG flag is set when TAxR counts to the associated TAxCCRn value This mode is used to generate periodic signals of whose frequency and duty cycle can be altered Capture Mode CAP =1 CCIFG flag is set when a timer value is captured in the associated TAxCCRn register 29

30 Time A Interrupts Vectors Each timer block has two sets of vectors Timerx_A0 for CCR0; Timerx_A1 for others (x=0, 1, 2) Timer0_A0_Vector Timer0_A1_Vector Timer1_A0_Vector Timer1_A1_Vector Timer2_A0_Vector Timer2_A1_Vector 30

31 Example Use Timer A CCR0 in the compare mode to trigger LED blink Step 1 set up Timer A0 control register. Let s choose a clock source Set up Timer A0 in Up mode TA0CTL=TASSEL_1+MC_UP Step 2 set up LEDs. A LED is connected with PORT1.0 P1DIR =BIT0 31

32 Step 3 set up Timer A0 interrupt Enable compare/capture interrupt Set up Timer A0 in the compare mode TA0CCTL0 = 0x10 Step 4 set up TA0CCR0, and have Timer A0 (TA0R) to count to its contents TA0CCR = 12000; Step 5 write the interrupt routine and put it in the predefined program memory #pragma vector=timer0_a0_vector _interrupt void Timer_A(void) { PIOUT^=0x01; } 32

Interrupts, Low Power Modes

Interrupts, Low Power Modes Interrupts, Low Power Modes Registers Status Register Interrupts (Chapter 6 in text) A computer has 2 basic ways to react to inputs: 1) polling: The processor regularly looks at the input and reacts as

More information

Lab 4: Interrupt. CS4101 Introduction to Embedded Systems. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Lab 4: Interrupt. CS4101 Introduction to Embedded Systems. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan CS4101 Introduction to Embedded Systems Lab 4: Interrupt Prof. Chung-Ta King Department of Computer Science, Taiwan Introduction In this lab, we will learn interrupts of MSP430 Handling interrupts in MSP430

More information

Lab 4 Interrupts ReadMeFirst

Lab 4 Interrupts ReadMeFirst Lab 4 Interrupts ReadMeFirst Lab Folder Content 1) ReadMeFirst 2) Interrupt Vector Table 3) Pin out Summary Objectives Understand how interrupts work Learn to program Interrupt Service Routines in C Language

More information

Interrupts CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Interrupts CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan CS4101 嵌入式系統概論 Interrupts Prof. Chung-Ta King Department of Computer Science, Taiwan Materials from MSP430 Microcontroller Basics, John H. Davies, Newnes, 2008 Inside MSP430 (MSP430G2551) 1 Introduction

More information

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I. University of Texas at El Paso Electrical and Computer Engineering Department EE 3176 Laboratory for Microprocessors I Fall 2016 LAB 04 Timer Interrupts Goals: Learn about Timer Interrupts. Learn how to

More information

ECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT

ECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT ECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT Reading for Today: User's Guide 1.4, Ch 16 Reading for Next Class: Review all since

More information

Texas Instruments Mixed Signal Processor Tutorial Abstract

Texas Instruments Mixed Signal Processor Tutorial Abstract Texas Instruments Mixed Signal Processor Tutorial Abstract This tutorial goes through the process of writing a program that uses buttons to manipulate LEDs. One LED will be hard connected to the output

More information

CPE 323: MSP430 Timers

CPE 323: MSP430 Timers CPE 323: MSP430 Timers Aleksandar Milenkovic Electrical and Computer Engineering The University of Alabama in Huntsville milenka@ece.uah.edu http://www.ece.uah.edu/~milenka Outline Watchdog Timer TimerA

More information

What is an Interrupt?

What is an Interrupt? MSP430 Interrupts What is an Interrupt? Reaction to something in I/O (human, comm link) Usually asynchronous to processor activities interrupt handler or interrupt service routine (ISR) invoked to take

More information

Timer Module Timer A. ReadMeFirst

Timer Module Timer A. ReadMeFirst Timer Module Timer A ReadMeFirst Lab Folder Content 1) ReadMeFirst 2) TimerModule Lecture material 3) PinOutSummary 4) InterruptsVectorTable 5) Source code for screencast Interrupt Review Overview A Timer

More information

// Conditions for 9600/4=2400 Baud SW UART, SMCLK = 1MHz #define Bitime_5 0x05*4 // ~ 0.5 bit length + small adjustment #define Bitime 13*4//0x0D

// Conditions for 9600/4=2400 Baud SW UART, SMCLK = 1MHz #define Bitime_5 0x05*4 // ~ 0.5 bit length + small adjustment #define Bitime 13*4//0x0D /****************************************************************************** * * * 1. Device starts up in LPM3 + blinking LED to indicate device is alive * + Upon first button press, device transitions

More information

Wireless Sensor Networks (WSN)

Wireless Sensor Networks (WSN) Wireless Sensor Networks (WSN) Operating Systems M. Schölzel Operating System Tasks Traditional OS Controlling and protecting access to resources (memory, I/O, computing resources) managing their allocation

More information

MSP430 Interrupts. Change value of internal variable (count) Read a data value (sensor, receive) Write a data value (actuator, send)

MSP430 Interrupts. Change value of internal variable (count) Read a data value (sensor, receive) Write a data value (actuator, send) MSP430 Interrupts What is an Interrupt? Reaction to something in I/O (human, comm link) Usually asynchronous to processor activities interrupt handler or interrupt service routine (ISR) invoked to take

More information

Lecture test next week

Lecture test next week Lecture test next week Write a short program in Assembler doing. You will be given the print outs of all the assembler programs from the manual You can bring any notes you want Today: Announcements General

More information

Timers and Clocks CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Timers and Clocks CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan CS4101 嵌入式系統概論 Timers and Clocks Prof. Chung-Ta King Department of Computer Science, Taiwan Materials from MSP430 Microcontroller Basics, John H. Davies, Newnes, 2008 Recall the Container Thermometer Container

More information

CPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B

CPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B CPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B Aleksandar Milenković Email: milenka@uah.edu Web: http://www.ece.uah.edu/~milenka Objective This

More information

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2 IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2 1. Block diagram of MSP430x5xx series micro-controller --------------------- 1 2. CPU architecture of MSP430x5xx ------------------------------------------------

More information

ECE PRACTICE EXAM #2 Clocks, Timers, and Digital I/O

ECE PRACTICE EXAM #2 Clocks, Timers, and Digital I/O ECE2049 -- PRACTICE EXAM #2 Clocks, Timers, and Digital I/O Study HW3, Class Notes, Davies Ch 2.6, 5.8, 8, 9.2-3, 9.7, MSP43F5529 User's Guide Ch 5, 17, 28 Work all problems with your note sheet first

More information

Lab 1: I/O, timers, interrupts on the ez430-rf2500

Lab 1: I/O, timers, interrupts on the ez430-rf2500 Lab 1: I/O, timers, interrupts on the ez430-rf2500 UC Berkeley - EE 290Q Thomas Watteyne January 25, 2010 1 The ez430-rf2500 and its Components 1.1 Crash Course on the MSP430f2274 The heart of this platform

More information

Hacettepe University

Hacettepe University MSP430 Teaching Materials Week 5 FUNDAMENTALS OF INTERFACING AND TIMERS for MSP430 Hacettepe University Elements in Basic MCU Interface Power Source Feeds CPU and peripherals Clock Oscillators System synchronization

More information

Block diagram of processor (Harvard)

Block diagram of processor (Harvard) Block diagram of processor (Harvard) Register transfer view of Harvard architecture Separate busses for instruction memory and data memory Example: PIC 16 load path OP REG AC 16 16 store path rd wr data

More information

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #11: More Clocks and Timers

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #11: More Clocks and Timers ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #11: More Clocks and Timers Reading for Today: Davie's Ch 8.3-8.4, 8.9-8.10, User's Guide Ch. 17 Reading for Next Class: User's

More information

Today's plan: Announcements General Strategy Microcontroller programming concepts/last bits of assembly Activity 2

Today's plan: Announcements General Strategy Microcontroller programming concepts/last bits of assembly Activity 2 Today's plan: Announcements General Strategy Microcontroller programming concepts/last bits of assembly Activity 2 Intro to programming in C time permitting Lab 1&2 Marking scheme: Announcements: Turn

More information

MSP430. More on MSP430

MSP430. More on MSP430 MSP430 More on MSP430 CodeComposer TI recently launched Code Composer Essentials v3. This IDE s latest version (version 3) supports all available MSP430 devices. The new features of CCE v3 include: - Free

More information

Hacettepe University

Hacettepe University MSP430 Teaching Materials Week 5 FUNDAMENTALS OF INTERFACING AND TIMERS for MSP430 Hacettepe University Elements in Basic MCU Interface Power Source Feeds CPU and peripherals Clock Oscillators System synchronization

More information

CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview

CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview Aleksandar Milenkovic Electrical and Computer Engineering The University of Alabama in Huntsville milenka@ece.uah.edu

More information

6. General purpose Input/Output

6. General purpose Input/Output Chapter 6 6. General purpose Input/Output This chapter starts with a description of one of the simplest integrated peripherals of the MSP430 the General Purpose 8-bit Input Output (GPIO). The Input/Output

More information

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I. University of Texas at El Paso Electrical and Computer Engineering Department EE 3176 Laboratory for Microprocessors I Fall 2016 LAB 03 Low Power Mode and Port Interrupts Goals: Bonus: Pre Lab Questions:

More information

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan Interrupts and Resets Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.twcgu Interrupts An event that will cause the CPU to stop the normal program execution

More information

ECE 372 Microcontroller Design Parallel IO Ports - Interrupts. ECE 372 Microcontroller Design Parallel IO Ports - Interrupts

ECE 372 Microcontroller Design Parallel IO Ports - Interrupts. ECE 372 Microcontroller Design Parallel IO Ports - Interrupts Interrupts An interrupt can be compared with a phone call interrupting your task which you will resume when the call is finished You can mask an interrupt just as you can decide not to answer any phone

More information

15.1 Timer_A Introduction

15.1 Timer_A Introduction Chapter 15 is a 16-bit timer/counter with multiple capture/compare registers. This chapter describes. This chapter describes the operation of the of the MSP430x4xx device family. Topic Page 15.1 Introduction.........................................

More information

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives: ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives: This lab will introduce basic embedded systems programming concepts by familiarizing the user with an embedded programming

More information

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss Grundlagen Microcontroller Interrupts Günther Gridling Bettina Weiss 1 Interrupts Lecture Overview Definition Sources ISR Priorities & Nesting 2 Definition Interrupt: reaction to (asynchronous) external

More information

2.996/6.971 Biomedical Devices Design Laboratory Lecture 6: Microprocessors II

2.996/6.971 Biomedical Devices Design Laboratory Lecture 6: Microprocessors II 2.996/6.971 Biomedical Devices Design Laboratory Lecture 6: Microprocessors II Instructor: Dr. Hong Ma Oct. 1, 2007 Structure of MSP430 Program 1. Declarations 2. main() 1. Watch-dog timer servicing 2.

More information

CHAPTER 11 INTERRUPTS PROGRAMMING

CHAPTER 11 INTERRUPTS PROGRAMMING CHAPTER 11 INTERRUPTS PROGRAMMING Interrupts vs. Polling An interrupt is an external or internal event that interrupts the microcontroller To inform it that a device needs its service A single microcontroller

More information

ECE2049: Embedded Computing in Engineering Design A Term Fall 2017 Lecture #16: Interrupts and Event Driven Code

ECE2049: Embedded Computing in Engineering Design A Term Fall 2017 Lecture #16: Interrupts and Event Driven Code ECE2049: Embedded Computing in Engineering Design A Term Fall 2017 Lecture #16: Interrupts and Event Driven Code Reading for Today: Example code Reading for Next Class: Review all since exam 1 HW #4 (on

More information

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen

More information

The 16-bit timer/counter register, TAR, increments or decrements (depending on mode of operation) with each rising edge of the clock signal.

The 16-bit timer/counter register, TAR, increments or decrements (depending on mode of operation) with each rising edge of the clock signal. Timer & Real Time Clock (RTC), PWM control, timing generation and measurements. Analog interfacing and data acquisition: ADC and Comparator in MSP430, data transfer using DMA. Case Study: MSP430 based

More information

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class) ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class) Your homework should be neat and professional looking. You will loose points if your HW is not properly

More information

ECSE-426. Microprocessor Systems. 2: Assembly + C 1

ECSE-426. Microprocessor Systems. 2: Assembly + C 1 ECSE-426 Microprocessor Systems 2: Assembly + C 1 Today s Lecture Theory Tutorial Appendix Multi-level machines Problem-oriented language layer Language Choice Machine Architecture Introduction to the

More information

TAxCTL Register

TAxCTL Register Timer_A Registers 17.3.1 TAxCTL Register Timer_Ax Control Register Figure 17-16. TAxCTL Register Reserved TASSEL ID MC Reserved TACLR TAIE TAIFG rw-(0) rw-(0) rw-(0) rw-(0) rw-(0) w-(0) rw-(0) rw-(0) 15-10

More information

Interrupts (I) Lecturer: Sri Notes by Annie Guo. Week8 1

Interrupts (I) Lecturer: Sri Notes by Annie Guo. Week8 1 Interrupts (I) Lecturer: Sri Notes by Annie Guo Week8 1 Lecture overview Introduction to Interrupts Interrupt system specifications Multiple Sources of Interrupts Interrupt Priorities Interrupts in AVR

More information

Microprocessors & Interfacing

Microprocessors & Interfacing Lecture Overview Microprocessors & Interfacing Interrupts (I) Lecturer : Dr. Annie Guo Introduction to Interrupts Interrupt system specifications Multiple sources of interrupts Interrupt priorities Interrupts

More information

CPE 323 Introduction to Embedded Computer Systems: ADC12 and DAC12. Instructor: Dr Aleksandar Milenkovic Lecture Notes

CPE 323 Introduction to Embedded Computer Systems: ADC12 and DAC12. Instructor: Dr Aleksandar Milenkovic Lecture Notes CPE 323 Introduction to Embedded Computer Systems: ADC12 and DAC12 Instructor: Dr Aleksandar Milenkovic Lecture Notes Outline MSP430: System Architecture ADC12 Module DAC12 Module CPE 323 2 ADC12 Introduction

More information

Why embedded systems?

Why embedded systems? MSP430 Intro Why embedded systems? Big bang-for-the-buck by adding some intelligence to systems. Embedded Systems are ubiquitous. Embedded Systems more common as prices drop, and power decreases. Which

More information

Introduction to Embedded Systems

Introduction to Embedded Systems Stefan Kowalewski, 4. November 25 Introduction to Embedded Systems Part 2: Microcontrollers. Basics 2. Structure/elements 3. Digital I/O 4. Interrupts 5. Timers/Counters Introduction to Embedded Systems

More information

Interfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller

Interfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller Interfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller 1 INTRODUCTION The objective of this document is to show how to set up SPI/I2C communication between VTI Technologies CMA3000-D01 digital

More information

ECE 492 WINTER 2015 GROUP 2. Texas Instruments MSP430-FR Bit ADC Setup Guide

ECE 492 WINTER 2015 GROUP 2. Texas Instruments MSP430-FR Bit ADC Setup Guide APPLICATION NOTE MIKE PAPPAS ECE 492 WINTER 2015 GROUP 2 Texas Instruments MSP430-FR5969 12-Bit ADC Setup Guide March 2015 Table of Contents Preface... 3 Pin Assignments... 4 Configuring the ADC... 4 Sampling

More information

Interrupt Driven Programming in MSP430 Assembly (ESCAPE) *

Interrupt Driven Programming in MSP430 Assembly (ESCAPE) * OpenStax-CNX module: m45965 1 Interrupt Driven Programming in MSP430 Assembly (ESCAPE) * Matthew Johnson Based on Interrupt Driven Programming in MSP430 Assembly by Matthew Johnson This work is produced

More information

PHYS 319. Things to do before next week's lab Whirlwind tour of the MSP430 CPU and its assembly language Activity 1.

PHYS 319. Things to do before next week's lab Whirlwind tour of the MSP430 CPU and its assembly language Activity 1. PHYS 319 Things to do before next week's lab Whirlwind tour of the MSP430 CPU and its assembly language Activity 1. Before next week's lab: Read manual for Lab 2 and your OS setup guide then prepare your

More information

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #8: Making it work: LEDs, Buttons & Keypad

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #8: Making it work: LEDs, Buttons & Keypad ECE2049: Embedded Computing in Engineering Design A Term Fall 2018 Lecture #8: Making it work: LEDs, Buttons & Keypad Reading for Today: Users Guide Ch 12 Reading for Next Class: Review all reading, notes,

More information

Before next weeks lab:

Before next weeks lab: Before next weeks lab: - To sign in to lab computers use student and Phys319. - read the lab manual for week two. - look at the tools installation guide for OS of your choice and/or lab computer guide,

More information

Embedded Systems and Software

Embedded Systems and Software Embedded Systems and Software Lecture 11 Interrupts Interrupts Slide 1 Interrupts One way to think of interrupts is that they are hardwaregenerated functions calls Internal Hardware When timer rolls over,

More information

Using peripherals on the MSP430 (if time)

Using peripherals on the MSP430 (if time) Today's Plan: Announcements Review Activities 1&2 Programming in C Using peripherals on the MSP430 (if time) Activity 3 Announcements: Midterm coming on Feb 9. Will need to write simple programs in C and/or

More information

Towards Hard Real-time Performance in a Highly Asynchronous Multitasking MSP430 Application Andrew E. Kalman, Ph.D.

Towards Hard Real-time Performance in a Highly Asynchronous Multitasking MSP430 Application Andrew E. Kalman, Ph.D. Towards Hard Real-time Performance in a Highly Asynchronous Multitasking MSP430 Application Andrew E. Kalman, Ph.D. Slide 1 Outline Overview Part I: TimerA does PWM Part II: TimerB drives a Stepper Part

More information

Interfacing CMR3000-D01 to an MSP430 ultra low-power microcontroller

Interfacing CMR3000-D01 to an MSP430 ultra low-power microcontroller Interfacing CMR3000-D01 to an MSP430 ultra low-power microcontroller 1 INTRODUCTION The objective of this document is to show how to set up SPI/I2C communication between VTI Technologies CMR3000-D01 digital

More information

063[[[0LFURFRQWUROOHUV /RZ3RZHU0RGHV &3($GYDQFHG0LFURFRPSXWHU7HFKQLTXHV 'U(PLO-RYDQRY /RZ3RZHU. Power: A First-Class Architectural Design Constraint

063[[[0LFURFRQWUROOHUV /RZ3RZHU0RGHV &3($GYDQFHG0LFURFRPSXWHU7HFKQLTXHV 'U(PLO-RYDQRY /RZ3RZHU. Power: A First-Class Architectural Design Constraint 063[[[0LFURFRQWUROOHUV /RZ3RZHU0RGHV &3($GYDQFHG0LFURFRPSXWHU7HFKQLTXHV 'U(PLO-RYDQRY MSP430 low power concepts 1 /RZ3RZHU Power: A First-Class Architectural Design Constraint Trevor Mudge, IEEE Computer,

More information

MSP430xxxx Microcontrollers Low Power Modes

MSP430xxxx Microcontrollers Low Power Modes MSP430xxxx Microcontrollers Low Power Modes Modes à basse consommation 1 Power is a priority architectural design constraint Why worry about power? Battery life in portable and mobile platforms Power consumption

More information

Designing for Ultra-Low Power with MSP430

Designing for Ultra-Low Power with MSP430 Designing for Ultra-Low Power with MSP430 Christian Hernitscheck MSP430 FAE Europe Texas Instruments 2006 Texas Instruments Inc, Slide 1 Agenda Introduction to Ultra-Low Power Looking for Ultra-Low Power

More information

Module Introduction. PURPOSE: The intent of this module is to explain MCU processing of reset and interrupt exception events.

Module Introduction. PURPOSE: The intent of this module is to explain MCU processing of reset and interrupt exception events. Module Introduction PURPOSE: The intent of this module is to explain MCU processing of reset and interrupt exception events. OBJECTIVES: - Describe the difference between resets and interrupts. - Identify

More information

CONTENTS: Program 1 in C:

CONTENTS: Program 1 in C: CONTENTS: 1) Program 1 in C (Blink) 2) Program 2 in C (Interrupt ) 3) ADC example 4) Addressing Modes 5) Selected Assembly instructions 6) ADC10 register descriptions Program 1 in C: /* * PHYS319 Lab3

More information

Physics 319 Spring 2015: Introduction to the Programming and Use of Microprocessors

Physics 319 Spring 2015: Introduction to the Programming and Use of Microprocessors Physics 319 Spring 2015: Introduction to the Programming and Use of Microprocessors Sing Chow, Andrzej Kotlicki, Ryan Wicks, and Carl Michal December 2014 This lab is going to introduce you to the world

More information

Fall. Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden. George Mason University

Fall. Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden. George Mason University Fall 13 Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden George Mason University Introduction The ECE 511 course gave us the opportunity to team up

More information

MSP430 Teaching Materials

MSP430 Teaching Materials MSP430 Teaching Materials Lecture 5 Timers Description of clock signals Texas Instruments Incorporated University of Beira Interior (PT) Pedro Dinis Gaspar, António Espírito Santo, Bruno Ribeiro, Humberto

More information

MIDTERM#1. 2-(3pts) What is the difference between Von Neumann & Harvard processor architectures?

MIDTERM#1. 2-(3pts) What is the difference between Von Neumann & Harvard processor architectures? CSE421-Microprocessors & Microcontrollers-Spring 2013 (March 26, 2013) NAME: MIDTERM#1 1- (2pts) What does MSP stand for in MSP430? Why? Mixed Signal Processor. It contains both analog and digital circuitry.

More information

Micro-Controller: PIC16C74 < Part 5: Interrupt >

Micro-Controller: PIC16C74 < Part 5: Interrupt > Micro-Controller: PIC16C74 < Part 5: Interrupt > I. Overview Introduction PIC16c74 can have many sources of interrupt. These sources generally include one interrupt source for each peripheral module, though

More information

Getting Started with the Texas Instruments ez430

Getting Started with the Texas Instruments ez430 1 of 6 03.01.2009 01:33 HOME Running Your Code>> Getting Started with the Texas Instruments ez430 Working with the Workbench Software Step 1: Each program needs an associated project. The project includes

More information

Embedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory

Embedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory Embedded Systems 3. Hardware Software Interface Lothar Thiele Computer Engineering and Networks Laboratory Do you Remember? 3 2 3 3 High Level Physical View 3 4 High Level Physical View 3 5 What you will

More information

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1 M68HC08 Microcontroller The MC68HC908GP32 Babak Kia Adjunct Professor Boston University College of Engineering Email: bkia -at- bu.edu ENG SC757 - Advanced Microprocessor Design General Description The

More information

Interrupts and Using Them in C

Interrupts and Using Them in C Interrupts and Using Them in C Lecture 10 Embedded Systems 10-1 In These Notes... Interrupts How they work Creating and debugging C interrupt routines Sources M16C Hardware Manual P&P 8.1 and 8.5 Readings

More information

Introduction to the Texas Instruments ez430. By: Naren Anand

Introduction to the Texas Instruments ez430. By: Naren Anand Introduction to the Texas Instruments ez430 By: Naren Anand Introduction to the Texas Instruments ez430 By: Naren Anand Online: C O N N E X I O N S Rice University,

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 TOPICS TODAY I/O Architectures Interrupts Exceptions FETCH EXECUTE CYCLE 1.7 The von Neumann Model This is a general

More information

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #7: More Digital IO Reading for Today: Davies 7.5-7.9, Users Guide Ch 12 Reading for Next Class: Davies 7.5-7.9, Users Guide

More information

TPL5000EVM User's Guide

TPL5000EVM User's Guide User's Guide TPL5000EVM User's Guide 1 Introduction The Texas Instruments TPL5000EVM evaluation module (EVM) allows a designer to configure the delay timers of the TPL5000 and measure its very low current

More information

12. Interrupts and Programmable Multilevel Interrupt Controller

12. Interrupts and Programmable Multilevel Interrupt Controller 12. Interrupts and Programmable Multilevel Interrupt Controller 12.1 Features Short and predictable interrupt response time Separate interrupt configuration and vector address for each interrupt Programmable

More information

Review Activity 1 CALL and RET commands in assembler

Review Activity 1 CALL and RET commands in assembler Today's Plan: Announcements Review Activity 1 CALL and RET commands in assembler Lecture test Programming in C continue Announcements: Projects: should be starting to think about. You will need to provide

More information

Alex Milenkovich 1. CPE/EE 421 Microcomputers. Course Administration. Review: Outline. Getting Started with EasyWeb2. Review: MSP bit RISC

Alex Milenkovich 1. CPE/EE 421 Microcomputers. Course Administration. Review: Outline. Getting Started with EasyWeb2. Review: MSP bit RISC CPE/EE 421 Microcomputers Instructor: Dr Aleksandar Milenkovic Lecture Note S12 Course Administration Instructor: URL: TA: Labs: Test I: Text: Review: Today: Aleksandar Milenkovic milenka@ece.uah.edu www.ece.uah.edu/~milenka

More information

5xx Active & Low Power Mode Operation

5xx Active & Low Power Mode Operation 5xx Active & Low Power Mode Operation 38 Lab 2: ULP Operation Lab Goals Learn ULP Best Practices Learn & understand how to configure two key modules of the 5xx to achieve ultra-low power operation. Power

More information

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text In this lecture embedded C program for interrupt handling

More information

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I. University of Texas at El Paso Electrical and Computer Engineering Department EE 3176 Laboratory for Microprocessors I Fall 2016 LAB 06 Analog to Digital Conversion Goals: Bonus: Pre Lab Questions: Display

More information

Reset, Interrupts, Exceptions, and Break ECE 3534

Reset, Interrupts, Exceptions, and Break ECE 3534 Reset, Interrupts, Exceptions, and Break ECE 3534 1 Reset, Interrupts, Exceptions, Break These topics are closely related Both software and hardware aspects of a processor are involved On the MicroBlaze,

More information

Alex Milenkovich 1. CPE/EE 421 Microcomputers: The MSP430 Introduction. Outline

Alex Milenkovich 1. CPE/EE 421 Microcomputers: The MSP430 Introduction. Outline Outline CPE/EE 421 Microcomputers: The MSP430 Introduction Instructor: Dr Aleksandar Milenkovic Lecture Notes MSP430: An Introduction The MSP430 family Technology Roadmap Typical Applications The MSP430

More information

Interrupts in Zynq Systems

Interrupts in Zynq Systems Interrupts in Zynq Systems C r i s t i a n S i s t e r n a U n i v e r s i d a d N a c i o n a l d e S a n J u a n A r g e n t i n a Exception / Interrupt Special condition that requires a processor's

More information

Digital Control of Electric Drives

Digital Control of Electric Drives Digital Control of Electric Drives Computer System Structure Interrupt System Computer Programmer s Model Czech Technical University in Prague Faculty of Electrical Engineering Ver.1.00 J. Zdenek 2017

More information

CPE 325: Embedded Systems Laboratory Laboratory #11 Tutorial Analog-to-Digital Converter and Digital-to-Analog Converter

CPE 325: Embedded Systems Laboratory Laboratory #11 Tutorial Analog-to-Digital Converter and Digital-to-Analog Converter CPE 325: Embedded Systems Laboratory Laboratory #11 Tutorial Analog-to-Digital Converter and Digital-to-Analog Converter Aleksandar Milenković Email: milenka@uah.edu Web: http://www.ece.uah.edu/~milenka

More information

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab By the end of Class Pseudo-code for Lab 1-2 due as part of prelab Homework #5 on website due before next class Outline Introduce Lab 1-2 Counting Timers on C8051 Interrupts Laboratory Worksheet #05 Copy

More information

Fundamental concept in computation Interrupt execution of a program to handle an event

Fundamental concept in computation Interrupt execution of a program to handle an event Interrupts Fundamental concept in computation Interrupt execution of a program to handle an event Don t have to rely on program relinquishing control Can code program without worrying about others Issues

More information

These 3 registers contain enable, priority,

These 3 registers contain enable, priority, 8.3.2) Registers Related to Interrupts These registers enable/disable the interrupts, set the priority of the interrupts, and record the status of each interrupt source. RCON INTCON, INTCON2, and INTCON3

More information

Micro computer Organization

Micro computer Organization Micro computer Organization I Base Basic Components CPU SYSTEM BUSES VDD CLK RESET 1 MPU vs MCU Microprocessor Unit (MPU) CPU (called Microprocessor) is a die All components external to die Basically on

More information

Timer 32. Last updated 8/7/18

Timer 32. Last updated 8/7/18 Last updated 8/7/18 Basic Timer Function Delay Counter Load a value into a counter register The counter counts Down to zero (count down timer) Up from zero (count up timer) An action is triggered when

More information

CPE/EE 421 Microcomputers

CPE/EE 421 Microcomputers CPE/EE 421 Microcomputers Instructor: Dr Aleksandar Milenkovic Lecture Note S13 *Material used is in part developed by Dr. D. Raskovic and Dr. E. Jovanov CPE/EE 421/521 Microcomputers 1 MSP430 Documentation

More information

Create and Add the Source File

Create and Add the Source File IAR Kickstart Procedure Create and Add the Source File 8. Create the Source File From the IAR Embedded Workbench menu bar, select File New File. In the untitled editor window that appears, type the following

More information

Interrupt Basics Karl-Ragmar Riemschneider

Interrupt Basics Karl-Ragmar Riemschneider Interrupt Basics Exceptions and Interrupts Interrupts Handlers vs. Subroutines Accept or hold Pending: Priority control Exception vector table Example Karl-Ragmar Riemschneider Exceptions

More information

LECTURE - 4 Programming MSP430 using Code Composer Studio(CCS)

LECTURE - 4 Programming MSP430 using Code Composer Studio(CCS) LECTURE - 4 Programming MSP430 using Code Composer Studio(CCS) Atul Lele, Ramakrishna Reddy K, MSP430 Design, Texas Instruments India Pvt Ltd. 2/16/2012 1 Outline of today s session What have we learnt

More information

EE Embedded Systems Design. Lessons Exceptions - Resets and Interrupts

EE Embedded Systems Design. Lessons Exceptions - Resets and Interrupts EE4800-03 Embedded Systems Design Lessons 7-10 - Exceptions - Resets and Interrupts 1 - Exceptions - Resets and Interrupts Polling vs. Interrupts Exceptions: Resets and Interrupts 68HC12 Exceptions Resets

More information

Interrupts. Why Interrupts

Interrupts. Why Interrupts Why Interrupts I/O operations Peripherals and external devices can let the processor know they are ready vs. the processor polling each device Routine tasks Updating the time Making sure the processor

More information

EEL 4744C: Microprocessor Applications. Lecture 7. Part 1. Interrupt. Dr. Tao Li 1

EEL 4744C: Microprocessor Applications. Lecture 7. Part 1. Interrupt. Dr. Tao Li 1 EEL 4744C: Microprocessor Applications Lecture 7 Part 1 Interrupt Dr. Tao Li 1 M&M: Chapter 8 Or Reading Assignment Software and Hardware Engineering (new version): Chapter 12 Dr. Tao Li 2 Interrupt An

More information

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1 Reading Assignment EEL 4744C: Microprocessor Applications Lecture 7 M&M: Chapter 8 Or Software and Hardware Engineering (new version): Chapter 12 Part 1 Interrupt Dr. Tao Li 1 Dr. Tao Li 2 Interrupt An

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text 1. Interrupt An interrupt is the occurrence of a condition--an event --

More information

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes Course Introduction Purpose: This course provides an overview of the Direct Memory Access Controller and the Interrupt Controller on the SH-2 and SH-2A families of 32-bit RISC microcontrollers, which are

More information