Lab 05 Worksheet (1)
General Interrupt Questions
1. When your program is not in an interrupt service routine, what code is it
usually executing? And, what ‘name’ do we give this code?
______________________________________________________
2. Why keep ISR’s short (i.e. not do a lot of processing in them)?
______________________________________________________
______________________________________________________
______________________________________________________
3. What causes the MSP430 to exit a Low Power Mode (LPMx)?
______________________________________________________
4. Why are interrupts generally preferred over polling?
______________________________________________________
______________________________________________________
main functions while{} loop. We often call this ‘background’ processing.
We don’t want to block other interrupts. The other option is nesting
interrupts, but this is INEFFICIENT. Do interrupt follow-up processing in
while{} loop … or use TI-RTOS kernel.
Interrupts
They are a lot more efficient. Polling ties up the CPU – even worse it
consumes power waiting for an event to happen.
Lab 05 Worksheet (2)
Interrupt Flow
5. Name 3 more sources of interrupts?
______________________________________________________
______________________________________________________
______________________________________________________
______________________________________________________
6. What signifies that an interrupt has occurred?
A __________ bit is set
What’s the acronym for these types of ‘bits” ___________
7. Write the code to enable a GPIO interrupt on Port 1, pin1 (aka P1.1)?
___________________________________ // setup pin as input
___________________________________ // clear individual INT
___________________________________ // enable individual INT
Timer_A
GPIO
Watchdog Interval Timer
Analog Converter … and many more
flag
IFG
GPIO_setAsInputPinWithPullUpresistor(GPIO_PORT_1, GPIO_PIN1);
GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1);
GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN1);