Capacitance Measurement; Figure 10. Rc Network Connection For Capacitance Measurement - STMicroelectronics AN3248 Application Note

Stm32l15xxx analog comparators
Table of Contents

Advertisement

AN3248
5

Capacitance measurement

The ability to connect the COMP2 output to the input capture channels of the timers allows
the capacitance value to be measured. The principle is based on measuring the charge time
of a resistor-capacitor (RC) network as follows:
the charge time is measured
the charge resistor (R) is already known
the unknown capacitance (C) can be computed
Figure 10

Figure 10. RC network connection for capacitance measurement

The capacitance measurement procedure consists of charging and discharging the
capacitor through the resistor. The charge/discharge function follows an exponential curve.
The charge function is given by
Example 1
where:
V
DD
t is the time
T is the RC constant
Charging and discharging the RC network is ensured by the timer output compare channel
(TIMx OC) configured in PWM mode. The timer channel is connected to the resistor.
The input voltage is connected to the COMP2 non-inverting input while the threshold is
connected to the COMP2 inverting input. When the input voltage crosses the threshold, the
COMP2 output switches to high level and a capture event occurs saving the counter value.
Figure 11
shows the hardware connection of the RC network to an STM32L15xxx device.
Input voltage
is the positive supply voltage
shows the capacitance measurement.
Doc ID 17758 Rev 1
Example
1.
(
=
V
1
exp
DD
Capacitance measurement
– (
)
)
t
T
13/19

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AN3248 and is the answer not in the manual?

Questions and answers

Table of Contents