enabling the capsense shield runtime

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

cross mob
Anonymous
Not applicable

 Hi all,

   

is it possible to enable/disable shield of capsense configuration from application in CY8C4100 project? How?

   

    Thanks..

0 Likes
3 Replies
Anonymous
Not applicable

Yes, it is possible to enable or disable Shield pin in firmware. You will have to disconnect the pin from the Shield signal using HSIOM registers. Following is the method:

   

 

   

Enable/Connect Shield:

   

CY_SET_REG32(CapSense_Shield__0__HSIOM, (CY_GET_REG32(CapSense_Shield__0__HSIOM) | (0x05 << CapSense_Shield__0__HSIOM_SHIFT)));

   

 

   

Disable/Disconnect Shield:

   

CY_SET_REG32(CapSense_Shield__0__HSIOM, (CY_GET_REG32(CapSense_Shield__0__HSIOM) & ~(0x05 << CapSense_Shield__0__HSIOM_SHIFT)));

   

 

   

In the above lines, the CapSense_Shield__0__HSIOM and CapSense_Shield__0__HSIOM_SHIFT are defined in cyfitter.h and can be used in main.c file.

   

 

   

Regards,

   

Saheem

0 Likes
Anonymous
Not applicable

Thank you for the response.

   

I use CSD 2.0 with PSoC Creator 3.0SP2 and I will not update to newer version.

   

Is it safe to go with this solution into series project?

   

Are there some risks and which?

0 Likes
Anonymous
Not applicable

It is recommended you always update the project to the latest versions. I see no issue with CSD in upgrading to PSoC Creator 3.1 or 3.2. There will be new features and bug fixes in the latest versions.

   

 

   

Q. Is it safe to go with this solution into series project? Are there some risks and which?

   

-> Why do you want to enable or disable shield during runtime? What is your application about? Note that enabling or disbaling the shield during runtime will vary the parasitic capacitance of the sensor. This inturn will result in variation in raw count when shield is enabled/disabled.

   

 

   

Saheem

0 Likes