This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using ACLK for watchdog timer mode without having external crystal installed.

Other Parts Discussed in Thread: MSP430G2452

I want to use this code:

#include <msp430g2452.h>


void main(void)
{
WDTCTL = WDT_ADLY_250; // WDT 250ms, ACLK, interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR |= 0x01; // Set P1.0 to output direction

_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/interrupt
}

// Watchdog Timer interrupt service routine
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
}

but since i dont use crystal will it work?

  • The code won't work as is, you'll need to change it to use the VLO as the ACLK source. Take a look at chapter 5 (Basic Clock Module+) in the MSP430x2xx Family User's Guide for details on how to do that.

    Having said that, the VLO frequency is lower than the 32768-Hz watch crystal, and it's a lot less stable. If you just want to wake up the CPU every so often and the exact timing is irrelevant then the VLO is ideal. If you want to do precision timing you would be better off using a crystal or the one of the calibrated DCO frequencies.

  • Robert Cowsill said:
    The code won't work as is, you'll need to change it to use the VLO as the ACLK source.

    It should be noted that on 5x/6x family (unified clock system UCS), a missing/failing crystal on the selected ACLK (or SMCLK) source automatically switches ACLK (or SMCLK) to either REFO (if it was LFXT1) or DCODIV (if it was HFXT1 or XT2). This fail-safe fallback is on 1x, 2x or 4x family only available for MCLK.

**Attention** This is a public forum