Lab 5 – Interrupts
ISR’s for Group Interrupts
As we learned earlier, most MSP430 interrupts are grouped. For example, the GPIO port
interrupts are all grouped together.
13. For dedicated interrupts (such as WDT interval timer) the CPU clears the IFG flag when
responding to the interrupt. How does an IFG bit get cleared for group interrupts?
__________________________________________________________________________
__________________________________________________________________________
14. Creating ISR’s for grouped interrupts is as easy as following a ‘template’. The following code
represents a grouped ISR template. Fill in the blanks required for the CPU to toggle the LED
(P1.0) in response to a GPIO pushbutton interrupt (P1.1).
#pragma vector=PORT1_VECTOR
__interrupt void pushbutton_ISR (void) {
switch(__even_in_range( ____________, 10 )) {
case 0x00: break; // None
case 0x02: break; // Pin 0
case 0x04: //break; // Pin 1
______________________________________________________
break;
case 0x06: break; // Pin 2
case 0x08: break; // Pin 3
case 0x0A: break; // Pin 4
case 0x0C: break; // Pin 5
case 0x0E: break; // Pin 6
case 0x10: break; // Pin 7
default: _never_executed();
}
MSP430 Workshop - Interrupts 5 - 41