I wants to switch from deep sleep power mode to normal mode using Capsense button

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

cross mob
AsDh_4015406
Level 1
Level 1
10 sign-ins 5 replies posted 5 questions asked

if Capsense Button pressed the controller should move in deep sleep power down mode

also move to Active power mode from deep sleep mode when I pressed another Capsense Button

It IS possible By Using Capsese Button.  Kindly suggest

f((CapSense_IsWidgetActive(CapSense_BUTTON0_WDGT_ID))&& (flag2==0))   /* Right Button */

                        {                                  

                                  CySysPmDeepSleep();

                            

                        }

0 Likes
1 Solution

Hi AsDh_4015406​,

First we need to ensure that the device is in deep sleep mode or not. For this we recommend you to do the following test:

Toggle a GPIO before and after the deep sleep API. Use an oscilloscope to check the duration for which the device is in deep sleep mode.

if((CapSense_IsWidgetActive(CapSense_BUTTON1_WDGT_ID))&&(flag5==0))

  {                        

       flag5=1;

       Pin_Write(1);

       CySysPmDeepSleep();

       Pin_Write(0);  

  }

In systems tab, I see that the SWD pins are set to debug. If you want to reduce current consumption, the debug select option should be set to GPIO mode. But note that you will not be able use debug the project after that since SWD pins are not available for debug. However, you can program the device.

pastedImage_7.png

Ensure that you do not have the debugger attached to the device as this will prevent the device from entering deep sleep.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
7 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi AsDh_4015406​,

It is possible to move the device to deep sleep when a capsense button is pressed by simply calling the API   CySysPmDeepSleep() on a button press. However, CapSense interrupt can not wake up a device from deep sleep. Also, CapSense block is not active when the device is in deep sleep. Therefore, you need another wakeup source such as WDT to periodically wakeup the device from deep sleep and then perform a capsense scan to check if there was a touch or not.

Please refer

Code example: https://www.cypress.com/documentation/code-examples/ce210291-psoc-4-capsense-one-button 

App note:  https://www.cypress.com/documentation/application-notes/an210998-psoc-4-low-power-capsense-design 

Regards,

Bragadeesh

Regards,
Bragadeesh

Thank You so much BragadeeshV_41

I used the Cy8C4025AZI-S413 And I2C Protocol.

My board details as follows:-

The battery power supply to the board is  5.5 v battery with 1000mAh . I used our customized capsense board.

The board Contain 5 Capsense buttons, I2C, 35 Common Anode configuration leds. In that, I got 1.03 miliampere current in Deep sleep mode. which is not as per document (current is 1.3 microampere in deep sleep). 

is there any external parameter affect on it, like Board impedance, Component etc. if yes then how much board impedance required to achieve result.

0 Likes

Hi AsDh_4015406​,

Can you please share your project so that we can check if there are any issues in that?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hi Bragadeesh,

I have attached the sample code zip file for deep sleep mode operation when Capsense button pressed. but not developed yet WDT interrupt  to wakeup the device.

Regards,

AsDh

0 Likes

Hi AsDh_4015406​,

First we need to ensure that the device is in deep sleep mode or not. For this we recommend you to do the following test:

Toggle a GPIO before and after the deep sleep API. Use an oscilloscope to check the duration for which the device is in deep sleep mode.

if((CapSense_IsWidgetActive(CapSense_BUTTON1_WDGT_ID))&&(flag5==0))

  {                        

       flag5=1;

       Pin_Write(1);

       CySysPmDeepSleep();

       Pin_Write(0);  

  }

In systems tab, I see that the SWD pins are set to debug. If you want to reduce current consumption, the debug select option should be set to GPIO mode. But note that you will not be able use debug the project after that since SWD pins are not available for debug. However, you can program the device.

pastedImage_7.png

Ensure that you do not have the debugger attached to the device as this will prevent the device from entering deep sleep.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hi Bragadeesh,

I got expected result.

Kindly suggest  me low power Cypress microcontroller having 26 GPIO And 1 I2C.

Regards,

AsDh

0 Likes

Hi AsDh_4015406​,

You can use PSoC 4000 S device for your application

https://www.cypress.com/documentation/datasheets/psoc-4-psoc-4000s-family-datasheet-programmable-sys...

If this device doesn't satisfy your requirement, we kindly request you to create a new forum thread for your new query with more information on the requirement. Since we have already answered the question of this forum thread, we are proceeding towards locking this discussion.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes