lpcware

stuck in WD interrupt

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by 12345 on Mon Jul 11 20:30:57 MST 2011
Program stuck in WD interrupt handler!
  How can I jump out from the WD interrupt handler?

void WDTInit( void )
{
  LPC_SYSCON->SYSAHBCLKCTRL |= (1<<15);

  wdt_counter = 0;

  /* Enable the WDT Interrupt */
  NVIC_EnableIRQ(WDT_IRQn);

  LPC_WDT->TC = WDT_FEED_VALUE;//timer constant register 1.576Sec /* once WDEN is set, the WDT will start after feeding */
  LPC_WDT->MOD=0x00;
  LPC_WDT->MOD=WDEN;

  LPC_WDT->FEED = 0xAA;/* Feeding sequence */
  LPC_WDT->FEED = 0x55;   

  return;
}



void WDT_IRQHandler(void)
{

  //UARTSendOne(0x13);
  if (LoadCG==0)
  {
  NVIC_SystemReset();
  }

   NVIC_DisableIRQ(WDT_IRQn);// Disable the watchdog- interrupt flag cannot
  // be cleared except by reset

   LPC_WDT->MOD &= ~WDTOF;/* clear the time-out interrupt flag */
                                //reset to zero watchdog timeout flag//
   LPC_WDT->MOD &= ~WDINT;/* clear the time-out flag and interrupt flag */
   //wdt_counter++;
   LPC_WDT->FEED = 0xAA;/* Feeding sequence */
   LPC_WDT->FEED = 0x55;
   //WDTFeed();

}

Outcomes