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.

MSP430FR2355: WDT ?

Part Number: MSP430FR2355

I have only used the WDT as an interval timer before and would like to use it as a watchdog.  The simple application program example in Resource Explorer doesn't seem to answer my questions.

I would like to set up the watchdog using ACLK and one second....

1.  Can I use the watchdog as a watchdog with different time intervals as expressed with the WDTIS bits or are these bits strictly for timer interval only?

2.  Is there any need to have the WDT ISR when using the watchdog as a watchdog or is that strictly for timer mode?

3.  Should I be writing the WDTCNTCL bit (if #2 above is true) within that ISR?

4.  To kick watchdog n my main loop should I be constantly writing WDTCTL with 0x5A2C?....which selects ACLK, clears counter and keeps it set for 1 second...

5.  How, if at all, do I need to address the IFG?  

6.  Should I be setting WDTCTL as first line of code during the configuration before LPM3? Also on this note should I be setting the IE here as well?  Does GIE need to be set for this to work?

Thanks

  • Here is example code trying to implement a 16 second reboot in the event that software hangs.  This is the ONLY place my software reboots...When I place in the application code I see every 1/2 second I am rebooting.  Can someone tell me what I am missing??

    #include <msp430.h>
    
    int main(void)
    {
        WDTCTL = WDTPW | WDTHOLD;   // stop watchdog timer
        
        //configuration and setup up to 1 second
        
        WDTCTL = WDTPW | WDTSSEL__ACLK | WDTTMSEL | WDTCNTCL | WDTIS_3; //aclk, 16 sec timer
        SFRIFG1 &= ~WDTIFG;
        SFRIE1 |= WDTIE;
    
        while(1)
        {
            LPM3;
    
            WDTCTL |= WDTPW | WDTCNTCL;  //kick wdt
    
            //application software
        } 
    }
    
    //a bunch of ISRs
    
    #pragma vector = WDT_VECTOR
    __interrupt void LockUp_ISR(void)
    {
        WDTCTL = 0xDEAD; //reset device
    }
  • The user guide covers use of the WDT in great detail. If that isn't enough, there should be an example of its use in the code examples available from TI. www.ti.com/.../slac740

  • I've been to both and neither answered my questions....

    Seems that the problem with my above example is trying to write

    WDTCTL using " |= " causes a reboot.....

    Apparently you need " = "

  • Then you missed this in the user guide: "Any read of WDTCTL reads 069h in the upper byte."

**Attention** This is a public forum