Part Number: MSP432P401R
Hi
I am trying to set the wqtchdog timer overflow as a soft reset.hence I am checking the RSTCTL_SOFTRESET_STAT_SRC1 register.If there is a 1 in bit position 1 it means the source of reset is watchdog soft reset.
But what I hv observed is thet even before the reset occurs the value in RSTCTL_SOFTRESET_STAT_SRC1 is a 1 indicating a rsest.I tried clearing it through the statement RSTCTL->SOFTRESET_CLR = 2;but does not clear .How to clear the watchdog RSTCTL_SOFTRESET_STAT_SRC1 register bit 1.
void main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
rst = RSTCTL_SOFTRESET_STAT_SRC1; //value here is 2
RSTCTL->SOFTRESET_CLR = 2;
rst = RSTCTL_SOFTRESET_STAT_SRC1; //value here should be 0 but appears as 2,whcih means SRC1 is not clearing
if(rst == 2)
{ //if watchdog overflows this flag is set
RSTCTL->SOFTRESET_CLR = 2;
WATCHDOG_Reset_Indicator();
}
WATCHDOG_Init();