Question: How to wake up PSoC® 6 MCU device from Hibernate mode using free running WDT?
PSoC 6 has multiple watchdogs – single free running watchdog timer (WDT) and one or more multi-counter watchdog timers (MCWDT).
Only the free running WDT can wake up the device from hibernate mode.
Figure 1 shows the PSoC Creator™ 4.2 project schematic.
Figure1: Creator 4.2 Project Schematic
Perform these steps using WDT ISR to wake up the PSoC 6 device from Hibernate mode:
1. Before the PSoC 6 device enters the Hibernate mode, configure the WDT interrupt, initialize, and enable WDT.
/* Configure the WDT interrupt */
/*Initialize and enable WDT */
/*WDT interrupt period can be varied by configuring WDT_IGNOREBITS */
2. Set the wake-up signal from Hibernate.
* \param MyLPComp_WakeUpSrc
* CY_SYSPM_LPCOMP0_LOW : Wake-up source for LPComp CH0 output low
* CY_SYSPM_LPCOMP0_HIGH : Wake-up source for LPComp CH0 output high
* CY_SYSPM_LPCOMP1_LOW : Wake-up source for LPComp CH1 output low
* CY_SYSPM_LPCOMP1_HIGH : Wake-up source for LPComp CH1 output high
* CY_SYSPM_HIBALARM : Wake-up source for RTC alarm
* CY_SYSPM_HIBWDT : Wake-up source for watchdog
* CY_SYSPM_HIBPIN0_LOW : Wake-up source for Pin0 input low
* CY_SYSPM_HIBPIN0_HIGH : Wake-up source for Pin0 input high
* CY_SYSPM_HIBPIN1_LOW : Wake-up source for Pin1 input low
* CY_SYSPM_HIBPIN1_HIGH : Wake-up source for Pin1 input high
3. Use the Cy_SysPm_Hibernate() API to jump into Hibernate mode.
4. Use the CY8CKIT-062-BLE PSoC6 BLE Pioneer Board to test the attached project.
The attached project turns ON the green LED (P1.1) for one second and turns off before the chip wakes up from hibernate. When the WDT interrupt happens, it will wake up the system immediately and will result in a device reset.