MSP430 Mixed Signal Microcontroller – Parte 2 Afonso Ferreira Miguel Source: slau056d – Texas instruments.

Slides:



Advertisements
Similar presentations
BASICS OF MSP430 & INTERFACING MICRO-SD CARD WITH IT.
Advertisements

UBI >> Contents Chapter 7 Timers Laboratories MSP430 Teaching Materials Texas Instruments Incorporated University of Beira Interior (PT) Pedro Dinis Gaspar,
Interrupts, Low Power Modes and Timer A (Chapters 6 & 8)
Chung-Ta King National Tsing Hua University
Chung-Ta King National Tsing Hua University
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
8051 Core Specification.
I/O Unit.
ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes.
Instructor: Dr Aleksandar Milenkovic Lecture Notes
Introduction of Holtek HT-46 series MCU
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
Notes on the ez430-RF2500. Sources
1 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
CS4101 嵌入式系統概論 Timers and Clocks 金仲達教授 國立清華大學資訊工程學系 Materials from MSP430 Microcontroller Basics, John H. Davies, Newnes, 2008.
Chung-Ta King National Tsing Hua University
Timers. Range of timers Watchdog timer: Included in all devices (watchdog timer+). Its main function is to protect the system against malfunctions but.
The 8051 Microcontroller architecture
LAB 7: WDT+ and Low-Power Optimization
T IMERS - 2. O UTPUT U NIT Each capture/compare block contains an output unit. The output unit is used to generate output signals such as PWM signals.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
System Clocks.
CPE 323 Introduction to Embedded Computer Systems: Watchdog Timer, Timer A Instructor: Dr Aleksandar Milenkovic Lecture Notes.
MICROPROCESSOR INPUT/OUTPUT
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
PIC16F877 ISR Points to note Interrupt Triggers –Individual interrupt flag bits are set, regardless of the status of their corresponding mask bit, PEIE.
ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.
Week 16.
Lecture 11: TI MSP430 Timers Compare Modes
Lecture 11 Low Power Modes & Watchdog Timers
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This training course provides an overview of the CPU architecture.
Instructor: Dr Aleksandar Milenkovic Lecture Notes
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
ECE 447 Fall 2009 Lecture 7: MSP430 Polling and Interrupts.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
I NTRODUCTION TO PIC PROGRAMMING By : S HERIF H ARHASH.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
بسم الله الرحمن الرحيم MEMORY AND I/O.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Recall the Container Thermometer
Lecture 10: TI MSP430 Timers and Capture Modes
Introduction Why low power?
Introduction Why low power?
ECE 3430 – Intro to Microcomputer Systems
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
PWM and DC Motor Control
CS4101 Introduction to Embedded Systems Lab 6: Low-Power Optimization
Timer and Interrupts.
ECE 3430 – Intro to Microcomputer Systems
MSP432 ARM Timer Programming
ECE 3430 – Intro to Microcomputer Systems
ECE 3430 – Intro to Microcomputer Systems
Subject Name: Microcontroller Subject Code: 10ES42
CS4101 Introduction to Embedded Systems Lab 4: Interrupt
I/O PORTS : MSP430x5xx devices have up to 12 digital I/O ports :
ECE 3430 – Intro to Microcomputer Systems
CPE 323 Introduction to Embedded Computer Systems: DMA Controller
Lecture 9: TI MSP430 Interrupts & Low Power Modes
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
ECE 3430 – Intro to Microcomputer Systems
Prof. Chung-Ta King Department of Computer Science
MSP430 Clock System and Timer
Presentation transcript:

MSP430 Mixed Signal Microcontroller – Parte 2 Afonso Ferreira Miguel Source: slau056d – Texas instruments

Interrupts  There are three types of interrupts: System reset (Non)-maskable NMI Maskable

Maskable Interrupts  Maskable interrupts are caused by peripherals with interrupt capability including the watchdog timer overflow in interval-timer mode.  Each maskable interrupt source can be disabled individually by an interrupt enable bit, or  all maskable interrupts can be disabled by the general interrupt enable (GIE) bit in the status register (SR).

Maskable Interrupts  Interrupt Acceptance 1) Any currently executing instruction is completed. 2) The PC, which points to the next instruction, is pushed onto the stack. 3) The SR is pushed onto the stack. 4) The interrupt with the highest priority is selected if multiple interrupts occurred during the last instruction and are pending for service. 5) The interrupt request flag resets automatically on single-source flags. Multiple source flags remain set for servicing by software. 6) The SR is cleared with the exception of SCG0, which is left unchanged. This terminates any low-power mode. Because the GIE bit is cleared, further interrupts are disabled. 7) The content of the interrupt vector is loaded into the PC: the program continues with the interrupt service routine at that address.

Maskable Interrupts  Interrupt Acceptance

Maskable Interrupts  Return From Interrupt The interrupt handling routine terminates with the instruction: RETI (return from an interrupt service routine) The return from the interrupt execute the following actions: 1) The SR with all previous settings pops from the stack. All previous settings of GIE, CPUOFF, etc. are now in effect, regardless of the settings used during the interrupt service routine. 2) The PC pops from the stack and begins execution at the point where it was interrupted.

