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)
#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.