- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear All,
- I make a simple test by connecting a 23.4 pF capacitor on p1.4 , then configuring CapSense 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= 18
Then compile and launch tuner. I had to adjust IDAC modulator from 18 to 20 in order to get Raw counts as close as possible from 27852 (which is 85% of 32767)
So, the nearest value of raw counts I got was 27376. So, we have here 27376 counts for a 23.4 pF capacitor
Up to now, everything looks fine.
- Now, I would like to double check with the formula below:
I made a LibreOffice calculation sheet (you can open it with Excel) with the above parameters and got a 32862 raw counts value !
So, we have two cases:
Either I should have read around 32862 raw counts in tuner OR something is wrong in my calculation sheet
Any support will be appreciated
Anma
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hari,
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
Anma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello anma_3197476
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).
Best regards
Hari
- 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
Hello anma_3197476
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
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ?
Thx
Anma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi anma_3197476
You can add the GetSensorCapacitance before the do-while loop. This function can be called after CapSense_Start() is executed.
Best regards
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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 !
Remark:
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...
Anma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi anma_3197476
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
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hari,
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
Anma