WDT for wake up from DeepSleep problem | Cypress Semiconductor
WDT for wake up from DeepSleep problem
I want to use to use the WDT to wake-up from DeepSleep.
My problem is, that the Psoc 4 just resets (Like normal WDT use when not cleared
I have inserted the simple source code below.
I turn on the Red LED before my For(;) loop to indicate reset.
The CY_ISR_PROTO(WDT_ISR) code just toggle the Blue led to indicate that the ISR is executed.
It works when I run in debug mode. But it dosent work when I program the device (both in release and debug).
If I just put the device in sleep mode ( CySysPmSleep(); ), it also works, but not wake-up form Deepsleep.
Device: psoc 4 pioneer kit.
Do I miss anything:
Simple application test main.c below:
#define PERIOD 32000u
// Blue LED toggle to test if ISR code is running
/* Setup WDT Counter 0 to generate interrupt on match */
/* Write match count */
/* Enable clear of counter on match */
/* Enable WDT counter 0 */
// Test if WDT counter just resets...
/* Map interrupt vector to the WDT_ISR */
/* Enable Global Interrupt */
/* 200us delay to ensure WDT configuration is complete */
CySysPmDeepSleep(); // Doesent work correct with Deep sleep, The device turn on the red and then Blue LED one
// time, Then continue forever
//CySysPmSleep(); // It works with Sleep mode ??? The device toggles the Blue Led every 1 second
Thanks in advance
my application is attached: