- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to read raw counts from a CSX touchpad widget using PSOC 6. I have been skimming through the capsense datasheet but didn't quite understand how to do it. I wanted to look for an example using capsense rawcounts but didn't find one in psoc creator. I believe I can get the raw counts using self-test API, then again I am not sure how to do it. Is there a simple code snippet or small explaination I could get that could help me get started reading rawcounts from my widgets?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JeSi_4326976
You can use the CapSense_GetParam to read the raw counts from CapSense widget. The first parameter is the paramID present in CapSense_RegisterMap.h and the second parameter is the address of the variable where value needs to be stored.
I'm attaching a simple project to show this for CapSense buttons with this response.
Do try this out.
Thanks,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JeSi_4326976
You can use the CapSense_GetParam to read the raw counts from CapSense widget. The first parameter is the paramID present in CapSense_RegisterMap.h and the second parameter is the address of the variable where value needs to be stored.
I'm attaching a simple project to show this for CapSense buttons with this response.
Do try this out.
Thanks,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think you can read these values through the dsRam.
Please see the Data Structure Description in the PSoC 6 Capacitive Sensing Component datasheet.
(Also see "To access CapSense Data Structure registers you have the following options:")
You can try to get the register map on your design as below.
Right clock on CapSense Component on your TopDesign.cysch window, and click "Save Register Map as PDF".
And search "RAW" on this PDF.
For example, the LED trun on, when the button is touched and the raw counts is grater than some value.
uint16 testval;
testval = CapSense_dsRam.snsList.btn0[0u].raw[0u];
if(testval > 2000) LED_13_Write(LED_ON);
(You can use also CapSense_GetParam() function.)
Sorry, now I have only PSoC 4 board. (PSoC 6 is in my office.)
So, I cannot give you complete example code.
I think the below thread also helpful.
https://community.cypress.com/message/212561
https://community.cypress.com/message/158491
BR.