Maskable Interrupts  Return From Interrupt  Interrupt nesting is enabled if the GIE bit is set inside an interrupt service routine. When interrupt nesting is enabled, any interrupt occurring during an interrupt service routine will interrupt the routine, regardless of the interrupt priorities.

Interrupts

MSP430F449 - Interrupt Vector

 Interrupts in ASM

MSP430F449 - Interrupt Vector  Interrupts in C

MSP430F449 - Interrupt Vector  Interrupts in C++ Interrupção definida no arquivo msp430x44x.h

FLL+Clock Module  The frequency-locked loop (FLL+) clock module supports low system cost and ultralow-power consumption.  Using three internal clock signals, the user can select the best balance of performance and low power consumption.

FLL+Clock Module  LFXT1CLK: Low-frequency/high-frequency oscillator that can be used either with low-frequency Hz watch crystals, or standard crystals, resonators, or external clock sources in 450-kHz to 8-MHz range.  XT2CLK: Optional high-frequency oscillator that can be used with standard crystals, resonators, or external clock sources in the 450-kHz to 8-MHz range.  DCOCLK: Internal digitally controlled oscillator (DCO) with RC-type characteristics, stabilized by the FLL.  Four clock signals are available from the FLL+ module:  ACLK: Auxiliary clock. The ACLK is the LFXT1CLK clock source. ACLK is software selectable for individual peripheral modules.  ACLK/n: Buffered output of the ACLK. The ACLK/n is ACLK divided by 1,2,4 or 8 and only used externally.  MCLK: Master clock. MCLK is software selectable as LFXT1CLK, XT2CLK (if available), or DCOCLK. MCLK can be divided by 1, 2, 4, or 8 within the FLL block. MCLK is used by the CPU and system.  SMCLK: Submain clock. SMCLK is software selectable as XT2CLK (if available), or DCOCLK. SMCLK is software selectable for individual peripheral modules.

FLL+Clock Module

 After a PUC, MCLK and SMCLK are sourced from DCOCLK at 32 times the ACLK frequency. When a 32,768-Hz crystal is used for ACLK, MCLK and SMCLK will stabilize to MHz.

Timer A  Timer_A is a 16-bit timer/counter with three or five capture/compare registers.  Timer_A can support multiple capture/compares, PWM outputs, and interval timing. Timer_A also has extensive interrupt capabilities.  Interrupts may be generated from the counter on overflow conditions and from each of the capture/compare registers.

Timer A  Timer_A features include: Asynchronous 16-bit timer/counter with four operating modes Selectable and configurable clock source Three or five configurable capture/compare registers Configurable outputs with PWM capability Asynchronous input and output latching Interrupt vector register for fast decoding of all Timer_A interrupts

Timer A  The 16-bit timer/counter register, TAR, increments or decrements (depending on mode of operation) with each rising edge of the clock signal.  TAR can be read or written with software. Additionally, the timer can generate an interrupt when it overflows.  TAR may be cleared by setting the TACLR bit.  Setting TACLR also clears the clock divider and count direction for up/down mode.

Timer A  Timer Modes

Timer A  Up Mode The up mode is used if the timer period must be different from 0FFFFh counts. The timer repeatedly counts up to the value of compare register TACCR0, which defines the period. The number of timer counts in the period is TACCR0+1. When the timer value equals TACCR0 the timer restarts counting from zero. If up mode is selected when the timer value is greater than TACCR0, the timer immediately restarts counting from zero.

Timer A  The TACCR0 CCIFG interrupt flag is set when the timer counts to the TACCR0 value.  The TAIFG interrupt flag is set when the timer counts from TACCR0 to zero.

Timer A  Registradores Usados TACTL: Configuração + flags TACCR0: Valor limite TAR: Contador

Timer A  TACTL

Operation Modes  The MSP430 family is designed for ultralow-power applications and uses different operating modes.  The operating modes take into account three different needs: Ultralow-power Speed and data throughput Minimization of individual peripheral current consumption

Operation Modes  The low-power modes 0–4 are configured with the CPUOFF, OSCOFF, SCG0, and SCG1 bits in the SR The advantage of including the CPUOFF, OSCOFF, SCG0, and SCG1 mode-control bits in the status register is that the present operating mode is saved onto the stack during an interrupt service routine.

Entering and Exiting Low-Power Modes  An enabled interrupt event wakes the MSP430 from any of the low-power operating modes. The program flow is: Enter interrupt service routine:  The PC and SR are stored on the stack.  The CPUOFF, SCG1, and OSCOFF bits are automatically reset. Options for returning from the interrupt service routine:  The original SR is popped from the stack, restoring the previous operating mode.  The SR bits stored on the stack can be modified within the interrupt service routine returning to a different operating mode when the RETI instruction is executed.

Entering and Exiting Low-Power Modes

 Status Register (SR)

Entering and Exiting Low-Power Modes  “msp430x44x.h” defines

Entering and Exiting Low-Power Modes