I am trying to setup a basic watchdog timer. Here we go, MSP430 F5310.
Let's start with something simple and setup for a reset PUC of 16 seconds. So here's what I will use. The ACLK is based on the 32KHz XTAL1. XT1 LF mode.
UCSCTL4 = 0x44; This means ACLK is set is set to 000b which is XT1CLK.
Here's the code:
int main(void) {
unsigned int p=0;
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
unsigned int value = UCSCTL4;
WDTCTL = WDTPW | 0x23; // select ACLK as watchdog source 011b = 16s @ 32.768kHz
while(1);
return 0;
}
But it is not triggering at 16s. It's more like a minute or so. I also tried switching to use the SMCLK which is based on the system clock but that timing also is not right when I do the calculations. So why doesn't it work?