CY8C4014LQI-422 wake up from Deepsleep one touch work wrong

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

cross mob
lock attach
Attachments are accessible only for community members.
YOYO_1228641
Level 1
Level 1

HI,Community!

     In my project,there are six touch buttons. when the code does not add CySysPmDeepsleep() function,everything works normally;

but  when  wake up from deepsleep,no matter press any of the six,The state of the first Capsense touch is always Active(use the Capsense_IsSensorActive() function read key value)

   the attachment is my code.

0 Likes
1 Solution

Ok,thank you for your help!

I think It's probably because the voltage of CMOD capacitors is unstable when wake up from deepsleep.

so I scan the first touch twice in order to stabilize the voltage of CMOD.

View solution in original post

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

Can you please share your project file.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes
lock attach
Attachments are accessible only for community members.

Hi Brvi:

     the attachment is the project file.

    If you don't add the following three lines of code, the real result is the scan order Button0_Sns0 will away ON when press any button wake up from SCAN_TYPE_SLOW.

TIM图片20180820151817.png

Thanks!

0 Likes

Refer to the code example http://www.cypress.com/documentation/code-examples/ce210291-psoc-4-capsense-one-button

This thread shows how to implement the same code exmaple for multiple buttons

CE210291_CapSense_P4_One_Button01 modify to multiple Buttons / Sense?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

My code is also modified by reference to the code example for one button.

Is there any error in my code?

There is no problem run in debug mode.

however,when I programming the hex to my PCB, there is what I'm talking about.

0 Likes

Let me know if I have understood your problem correctly. If not, please correct me.

You are trying to use low power Capsense. Initially when the device is in the active mode, the keys are detecting the touch as per requirement. But when there is no activity, the device goes to the deep sleep mode, I assume one of the CapSense sensor is always ON when you're touching the other buttons. Is that right?

Also tell me does the other buttons detect the touch correctly. For example, when you touch the 3rd button, does the 3rd button detect the touch?

The project file you sent has some missing .c files which is not allowing me to run the code. Is it possible for you to share the entire project file or could you send a project file that focuses only on the issue by commenting the other codes?

Meantime, I'll try to find the problem in the implementation.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

  My English is poor. May not have shown that my question correctly.

   I'll explain my code.  (The attachment)

#define LOOP_TIME_FAST_SCAN             LOOP_TIME_5MS       //LOOP_TIME_10MS
#define LOOP_TIME_SLOW_SCAN             LOOP_TIME_55MS      //LOOP_TIME_70MS

#define WDT_TIMEOUT_FAST_SCAN           (ILO_CLOCK_FACTOR * LOOP_TIME_FAST_SCAN)
#define WDT_TIMEOUT_SLOW_SCAN           (ILO_CLOCK_FACTOR * LOOP_TIME_SLOW_SCAN)
#define FAST_SCAN_DELAY                 2000    //=10s * 1000u / LOOP_TIME_FAST_SCAN))

In  Scan_Type = SCAN_TYPE_FAST  mode:

       every LOOP_TIME_FAST_SCAN   detecting the touch. when there is no activity, FAST_SCAN_DELAY times, the device goes to the deep sleep mode.

       Scan_Type = SCAN_TYPE_SLOW

In  Scan_Type = SCAN_TYPE_SLOW mode:

        every LOOP_TIME_SLOW_SCAN detecting the touch,when any touch is activity, change the scan period to fast,Scan_Type = SCAN_TYPE_FAST.

      

       For example, when I touch the 3rd button in Scan_Type = SCAN_TYPE_SLOW mode, change the Scan_Type to SCAN_TYPE_FAST,

       Scan_Type = SCAN_TYPE_FAST,  and will read the key value, Key_Value =  0x04 + 0x01;  (bit 2:the 3rd and bit 0:the 1st)

       Like I said,the 1st key will away ON,even my fingers move for a long time  Key_Value = 0x01 (bit 0:the 1st)

0 Likes

Can you please tell me if you found your issue in the Tuner too? I'm not able to replicate your issue.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

what's bothering me is that when I connect to the debugger or the Tuner,this issue doesn't reproduce.

0 Likes

Then I feel there is some logical issue in the way you determine the key presence. Can you please recheck your code? I do not see any problem in the way you have scanned the sensors. That is right. Please check the logic of your code and if you are able to resolve it , please share it in the forum. I'll also try to find the issue from my side.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Ok,thank you for your help!

I think It's probably because the voltage of CMOD capacitors is unstable when wake up from deepsleep.

so I scan the first touch twice in order to stabilize the voltage of CMOD.

0 Likes

Can you please probe your CMOD and see if you're able to validate your claim?

Regards

Bragadeesh

Regards,
Bragadeesh
0 Likes