A method for determining capacitance includes alternately charging a
capacitor to a first voltage and discharging the capacitor to a second
voltage, generating an output signal having a frequency that is a
function of a time period, and determining the capacitance based on the
frequency of the output signal. The time period is selected from at least
one of: (a) a time period needed to charge the capacitor from the second
voltage to the first voltage and (b) a time period needed to discharge
the capacitor from the first voltage to the second voltage.