AnsweredAssumed Answered

WDOG Reconfigure

Question asked by Patrick Foley on Sep 2, 2014
Latest reply on Apr 2, 2015 by David Sherman

I am trying to reconfigure the WDOG.  I have been trying to get the following code to work, but I end up getting a reset as soon as I try to write the first unlock value.  I can't figure out what is going on, any help would be appreciated.




*void WDOGInit(void)



*   Return: NONE


*   Parameters: NONE


*   Notes:



void WDOGInit(void) {



/*Disable the interrupts*/   
asm("CPSID i");    


/*Unlock the WDOG to reconfigure it*/
WDOG_CNT = 0xC520;       /*First Unlock Word*/ 
WDOG_CNT = 0xD928;       /*Second Unlock Word*/                 
/*Set the timeout value to 10 mS*/
WDOG_TOVAL = 1000;          
/*Set the clock to the 1KHz LPOCLK*/
//WDOG_CS2 = 0x01;


/*Enable the Dog*/
/*Enable the interrupts*/
asm("CPSIE i");


} /* end void WDOGInit(void) */