Capsense do not work after wakeup from deep sleep

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ZONDAR1
Level 2
Level 2
10 replies posted 5 questions asked 10 sign-ins

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

0 Likes
1 Solution
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

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

View solution in original post

0 Likes
4 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

HI @ZONDAR1 ,

Can you please share your project with us so we can look into the same on our side?

Regards
Alen

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

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

0 Likes
ZONDAR1
Level 2
Level 2
10 replies posted 5 questions asked 10 sign-ins

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.

 

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

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

0 Likes