EasyManuals Logo

Texas Instruments MSP430 Student Guide

Texas Instruments MSP430
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #212 background imageLoading...
Page #212 background image
Coding Interrupts
Coding Interrupts
As previously discussed, the code within your interrupt service routine will vary slightly based on
whether it handles a dedicated, single interrupt or if it handles a grouped interrupt. We will cover
both cases; starting with the easier, dedicated case.
Dedicated ISR (Interrupt Service Routine)
INT Source
IV Register
Vector Address
Loc’n
Priority
System Reset
SYSRSTIV
RESET_VECTOR
63
high
System NMI
SYSSNIV
SYSNMI_VECTOR
62
User NMI
SYSUNIV
UNMI_VECTOR
61
Comparator
CBIV
COMP_B_VECTOR
60
Timer B (CCIFG0)
CCIFG0
TIMER0_B0_VECTOR
59
Timer B
TB0IV
TIMER0_B1_VECTOR
58
WDT Interval Timer
WDTIFG
WDT_VECTOR
57
Serial Port (A)
UCA0IV
USCI_A0_VECTOR
56
Serial Port (B)
UCB0IV
USCI_B0_VECTOR
55
A/D Convertor
ADC12IV
ADC12_VECTOR
54
GPIO (Port 1)
P1IV
PORT1_VECTOR
47
GPIO
(Port 2) P12V
PORT2_VECTOR
42
Real
-Time Clock RTCIV
RTC_VECTOR
41
low
Legend:
Non-maskable
Group’d
IFG bits
Maskable
Dedicated IFG bits
Flash
(128K)
INT Vectors
(80)
RAM
(8K)
USB RAM
(2K)
Info Memory
(512)
Boot Loader
(2K)
Peripherals
(4K)
Memory Map
0xFFFF
Interrupt Vectors & Priorities (F5529)
The watchdog interrupt flag vector (WDTIFG) is a dedicated interrupt; therefore, your ISR code
only needs to respond to the single interrupt condition. Additionally, because it is a dedicated
interrupt, the CPU hardware automatically clears the WDTIFG bit when responding to the
interrupt and branching to your ISR.
When writing an ISR for dedicated interrupts, you code must address three items:
1. Put the ISR address into the vector table (using the vector #pragma)
2. Save/Restore the CPU context (using the __interrupt keyword)
3. Write your interrupt handler code (in other words, “Do what needs doing”)
5 - 22 MSP430 Workshop - Interrupts

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals