3 Replies Latest reply on Aug 27, 2019 2:42 AM by VasanthR_91

    CE224703 PSOC4 WDT work on -042 kit but on on -044 kit

    MiRo_263836

      I am trying to implement a WDT interrupt on a P4100M device.  I found the code example CE224703 - PSOC4 WDT.   It produces the output in the pdf on the CY8CKIT-042 kit. The WDT interrupt sets a flag and in the main loop it checks the flag and increments a count and displays it then clears the flag.

       

      CY_ISR(ISR_WatchDog)

      {

          /* Sets flag for printing the current count status of the Watchdog Timer */

          currentStatus = 1u;

         

          /* Clear interrupts state and pending interrupts */

          CySysWdtClearInterrupt(CY_SYS_WDT_COUNTER0_INT);

          CyIntClearPending(interruptNumWDT);

      }

       

      main loop

         for(;;)

          {

              /* Print current count status of the Watchdog Timer if flag is set to 1 */

              if(currentStatus != 0)

              {

                  sprintf(snum, "%lu" ,CySysWdtReadCount(1u));

                  UART_UartPutString(snum);

                  currentStatus = 0u;

              }

          }

       

       

      Then I followed the instructions to target for my CY8CKIT-044 kit with the CY8C4247-AZI_M485 and select the UART pins P70 and P71.

       

      This is my TeraTerm output

      It looks like the WDT interrupt is not happening so the flag isn't set and the main loop doesn't display the Timer 1 count

       

      What is the difference in the WDT for the 4200 and 4200M. 

       

      Thanks,
      Mike Roberts

        • 1. Re: CE224703 PSOC4 WDT work on -042 kit but on on -044 kit
          NoriakiT_91

          The IRQ number is specified in the "main.c" file as follows.

          /*******************************************************************************
          *            Constants
          *******************************************************************************/
          #define interruptNumWDT 9
          

           

          This is TRUE for PSoC 4200.  The Architecture TRM says as follows.

          GS004483.png

          PSoC 4100/4200 Family PSoC 4 Architecture TRM, Document No. 001-85634

           

          But the IRQ number of PSoC 4200M was changed as follows.

          GS004484.png

          PSoC 4100M/4200M Family PSoC 4 Architecture TRM, Document No. 001-95223

           

          So, the IRQ number must be changed in the main.c file.

          /*******************************************************************************
          *            Constants
          *******************************************************************************/
          #define interruptNumWDT 7
          

           

          Or, it is recommended to use the auto-generated ISR as follows.

           

          //CY_ISR(ISR_WatchDog)
          //{
          //    /* Sets flag for printing the current count status of the Watchdog Timer */
          //    currentStatus = 1u;
          //    
          //    /* Clear interrupts state and pending interrupts */
          //    CySysWdtClearInterrupt(CY_SYS_WDT_COUNTER0_INT);
          //    CyIntClearPending(interruptNumWDT);
          //}
          void Watchdog_Callback(void) {
              /* Sets flag for printing the current count status of the Watchdog Timer */
              currentStatus = 1u;
          }
          

           

              /* Sets interrupt handler for WDT and enables interrupt number */
          //    CyIntSetVector(interruptNumWDT, ISR_WatchDog);
          //    CyIntEnable(interruptNumWDT);
              CySysWdtSetInterruptCallback(CY_SYS_WDT_COUNTER0, Watchdog_Callback);
          

           

          There is no need to care about the interrupt vector and the interrupt flags.

          2 of 2 people found this helpful
          • 2. Re: CE224703 PSOC4 WDT work on -042 kit but on on -044 kit
            MiRo_263836

            I thought that something minor had changed.  The Code Example should be updated to include this change.

            • 3. Re: CE224703 PSOC4 WDT work on -042 kit but on on -044 kit
              VasanthR_91

              Hi Mike,

               

              We have noticed this issue and will be taking necessary steps to make the correction.

               

              Best Regards,
              Vasanth