Can't get WWDT on LPC4357 to start

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't get WWDT on LPC4357 to start

478 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dsw on Thu Dec 26 15:33:54 MST 2013
I’m having trouble getting the watchdog timer to start on the LPC4357.
I use the code:


void Main_Watchdog_Init(void)

   LPC_WWDT->TC = 0xffff;           //relatively small value for timeout.
   LPC_WWDT->MOD =                 //See page 964 of LPC4357 spec
                                       (1 << 1)    //Watchdog timeout will cause a chip reset.
                                     +(1 << 4);
   LPC_WWDT->MOD =                //See page 964 of LPC4357 spec
                                      (1 << 0);  //Enable watchdog timer.
   Main_Watchdog_Feed();            //Feeding the watchdog once should start it.

   LPC_WWDT->FEED = 0x01;        //This should cause immediate reset.
   LPC_WWDT->FEED = 0x02;
   LPC_WWDT->FEED = 0x03;
}


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static __INLINE void Main_Watchdog_Feed(void)
{
     LPC_WWDT->FEED = 0xAA;
     LPC_WWDT->FEED = 0x55;
}


but the watchdog timer never starts decrementing, LPC_WWDT->TV never changes from its reset value of 0x000000FF.
Even though I never feed the watchdog again, I never get a reset.
Thru the debugger I can verify that LPC_WWDT->MOD = 0x00000013, which should be the correct value to enable it to run.
Can anyone think of something I’m missing?
Thanks
Labels (1)
0 Kudos
2 Replies

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dsw on Fri Dec 27 10:00:40 MST 2013
I figured out what was going on.
The problem occurs only when I set the WDPROTECT bit, bit 4 in LPC_WWDT->MOD.
Setting the WDPROTECT bit prevents the watchdog from starting.
Page 964 of LPC4357 spec sheet ver 1.6. states that WDPROTECT bit only contols when LPC_WWDT->TC can be changed, but it looks like there are problems in the implementation.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dsw on Fri Dec 27 09:59:17 MST 2013
I figured out what was going on.
The problem occurs only when I set the WDPROTECT bit, bit 4 in LPC_WWDT->MOD.
Setting the WDPROTECT bit prevents the watchdog from starting.
Page 964 of LPC4357 spec sheet ver 1.6. states that WDPROTECT bit only contols when LPC_WWDT->TC can be changed, but it looks like there are problems in the implementation.
0 Kudos