c.wilt
January 4, 2013, 3:33pm
40
jpa:
You have hardware that is able to capture 1180 samples in that time. So I was thinking something like this:
1) Set waveout to output square wave @ 10Hz.
2) Set wavein to capture @ 72MHz in free-running mode (DC 500mV) and start the capture synchronously. This means the capture will start when waveout starts a new period.
The result will be a decaying waveform like this: http://en.wikipedia.org/wiki/File:Series_RC_capacitor_voltage.svg
Then you could fit the exponential function to the captured data and compute the capacitance from that.
You will have to adjust the sample rate for higher capacitances though. Because the usable sample buffer is only about 3500 samples, it will only store 50 microseconds @ 72MHz.
I was just going to do a simple RC circuit. Your method will work and not require external parts. I will switch gears and duplicate with my test equipment first and then reproduce in pawn.