3 Replies Latest reply on Jun 23, 2016 9:15 PM by steven.ng_1656861

    CY8C4245 Watchdog

    steven.ng_1656861

      I want to use the WDT interrupt in wdt counter 0 and WDT reset in wdt counter 1 but after initialize, it will go to infinite loop can't reset.

         

      If I just enable EDT interrupt in wdt counter 0, it will no problem.  Below is my config code of the watchdog timer

         

          CySysWdtDisable(CY_SYS_WDT_COUNTER0_MASK);
          while (CySysWdtReadEnabledStatus(0));

         

          CySysWdtWriteMode(CY_SYS_WDT_COUNTER0,CY_SYS_WDT_MODE_INT);
          CySysWdtWriteMatch(CY_SYS_WDT_COUNTER0,WDT_INTERVAL_1MS); // WDT interval  Timer = 1msec in counter 0
          CySysWdtWriteClearOnMatch(CY_SYS_WDT_COUNTER0, 1u);
          CySysWdtWriteCascade(CY_SYS_WDT_CASCADE_NONE);
          
          //Enable WDT counter 0 
          CySysWdtEnable(CY_SYS_WDT_COUNTER0_MASK);

         

          CySysWdtWriteMode(CY_SYS_WDT_COUNTER1,CY_SYS_WDT_MODE_INT);
          CySysWdtWriteMatch(CY_SYS_WDT_COUNTER1,WDT_1S); // WDT Timer = 1sec in counter 1
          CySysWdtWriteClearOnMatch(CY_SYS_WDT_COUNTER1, 1u);
          CySysWdtWriteCascade(CY_SYS_WDT_CASCADE_NONE);

         

          //Enable WDT counter 1 
          CySysWdtEnable(CY_SYS_WDT_COUNTER1_MASK);

         

          // Lock WDT registers
          CySysWdtLock();