I setup the SVM on the MSP430F6779A to give an interrupt if the supply voltage drops below 2.9V. as shown below:
//unlock PMM
PMMCTL0_H=PMMPW_H;
//check voltage level
switch(PMMCTL0&PMMCOREV_3){
//settings for highest core voltage settings
case PMMCOREV_3:
//setup high side supervisor and monitor
SVSMHCTL=SVMHE|SVSHE|SVSHRVL_3|SVSMHRRL_7;
break;
}
//clear interrupt flags
PMMIFG&=~(SVMLIFG|SVMHIFG|SVMHVLRIFG|SVMLVLRIFG);
//setup interrupts
PMMRIE|=SVMLIE|SVMHIE|SVMHVLRIE|SVMLVLRIE;
//lock PMM
PMMCTL0_H=0;
In the SYSNMI_VECTOR I set a flag for software if I see the low voltage interrupts from the SVM when the voltage comes back up I clear the flags from the module:
//================[System NMI Interrupt]=========================
void SYS_NMI(void)__ctl_interrupt[SYSNMI_VECTOR]{
switch(SYSSNIV){
//core supply voltage monitor interrupt
case SYSSNIV_SVMLIFG:
//event to report error
//set flag
break;
//input supply voltage monitor interrupt
case SYSSNIV_SVMHIFG:
//event to report error
//set flag
break;
//core supply voltage monitor delay interrupt
case SYSSNIV_DLYLIFG:
break;
//interrupt supply voltage monitor delay interrupt
case SYSSNIV_DLYHIFG:
break;
//Vacant memory access interrupt
case SYSSNIV_VMAIFG:
break;
//JTAG mailbox in interrupt
case SYSSNIV_JMBINIFG:
break;
//JTAG mailbox out interrupt
case SYSSNIV_JMBOUTIFG:
break;
//SVMLVLRIFGSVMHVLRIFG
case SYSSNIV_VLRLIFG:
//clear interrupt flag bits
//unlock PMM
PMMCTL0_H=PMMPW_H;
//clear interrupt flags
PMMIFG&=~(SVMLIFG|SVMLVLRIFG);
//lock PMM
PMMCTL0_H=0;
break;
//SVMHVLRIFGSVMHVLRIFG
case SYSSNIV_VLRHIFG:
//clear interrupt flag bits
//unlock PMM
PMMCTL0_H=PMMPW_H;
//clear interrupt flags
PMMIFG&=~(SVMHIFG|SVMHVLRIFG);
//lock PMM
PMMCTL0_H=0;
break;
}
}
When the voltage is lowered below about 3V I see the flag from the interrupt. If I bring the voltage back up to 3.3V and then down again I do not get any more interrupts. If I take the voltage all the way down to 2V the MSP resets and doesn't come on until the voltage raises above 3V. Is there something I need to do to get multiple SVM interrupts or do I have to reset when this happens?