- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm now using Capsense component on Psoc4s(CY8C4025LQS-S411).
When it wakes up from deep sleep, it sometimes works but sometimes doesn't.
I would appreciate it if you could help me.
Best regards,
ZONDAR
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ZONDAR1
Please note that CapSense itself cannot be used to wake up a device from deep sleep. You need another wakeup source (typically a WDT so that you can wake up after a fixed time) so that the device is back to active mode and CapSense scan can be initiated.
The place to call this would be after PROCESS_DATA. Once the processing is complete and if the sensors are not active, you can enter deep sleep, keeping the WDT as a wakeup source.
This flow is explained in the CE210291 - PSoC® 4 CapSense® Low-Power One Button code example.
Best regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI @ZONDAR1 ,
Can you please share your project with us so we can look into the same on our side?
Regards
Alen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ZONDAR1
Can you please describe the behavior of CapSense during the error? Is it not responsive and does it recover after sometime?
Please make sure that the device enters deepsleep only when there is no active CapSense scan. You can refer CE210291 - PSoC® 4 CapSense® Low-Power One Button example as it demonstrates the use of CapSense in low power mode.
Best regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,Hari
Thanks a lot.Capsense scan program is like below:
switch(m_currentState)
{
case SENSOR_SCAN:
/* Initiate new scan only if the CapSense block is idle */
if(CapSense_NOT_BUSY == CapSense_IsBusy())
{
#if ENABLE_TUNER
/* Update CapSense parameters set via CapSense tuner before the
beginning of CapSense scan
*/
CapSense_RunTuner();
#endif
/* Scan widget configured by CSDSetupWidget API */
CapSense_ScanAllWidgets();
/* Set next state to WAIT_FOR_SCAN_COMPLETE */
m_currentState = WAIT_FOR_SCAN_COMPLETE;
}
break;
case WAIT_FOR_SCAN_COMPLETE:
/* Put the device to CPU Sleep until CapSense scanning is complete*/
if(CapSense_NOT_BUSY != CapSense_IsBusy())
{
CySysPmSleep();
}
/* If CapSense scanning is complete, process the CapSense data */
else
{
m_currentState = PROCESS_DATA;
}
break;
case PROCESS_DATA:
/* Process data on all the enabled widgets */
CapSense_ProcessAllWidgets();
/* Set the device state to SENSOR_SCAN */
m_currentState = SENSOR_SCAN;
break;
/*******************************************************************
* Unknown power mode state. Unexpected situation.
******************************************************************/
default:
break;
}
Shall I enter deep sleep after case PROCESS_DATA ?
Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ZONDAR1
Please note that CapSense itself cannot be used to wake up a device from deep sleep. You need another wakeup source (typically a WDT so that you can wake up after a fixed time) so that the device is back to active mode and CapSense scan can be initiated.
The place to call this would be after PROCESS_DATA. Once the processing is complete and if the sensors are not active, you can enter deep sleep, keeping the WDT as a wakeup source.
This flow is explained in the CE210291 - PSoC® 4 CapSense® Low-Power One Button code example.
Best regards,
Hari