- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please share your project file.
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please tell me if you found your issue in the Tuner too? I'm not able to replicate your issue.
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what's bothering me is that when I connect to the debugger or the Tuner,this issue doesn't reproduce.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please probe your CMOD and see if you're able to validate your claim?
Regards
Bragadeesh
Bragadeesh