8 Replies Latest reply on Aug 20, 2020 9:09 AM by BragadeeshV_41

    Capsense sensor capacitance measurement API  returns some wrong value

    SwCh_4720446

      Hello,

      I am using Capsense V7.0 for my application. I want to run the self test functions individually to check the Sensor and shield  capacitance and print it on UART. The version 5.0 was returning values in pF and results were for sensor 22 pF etc. but after changing the Capsense version to 7.0 the API returns in femtofarads.

      I have received the values that seems wrong. Also i have doubt in the API returning values.

      Here in function CapSense_GetSensorCapacitance description says that the results will be femtofarads, but the result returned are taken from the function(CapSense_GetSensorCapacitanceExt)  which returns value in pF.

       

       

      What is the exact solution for this ? Which function to use for measuring Sensor capacitance?  Please give if there is any example code.

       

      Thanks in advance.

        • 1. Re: Capsense sensor capacitance measurement API  returns some wrong value
          BragadeeshV_41

          Hi SwCh_4720446,

           

          The internal function CapSense_GetSensorCapacitanceExt returns capacitance in fF only. The issue is with the description. We will file an internal request to get this updated. Thank you for bringing this to our notice.

           

          Can you please let us know the variation in Cp between the two components versions? I did a measurement with 145 kit and the results seem to be the same in both the components. For example , sensor0 of Linear Slider reported 12 pF in v5.0 and 12516 fF (12.516 pF) in v7.0.

           

          Are you using shield electrode in your design?  What is the  connection state of inactive sensors (ground/ shield/ HiZ)?

           

          Regards,

          Bragadeesh

          • 2. Re: Capsense sensor capacitance measurement API  returns some wrong value
            SwCh_4720446

            Hi Bragadeesh,

            Yes i am using shield electrode in design.

            I have attached images which shows printed values on UART serial terminal with version change. Following are the tests taken:

            1) Capsense verion 5.0 returned values for 4 buttons and 1 proximity when shield inactive connection is given to shield.

            CSV5.0_read_snsdata_Shieldpin SHIELD.PNG

            2) Capsense verion 5.0 returned values for 4 buttons and 1 proximity when shield inactive connection is given to Ground.

            CSV5.0_read_snsdata_ShieldpinGROUND.PNG

            3) Capsense verion 7.0 returned values for 4 buttons and 1 proximity when shield inactive connection is given to shield.

            CSV7.0_read_snsdata_Shieldpin SHIELD.PNG

            4) Capsense verion 7.0 returned values for 4 buttons and 1 proximity when shield inactive connection is given to Ground.

            CSV7.0_read_snsdata_ShieldpinGROUND.PNG

            Why there is huge difference in the returned values?

            • 3. Re: Capsense sensor capacitance measurement API  returns some wrong value
              BragadeeshV_41

              Hi SwCh_4720446,

               

              CapSense component v7.0 has a bug when it measures the Cp of the sensors with inactive sensor electrode connection to shield. Our software team is working on fixing this issue in the next component release.

               

              For now we recommend you to port the design to v6.0. You can port to the new component when the fix is available since porting from v6.0 to v7.x is easy.

               

              Regards,

              Bragadeesh

              • 4. Re: Capsense sensor capacitance measurement API  returns some wrong value
                SwCh_4720446

                Hello Bragadeesh,

                 

                Thanks for clarifications.

                 

                We are using version 7 component for operation also. When we migrated to V7.0 from V5.0, we have observed, reduction in proximity sensing distance. The reason  for porting the version was noise immunity to the proximity sensor. The proximity sensor was getting false detection in version 5 for production batch of device. which lead us to port the version to 7.Should we use V6.0 for application also. ??

                 

                With Regards,

                Swati

                • 5. Re: Capsense sensor capacitance measurement API  returns some wrong value
                  BragadeeshV_41

                  Hi SwCh_4720446,

                   

                  If you are using Cp measurements as part of your application design, we recommend you to migrate to version 6.0 for your design. If not, you can continue using v7.0 for application.

                  From v7.0, you are expected to call  CapSense_SetInactiveElectrodeState()if you want to connect inactive sensor electrode while performing BIST operation. See the CapSense component datasheet for details.

                   

                  You can also use the following workaround in v7.0 until we have the fix in the component.

                   

                      for(;;)

                      {

                               if(CapSense_NOT_BUSY != CapSense_IsBusy())

                        {

                          CapSense_ProcessAllWidgets();

                          CapSense_SetInactiveElectrodeState(CapSense_BIST_CSD_SNS_CAP_E, CapSense_SNS_CONNECTION_SHIELD);

                          cp_0 = CapSense_GetSensorCapacitance(0,0, &status); // Will be incorrect

                          CapSense_SsCSDEnableShieldElectrodes();

                          cp_1 = CapSense_GetSensorCapacitance(0,0, &status); //Correct value

                          CapSense_SsCSDDisableShieldElectrodes();

                          CapSense_ScanAllWidgets();

                          CapSense_RunTuner();

                         }

                      }

                   

                  Regards,

                  Bragadeesh

                  • 6. Re: Capsense sensor capacitance measurement API  returns some wrong value
                    SwCh_4720446

                    Hello Bragadeesh,

                     

                    We are using Cp measurements as part of application design. I have tried the workaround you given in last reply, which does not work in my case. Please find attached .c file for my trial application.

                    Also I want to know, How to change the Capsense  Verion 7 to verion 6 in PSOC creator 4.3.?

                     

                     

                    Thanks  and regards.

                    Swati

                    • 7. Re: Capsense sensor capacitance measurement API  returns some wrong value
                      SwCh_4720446

                      Hello,

                      Please find  attachment  as Previous reply has attachment missing.

                       

                      Also I have issue in proximity distance in version 7. Which i think due to the sensor IDAC auto calibration. Am i right? 

                       

                      Thanks and regards

                      Swati

                      • 8. Re: Capsense sensor capacitance measurement API  returns some wrong value
                        BragadeeshV_41

                        In that case, we recommend you to migrate to v6.0 only. To migrate to v6.0, do the following:

                         

                        1. Project > Update Components

                        2. Choose new version as 6.0 for CapSense_p4 from drop down list

                         

                        The most APIs of v6.0 and v7.0 are compatible (except BIST APIs). Please refer CapSense component datasheet v6.0 for specific APIs

                        https://www.cypress.com/documentation/component-datasheets/psoc-4-capacitive-sensing-capsense

                         

                        Regarding Proximity sensor:

                         

                        1. Did you check the return value of CapSense_Start()? The function returns failure if there are issues with IDAC auto-calibration

                        2. Did you check the IDAC values obtained in Tuner? Was it between 18 to 110?

                         

                         

                        Regards,

                        Bragadeesh