June
2005, Issue 179
Accurate
Capacitance Meter
Cypress
PSoC High Integration Challenge 2004 Contest Winner
by
Alexander Popov, Jordan Popov, and Peter Popov
COUNTER
& ADCINT12
The
Timer32 counter is enabled while the voltage across
CX is in the range defined by the CompLow
and CompHigh thresholds. Timer32’s 32-bit counter is
clocked by SysClk to 24 MHz. This enables it to count
for almost 3 min. without overflowing.
The
time measured by Timer32 is equal to CNT/SysClk. Substituting
everything we have so far in Equation 1, we arrived
at Figure 4d, which we’ve rearranged and presented as
Figure 4e. The latter is the cornerstone of this application.
Let’s analyze it further.
As
you can see in Figure 4e, we grouped the parameters
that affect the measured CX value in two sets. The first
set consists of numerical values we can configure (DAC,
RefHIGH, and RefLOW) or measure (CNT). The second set
contains the system’s physical parameters. It’s clear
that measurement precision depends on the accuracy of
these parameters.
The
SysClk is stabilized with an external quartz, so you
can assume it’s sufficiently accurate. RSET is an easily
obtainable, accurate reference resistor. In addition,
you can measure RSET and VDD with a common digital multimeter
so long as it’s sufficiently accurate. The only physical
parameter that you can’t measure directly is VREF. For
this reason, a calibration procedure will measure it
internally with the ADCINT12.
We
use only the ADCINT12 to measure the VREF value. Because
the ADCINT12 measures the output of BufAmp relative
to VREF, we can calculate VREF from the ADCINT12 reading.
Figure 4f shows the logic behind it. This measurement
should be taken when a capacitor isn’t connected. It’s
possible to do so because the DiffAmp switches off during
the process. The BufAmp normally operates at a unity
gain and outputs AGND. In order to have a meaningful
reading on ADCINT12, we set BufAmp to a higher gain
of 1.33 for the VREF measurement procedure.