This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Not Reliable Watchdog

Hi,

I am utilise Watchdog Timer to reset when something goes wrong, but I found that watchdog in LPC2138 is not reliable. Does any one has issue with Watchog Timer in LPC2138?

The following is my Setting at start of program:

    WDTC   = 0x01FFFFFF;  // Setting Timer
    WDMOD  = 0x03;        // Reset and Interrupt
    WDFEED = 0xAA;        // Sequence Feeding
    WDFEED = 0x55;        // Sequence Feeding

Then every interval one second feed the watchdog as follow:

    WDFEED = 0xAA;
    WDFEED = 0x55;

The problem is watchdog reset un-reliable. The following is the log:

Ext,Last Reset:20 Feb 2009 10:36:43
WDT,Last Reset:20 Feb 2009 10:43:29
WDT,Last Reset:20 Feb 2009 10:48:47
WDT,Last Reset:20 Feb 2009 10:54:05
WDT,Last Reset:20 Feb 2009 10:59:23

Above log data is in my application that trace current situation. Ext is external reset just after down load program in device. WDT is reset because of Watchdog timer.

Is there any idea or errata note regarding watchdog timer?

Rudy

Parents
  • Hi Per Westermark,

    You are correct, I have to disable all Interrupts because of bug in the device.

    The following is the feeding register. So far no watchdog reset triggered. But this kind of test need days or weeks to find out either Ok or still have some issue.

    void Feed_WatchDog(void) {
      unsigned int liCurrISR;
      if (!giResetNow) {
        tsk_lock ();
        liCurrISR = VICIntEnable;
        VICIntEnClr = liCurrISR;
        WDFEED = 0xAA;
        WDFEED = 0x55;
        VICIntEnable = liCurrISR;
        tsk_unlock ();
      }
    }
    

    If you notice, I disable all isr after I lock task then return all isr values before unlock task.

    Also, I have variable flag "giResetNow", if this variable is set, the feeding section never been served. And the watchdog will reset the device.

    Is there any other better way to achive disable isr and reset the device?

Reply
  • Hi Per Westermark,

    You are correct, I have to disable all Interrupts because of bug in the device.

    The following is the feeding register. So far no watchdog reset triggered. But this kind of test need days or weeks to find out either Ok or still have some issue.

    void Feed_WatchDog(void) {
      unsigned int liCurrISR;
      if (!giResetNow) {
        tsk_lock ();
        liCurrISR = VICIntEnable;
        VICIntEnClr = liCurrISR;
        WDFEED = 0xAA;
        WDFEED = 0x55;
        VICIntEnable = liCurrISR;
        tsk_unlock ();
      }
    }
    

    If you notice, I disable all isr after I lock task then return all isr values before unlock task.

    Also, I have variable flag "giResetNow", if this variable is set, the feeding section never been served. And the watchdog will reset the device.

    Is there any other better way to achive disable isr and reset the device?

Children