how to check watchdog timer reset

could any one please guide me how can i stop, start and reset the watchdog timer…I am doing like that.

#define WDTFLAG 0x0088

main()

{

WDTCTL=WDTPW+WDTHOLD; /* stop watchdog timer */

//creating a task

xTaskcreate(vTest, “T”);

vTaskScheduler();

}

void vTest()

{

IFG1 &=WDTIFG;

WDTCTL=WDT_MRST_32 + WDTFLAG; /*kick the watch dog in watchdog mode (enable the Watchdog ) 32ms interval (default)

WDT is clocked by fMCLK (assumed 1MHz) */

for(;:wink:

{

LED1_ON();

vTaskDelayUntil(…)//suppose 100 ms.

LED1_OFF();

}

}

now how can i check that watchdog timer reseted? or how can i reset it? plz comment on that…thanks for every one’s help–

WDT_MRST_32 is defined as 0x5A08

WDTFLAG is defined as 0x0088

Thus WDT_MRST_32+WDTFLAG means 0x5A08+0x0088=0x5A90

Do you mean you want to send 0x5A90 to WDTCTL?

If so, this will do it. But it is a rather obscure way of saying it.

Actually My intention is to set the timer and then as it is mentioned it will reset the evy thing after the (WDT_MRST_32) 32 ms…and it will go in to the infinite for loop and trun on the LED1…when timer expired it will start from the main program again and so on…

but I just got LED1 ON one time when i program the device then goes to sleep forever…if i unplug-plug the USB LED1 blink one time then keep sleep forever…

I do not understand why its like that…please comments thanks for your help-…

the updated code is as follow…

thx

main()

{

WDTCTL=WDTPW+WDTHOLD; /* stop watchdog timer */

//creating a task

xTaskcreate(vTest, “T”);

LED1_OFF();

vTaskScheduler();

}

void vTest()

{

IFG1 &=WDTIFG;

WDTCTL=WDT_MRST_32; /*kick the watch dog in watchdog mode (enable the Watchdog ) 32ms interval (default)

WDT is clocked by fMCLK (assumed 1MHz) */

for(;; )

{

LED1_ON();

}

}

#include <msp430x13x.h>
#define LED_ON P1OUT |= 0x01; P1DIR |= 0x01;
#define LED_OFF P1OUT &= ~0x01; P1DIR |= 0x01;

void main(void)
{
  WDTCTL = 0x5A80; // hold WDT
  LED_OFF;
  for (volatile int i = 0; i<10000; i++)
  {
  } // wait for a while with LED off
  LED_ON;
  WDTCTL = 0x5A08; // clear and start WDT 
  for (;;)
  {
  } // wait forever with LED on
}

My hardware may be different from yours. Check the #define lines first.