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 #235 background imageLoading...
Page #235 background image
Lab 5 Interrupts
Configure/Enable GPIO Interrupt … Then Verify it Works
Add Code to Enable Interrupts
7. Open main.c and modify initGPIO() to enable the interrupt for your push-button.
If you need a hint on what three lines are required, refer back to the Lab 5 Worksheet,
question number 7 (see page 5-39).
Note that the pin numbers are the same, but the switch names differ for these Launchpads:
For the F5529 Launchpad, we’re using pushbutton SW2 (P1.1)
For the FR5969 Launchpad, we’re using pushbutton SW3 (P1.1)
8. Add the line of code needed to enable interrupts globally (i.e GIE).
This line of code should be placed right before the while{} loop in main(). Refer back to the
Lab 5 Worksheet, question number 8 (see page 5-40).
9. Build your code.
Fix any typos or errors.
Start the Debugger and Set Breakpoints
Once the debugger opens, we’ll setup two breakpoints. This allows us to verify the interrupts
were enabled, as well as trapping the interrupt when it occurs.
10. Launch the debugger.
11. Set a breakpoint on theenable GIE” line of code in main.c.
12. Next, set a breakpoint inside the ISR in the unused_interrupts.c file.
MSP430 Workshop - Interrupts 5 - 45

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