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 #218 background imageLoading...
Page #218 background image
Miscellaneous Topics
Miscellaneous Topics
Handling Unused Interrupts
While you are not required to provide interrupt vectors or ISR’s for every CPU interrupt, its
considered good programming practice to do so. To this end, the MSP430 compiler issues a
warning whenever there are “unhandled” interrupts.
The following code is an example that you can include in all your projects. Then, as you
implement an interrupt and write an ISR for it, just comment the associated #pragma line from
this file.
Handling Unused Interrupts
The MSP430 compiler issues warning whenever all interrupts are not handled
(i.e. when you don’t have a vector specified for each interrupt)
Here’s a simple example of how this might be handled:
// Example for UNUSED_HWI_ISR()
#pragma vector=ADC12_VECTOR
#pragma vector=COMP_B_VECTOR
#pragma vector=DMA_VECTOR
#pragma vector=PORT1_VECTOR
...
#pragma vector=TIMER1_A1_VECTOR
#pragma vector=TIMER2_A0_VECTOR
#pragma vector=TIMER2_A1_VECTOR
#pragma vector=UNMI_VECTOR
#pragma vector=USB_UBM_VECTOR
#pragma vector=WDT_VECTOR
__interrupt void UNUSED_HWI_ISR (void)
{
__no_operation();
}
Note: The TI code generation tools distinguish between “warnings” and “errors”. Both represent
issues found during compilation and build, but whereas a warning is issued and code
building continues … when an error is encountered, an error statement is issued and the
tools stop before creating a final executable.
5 - 28 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