I came across this sample code(msp430g2553.h) wherein the watchdog resets the controller even as the controller is in sleep mode.
#include <msp430.h>
int main(void)
{
P1DIR |= 0x01; // Set P1.0 to output
P1OUT ^= 0x01; // Toggle P1.0
__bis_SR_register(LPM4_bits); // Stop all clocks
}
The explanation to this code is as following " The WDT+ will not allow active WDT+ clock to be disabled by software, the LED continues to Flash because the WDT times out normally even though software has attempted to disable WDT+ clock source"
I am confused here as how can SMCLK is still working considering the mode is LPM 4.
Moreover, upon checking the register values, it shows that the MCU is not in LPM 4 rather LPM 3