The MSP430 microcontroller dedicates a segment of the memory for the interrupt sub-routine (ISR) vectors.This segment of memory contains the addresses for the ISR associated with the corresponding interrupts, allowing for the interrupt to trigger the ISR vector and executing the ISR defined at the stored addresses. Even if some of these interrupts are not used in the application, the ISR vectors should be initialized and assigned properly to ensure all interrupts, whether application-intended or accidental, can be vectored,captured, and executed properly to prevent any erroneous behaviors in the application.
An uninitialized ISR vector when triggered could lead to jumping to unknown addresses, execution of erroneous code which at the very least could lead to application crashing, unexpected application behavior, or more severely memory erasure or electrical damage.
At least one of the ISR vector was detected to be
un-initialzed.
#pragma vector=unused_interrupts __interrupt void ISR_trap(void) { /* For debugging purposes, you can trap the CPU & code execution here with an infinite loop */ while (1); /* If a reset is preferred, in scenarios where you want to reset the entire system and restart the application from the beginning, use one of the following lines depending on your MSP430 device family, and make sure to comment out the while (1) line above */ /* If you are using MSP430F5xx or MSP430F6xx devices, use the following line to trigger a software BOR. */ PMMCTL0 = PMMPW | PMMSWBOR; // Apply PMM password and trigger SW BOR /* If you are using MSP430 devices that are part of the 1xx/2xx/4xx families use the following line of code to cause an access violation which results in a PUC reset */ WDTCTL = 0; // Write to WDT with a wrong password } |
Note that the recommended ISR handling codes are different depending on the MSP430 platforms (1xx/2xx/4xx use Watch Dog Timer (WDT) to cause a Power Up Clear (PUC) reset, 5xx/6xx can also use the Power Management Module (PMM) to trigger software Brown Out Reset (BOR).
Refer to our following code example for guidance on using and initializing interrupt vectors.
processors.wiki.ti.com/index.php/File:Msp430_initialize_unused_interrrupt_vectors.zip
See the rest of the code examples for all MSP430 devices here!
Leverage the e2e (Engineer-to-Engineer) online community to get all of your MSP430 questions answered! Or, if you are an MSP430 pro user, give back to the community with your expertise.