It is working perfectly but i have some doubt in this SYSRSTIV comes 0x0016 when we come of the ieration but after if condition SYSTSTIV comes like 0x000 why? can you please explain
#include <msp430.h>
int main(void) {
// WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
if (SYSRSTIV ==SYSRSTIV_WDTTO) {
switch(SYSRSTIV_WDTTO){
case SYSRSTIV_NONE: /* No Interrupt pending */
_no_operation();
break;
case SYSRSTIV_BOR : /* SYSRSTIV : BOR */
_no_operation();
break;
case SYSRSTIV_RSTNMI: /* SYSRSTIV : RST/NMI */
_no_operation();
break;
case SYSRSTIV_DOBOR: /* SYSRSTIV : Do BOR */
_no_operation();
break;
case SYSRSTIV_LPM5WU: /* SYSRSTIV : Port LPM5 Wake Up */
_no_operation();
break;
case SYSRSTIV_SECYV : /* SYSRSTIV : Security violation */
_no_operation();
break;
case SYSRSTIV_RES0C: /* SYSRSTIV : Reserved */
_no_operation();
break;
case SYSRSTIV_SVSHIFG: /* SYSRSTIV : SVSHIFG */
_no_operation();
break;
case SYSRSTIV_RES10: /* SYSRSTIV : Reserved */
_no_operation();
break;
case SYSRSTIV_RES12: /* SYSRSTIV : Reserved */
_no_operation();
break;
case SYSRSTIV_DOPOR: /* SYSRSTIV : Do POR */
_no_operation();
break;
case SYSRSTIV_WDTTO: /* SYSRSTIV : WDT Time out */
_no_operation();
break;
case SYSRSTIV_WDTKEY: /* SYSRSTIV : WDTKEY violation */
_no_operation();
break;
case SYSRSTIV_FRCTLPW: /* SYSRSTIV : FRAM Key violation */
_no_operation();
break;
case SYSRSTIV_UBDIFG: /* SYSRSTIV : FRAM Uncorrectable bit Error */
_no_operation();
break;
case SYSRSTIV_PERF: /* SYSRSTIV : peripheral/config area fetch */
_no_operation();
break;
case SYSRSTIV_PMMPW: /* SYSRSTIV : PMM Password violation */
_no_operation();
break;
case SYSRSTIV_MPUPW: /* SYSRSTIV : MPU Password violation */
_no_operation();
break;
case SYSRSTIV_CSPW: /* SYSRSTIV : CS Password violation */
_no_operation();
break;
case SYSRSTIV_MPUSEGPIFG: /* SYSRSTIV : MPUSEGPIFG violation */
_no_operation();
break;
case SYSRSTIV_MPUSEGIIFG: /* SYSRSTIV : MPUSEGIIFG violation */
_no_operation();
break;
case SYSRSTIV_MPUSEG1IFG: /* SYSRSTIV : MPUSEG1IFG violation */
_no_operation();
break;
case SYSRSTIV_MPUSEG2IFG: /* SYSRSTIV : MPUSEG2IFG violation */
_no_operation();
break;
case SYSRSTIV_MPUSEG3IFG: /* SYSRSTIV : MPUSEG3IFG violation */
_no_operation();
break;
case SYSRSTIV_ACCTEIFG: /* SYSRSTIV : ACCTEIFG access time error */
_no_operation();
break;
default:
break;
}
}
while(1);
}