2 Replies Latest reply on Apr 15, 2020 6:05 AM by user_4631386

    Enabling MCWDT with WCO


      I've been struggling with enabling the MCWDT with WCO, and I'm thinking that I've missed something obvious.


      I'm using a custom board with a CYBLE-416045-02 module (Cypress PSoC 63 BLE).


      I've set up the WCO in Modus Toolbox 2 configuration tool with default configuration. But when the WCO is enabled, the initialization halts when waiting for the WCO_OK bit to go high.


      I've tried to call the PDL functions myself, with the same result. After enabling WCO the OK bit never goes high.


      I have a similar issue with the MCWDT which might/might not be related. I'm setting counter 0 to interrupt mode and clear on match. The configuration parameters are set in the Configuration tool. After enabling the MCWDT I've tried to read the enabled status, and it is disabled. Even after several ms. I'm guessing this is also a bit in the register that doesn't go high.


      So I'm thinking that something else needs to be enabled? Hope someone has a clues of what is going on.


      I have tested it on multiple board, with the same result.


      Code for setting up the MCWDT (in case it could be relevant):


      cy_stc_sysint_t sensorTimerInterruptConfig = {

          .intrSrc = (IRQn_Type) INTERRUPT_TIMER_IRQ,

          .intrPriority = 5u



      static void sensorTimerISR(void)


      // Some code




      Cy_SysInt_Init(&sensorTimerInterruptConfig, sensorTimerISR);



        • 1. Re: Enabling MCWDT with WCO

          We have a blog which explains how to use MCWDT in ModusToolbox which you might find useful: https://iotexpert.com/2020/04/06/psoc-6-using-the-mcwdt-as-a-deep-sleep-timer/


          If this doesn't help, please attach your project and we will have a look.




          1 of 1 people found this helpful
          • 2. Re: Enabling MCWDT with WCO

            Thank you, the article helped me fix the issue with the MCWDT. The interrupt is now working.


            I still have issues with the WCO however.


            I have created a new empty project and added the code from the article - minus the LED. This works fine. Then I enable the WCO in the configurator, and the initialization causes an error when waiting for WCO_OK bit to go high. Is it correct that a crystal is already included in the CYBLE-416045-02 module? So it should be possible to enable the WCO "out-of-the-box"? Otherwise it could be an issue with our custom board that we have to fix.


            This is the sample code I'm using in the test-project:


            #include "cybsp.h"

            #include "cyhal.h"

            #include <stdio.h>


            void mcwdtISR()


                 Cy_MCWDT_ClearInterrupt (mycounter_HW,CY_MCWDT_CTR1);




            int main(void)


                 cybsp_init() ;




                 cy_stc_sysint_t intrCfg =


                      .intrSrc = mycounter_IRQ,

                      .intrPriority = 4UL



                 Cy_SysInt_Init(&intrCfg, mcwdtISR);






                 Cy_MCWDT_Disable(mycounter_HW, CY_MCWDT_CTR0 | CY_MCWDT_CTR1, 100);



                 Cy_MCWDT_SetInterruptMask( MCWDT_STRUCT0, CY_MCWDT_CTR1 );


                 Cy_MCWDT_Enable(mycounter_HW, CY_MCWDT_CTR0 | CY_MCWDT_CTR1 , 100);