Can you please use the built in self test (BIST) library to check what the parasitic capacitance (Cp) as observed by the GPIO pin is? It returns the value in pF and this can confirm if the Capacitance observed is 23.4pF.
Please make sure that IDAC auto calibration is disabled as the equation for raw counts has an extra term when compensation IDAC is present.
Please share the CapSense configuration file (Configure CapSense -> Save configuration).
I have activated BIST, put in main.c a few code using GetSensorCapacitance API but I cannot read any Capacitance value on tuner.
Only Raw counts are displayed as usual. Any idea ?
Here is the Capsense configuration files as requested.
Thanks for your help !
1 of 1 people found this helpful
Sensor capacitance will not be displayed in tuner. You can add a break point and observe the value by debugging the program or use a communication protocol (such as UART) to observe the value in a terminal application (such as Tera Term).
Thanks and regards
Thanks AH_96 for this clear and fast answer.
Regarding the location of the GetSensorCapacitance(.....) I put it before the do....while loop. Should I put it inside ?
I got 0x0000001A as capacitance value, which is 26 pf
So 26 pF is far from 23.4 pF and once entered in the formula, it gives a 36514 Raw counts, which is closer to 32862 but still unexplained !
I very surprised by the "low resolution" of capacitance conversion routine. No floating value. Just something between 5 and 255 pF !
So, any explanation will be welcome...
The Cp that is obtained by BIST is the capacitance observed from the pin and includes the pin capacitance, trace capacitance and final sensor capacitance. Hence, this slight variation is expected.
The problem is with the selection of Vref. The external power that you are supplying is 5V, and therefore, the selection of Vref should have been 2.7429V. However, in the system tab of Design wide resources, there is an option to set VDDD and VDDA
Please make sure that these are set to 5V. In the current case, it is set to 3V and therefore, Vref is set to 2V and hence the difference in calculation.
Thanks and regards
Now changed VDDA and VDDD to 5V
Still having the 23.4 pF capacitor on p1.4 , with CapSense configured as follows:
- Modulator clock= 12 000 kHz
- Sense clock source= Direct
- IDAC sensing configuration = IDAC sourcing
- IDAC auto-calibration= disabled
- IDAC auto-compensation= disabled
- Sense clock frequency= 750 kHz
- Resolution= 15 bits
- IDAC modulator= 27 (adjusted to get as close as possible to 27852 ,which is 85% of 32767)
Then Raw counts gives 27567
Read capacitor using API in debug mode is 26 pF
Then formula with 26 pF and IDAC mode= 27 gives 27047 counts.
I think these values are pretty close and we have now a good correlation between formula and reality, isn't it ?
Thanks for your help