I can't seem to get WDT to work. It trips as soon as I clear the counter.
I'm using CCS 5.3.0.00090, and the MSP FET430UIF.
Code:
main{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
msp430_init(); // Set up DCO and configure ports
__bis_SR_register(GIE); // Interrupts enabled
IFG1 &= ~WDTIFG; // Clear WDT Interrupt flag
IE1 |= WDTIE; // Enable WDT Interrupt
WDTCTL |= WDTPW + WDTCNTCL + WDTHOLD; // Clear WDT Counter- Don't start WDT.
while(1)
{
WDTCTL = WDTPW + WDTCNTCL; //Start watchdog
}
}
SMCLK is running at 4 Mhz..
I put a break point in the while loop, and execution never makes it that far. As soon as I clear the WDT (even while keeping the hold bit set "WDTCTL = WDTPW + WDTHOLD;" ), the controller resets and the PC is pointing back to the first line of code.
Is the FET causing my problems, or am I doing something really stupid?