cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure capacitance value of capacitor while using TSC ?

goutham gumm_2
Associate II

I have written a TSC code for STM32L476RG . I have attached a sampling capacitor of 47nF and have connected it between sampling IO pin and GND. I have another capacitor which I have connected between a channel IO pin and GND. I want to measure the value(capacitance) of this capacitor. Is there any formula or method by which I can measure it? When only the sampling capacitor is connected to sampling IO pin, the value in uhTSCAcquisitionValue is about 240. When I connect my the capacitor which i want to measure to channel IO pin, the value in uhTSCAcquisitionValue is close to 50. How can I measure it capacitance?

1 REPLY 1
OlivierR
ST Employee

We never play with this interesting use case. Should work for small capacitance values (1pF to few nF).

In opposite with real touch sensing setup, work inside linear area of charge/discharge (1xtau).

For this set DIV=CTPH=CTPL=1 and HCLK as fast as possible.

TSC group handle 4 IOs, this mean you can add 2 references capacitance (CRef1, CRef2) to compute references measurements (M1, M2).

And do something like this:

0690X000009YskuQAC.png

Rgs.