Part Number: CC430F5137
Hi,
I am trying to set WDT using CC430F5137. I have a timing problem between interval mode and watchdog mode. When I use interval mode and set the WDT to 1000ms. It it correctly work and WDT interrupt occurs every 1000ms .The code is following:
WDTCTL = WDT_ADLY_1000;
SFRIFG1 &= ~WDTIFG;
SFRIE1 |= WDTIE;
P2OUT ^= BIT4; // Toggle P1.0 using exclusive-OR
__bis_SR_register(LPM3_bits + GIE); // Enter LPM3, enable interrupts
__no_operation(); // For debugger
}
// Watchdog Timer interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = WDT_VECTOR
__interrupt void WDT_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(WDT_VECTOR))) WDT_ISR (void)
#else
#error Compiler not supported!
#endif
{
P2OUT ^= BIT4; // Toggle P1.0 using exclusive-OR
}
Then when I change WDT mode as "Watchdog mode". Reset occurs every ~3400 ms. The code is following:
WDTCTL = WDT_ARST_1000;
SFRIFG1 &= ~WDTIFG;
SFRIE1 |= WDTIE;
P2OUT ^= BIT4; // Toggle P1.0 using exclusive-OR
__bis_SR_register(LPM3_bits + GIE); // Enter LPM3, enable interrupts
__no_operation(); // For debugger
}
// Watchdog Timer interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = WDT_VECTOR
__interrupt void WDT_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(WDT_VECTOR))) WDT_ISR (void)
#else
#error Compiler not supported!
#endif
{
P2OUT ^= BIT4; // Toggle P1.0 using exclusive-OR
}
. I checked 32kHz oscillator. There is no problem about it. Can you help me about this issue? What's the reason?