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.

MSP430G2231: Using Watchdog in timer mode, but it resets my program

Other Parts Discussed in Thread: MSP430G2231

Hi,

 

I need two timer, one for display refresh, ticking at 8ms and the other for keeping time, at 1s.

I am using the WDT for the 8ms timer and TimerA for the 1s.

 

Problem is, the WDT keeps on resetting my design. Am I forgetting something basic here?

 

Thanks for your help.

Anirban

 

This is the code:

 

int main (){

   WDTCTL = WDT_MDLY_8;            // watchdog timer: timer mode 8 millisecond

 

    TACCR0 = 61875;                 
    TACCTL0 = CCIE;                  //CCR0 interrupt enable

    TACTL = TASSEL_2 +        
                ID_3 +          
                MC_3 +             //select up/down mode
                TACLR +       
                TAIE;

    IE1 = WDTIE;
    __enable_interrupt();

}

#pragma vector = WDT_VECTOR
__interrupt void WDT_ISR (void){


//handler code

      
}

 

#pragma vector = TIMERA0_VECTOR
__interrupt void TIMERA0_ISR(void) {

  //handler code
   
}

 

 

**Attention** This is a public forum