Patrick Birkner

Watchdog doesn't  Reset (MCF52259)

Discussion created by Patrick Birkner on Sep 9, 2011
Latest reply on Sep 12, 2011 by Patrick Birkner



Im using the watchdog on the MCF52259.


I've generated the simple code with processor expert to reset the CPU with WD:


#define WDog_Enable() (setReg16Bit(WCR,EN),ERR_OK)


byte WDog_Clear(void)
  if (!testReg16Bits(WCR,1)) {         /* Is WDT disabled? */
    return ERR_DISABLED;               /* If yes then error */
  setReg16(WSR,0x5555);                /* Write first key */
  setReg16(WSR,0xAAAA);                /* Write second key */
  return ERR_OK;                       /* OK */


I've tested the watchdog function with a simple for loop, which is entered if I press a button. After entering the loop for specified time, the Watchdog resets the CPU and everything works fine.


Now I've implemented it and did some tests (EMC and that stuff). During surge-tests the CPU always hang up, so I've implemented the WD like written before. But the problem is, that the WD doesn't reset the CPU although it works fine on my desk (tested like written above with for-loop). Is there anything else to care about? Is the WD disabled if there is any other interrupt which may occure?


If I reset the CPU via RSTIN-Pin in this hang-up-state it restarts works fine again.



Thanks for help.