Lab 5 – Interrupts
Lab 5 – Interrupts
This lab introduces you to programming MSP430 interrupts. Using interrupts is generally one of
the core skills required when buiding embedded systems. If nothing else, it will be used
extensively in later chapters and lab exercises.
Lab 5 – Button Interrupts
Lab Worksheet… a Quiz, of sorts:
Interrupts
Save/Restore Context
Vectors and Priorities
Lab 5a – Pushing your Button
Create a CCS project that uses an interrupt
to toggle the LED when a button is pushed
This requires you to create:
o Setup code enabling the GPIO interrupt
o GPIO ISR for pushbutton pin
You’ll also create code to handle all the
interrupt vectors
Optional
Lab 5b – Use the Watchdog Timer
Use the WDT in interval mode to
blink the an LED
Time:
Worksheet – 15 mins
Labs – 45 mins
Lab 5a covers all the essential details of interrupts:
− Setup the interrupt vector
− Enable interrupts
− Create an ISR
When complete, you should be able to push the SW1 button and toggle the Red LED on/off.
Lab 5b is listed as optional since, while these skills are valuable, you should know enough at the
end of Lab 5a to move on and complete the other labs in the workshop.
MSP430 Workshop - Interrupts 5 - 37