Lab 5 – Interrupts
8. Write the line of code required to turn on interrupts globally:
___________________________________ // enable global interrupts (GIE)
Where, in our programs, is the most common place we see GIE enabled? (Hint, you can look
back at the slides where we showed how to do this.)
__________________________________________________________________________
Interrupt Priorities & Vectors
9. Circle interrupt has higher priority: GPIO Port 2 or WDT Interval Timer?
Let’s say you’re CPU is in the middle of the GPIO Port 2 ISR, can it be interrupted by a new
WDT interval timer interrupt? If so, is there anything you could do to your code in order for
this to happen?
__________________________________________________________________________
__________________________________________________________________________
10. Where do you find the name of an “interrupt vector”?
__________________________________________________________________________
11. How do you write the code to set the interrupt vector? (Hint, we’ve provided a simple ISR to
go with the line of code we’re asking you to complete.)
// Sets ISR address in the vector for Port 1
________________________________________________________________________
__interrupt void pushbutton_ISR (void)
{
// Toggle the LED on/off
GPIO_toggleOutputOnPin( GPIO_PORT_P1, GPIO_PIN0 );
}
What is wrong with this GPIO port ISR?
__________________________________________________________________________
__________________________________________________________________________
12. How do you pass a value into (or out from) and interrupt service routine (ISR)?
__________________________________________________________________________
#pragma
5 - 40 MSP430 Workshop - Interrupts