1 of 1 people found this helpful
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.
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:
cy_stc_sysint_t intrCfg =
.intrSrc = mycounter_IRQ,
.intrPriority = 4UL
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);