PDA

View Full Version : How long to sample?



RussMartin
- 8th August 2009, 02:28
I need to look at the voltage on an ADC port for time t and detect the greatest value that occurs during that time.

My difficulty is that I don't know how long the ADCIN command takes, so I don't know where to start in terms of how many times to look at the pin and at what intervals.

I'm using PBP with a 12F683 at 8 MHz.

Darrel Taylor
- 8th August 2009, 02:43
Well, as to how long the conversion takes ... I posted a table recently that may answer that question ...

http://www.picbasic.co.uk/forum/showpost.php?p=76762&postcount=4

But there's also the acquisition time, which depends on the impedance, so it's not a complete answer.

If you know what the impedance is, that can be calculated too.

RussMartin
- 8th August 2009, 05:48
The table helped a lot--thanks!

Impedance of the source is about 20K.

Darrel Taylor
- 8th August 2009, 06:14
20K

Well, that is over the recommended maximum.
But I've found it doesn't matter much ...

According to mister-e's PicMultiCalc, an impedance of 20K would need 19µS acquistion time.

Just a hunch, but I'm thinking more like 30µS.
Testing will tell.
<br>