Thanks, Alain.
So . . . if I have a Tad of 24us and a sampling time of 12us, the total time required to sample the channel will be 36us, yes?
Russ
Thanks, Alain.
So . . . if I have a Tad of 24us and a sampling time of 12us, the total time required to sample the channel will be 36us, yes?
Russ
Russ
N0EVC, xWB6ONT, xWN6ONT
"Easy to use" is easy to say.
NO, Russ ...
See the "Midrange Databook" $ 23.4 to 7 for details ...Conversion time = TAD + N • TAD + (11 - N)(2TOSC)
Where: N = number of bits of resolution required.
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I looked at the ADC data book, Alain. Thanks. And thanks (again!) to Darrel.
I've done ADC before, with the 12F683 at 4 MHz and 8 bits.
Should I do anything different for the 16F88 at 8 MHz and 10 bits?
Russ
N0EVC, xWB6ONT, xWN6ONT
"Easy to use" is easy to say.
There are a few things to do differently.
First thing is obvious, DEFINE ADC_BITS 10
And, Right Justify the result ADCON1.7 = 1
Then go here, and start using 12-bits or more.
http://www.darreltaylor.com/DT_Analog/
<br>
DT
I already oversample on the 12 bit-ers. I use averaging as part of the math. Rather than use something like (sample * 9) >> 4, it is better just to perform 9 conversions, add them together and shift. I typically only need 3 digits of precision.
The thing most people ignore is the quality of their reference and dividers. They try to get 10-12 bits (or more) of resolution when using Vcc as the reference voltage. That just doesn't work. We use an LM4120-4096 (4.096V) reference with 0.2% accuracy. All voltage dividers use 0.1% resistors.
I have code that has to run on 8720s. 8722s and 8723s (the user doesn't know what chip they have in their unit and I have to do field upgrades). I read the processor type and speed (PLL enabled or not - I have chips running at both 20 and 40Mhz) from the CONFIG registers and do a right shift (>>2) on the result if the chip is an 8723. I have to change all the timing, buad rates, A/D clocks as well. It all works well, though.
Charles Linquist
If the thing you are reading also operates with a Fixed Reference, then sure ... you should use a reference on the A/D.
But most things are "Ratiometric" and a fixed reference will transfer any ripple on the power supply straight into your A/D readings. And regulators like 7805's that can't keep a constant voltage will make the readings wander all over the place.
References have their place, but I believe you should not use them unless the right conditions are met.
0.1% resistors ... gotta agree with that though.
<br>
DT
The power supply voltages I have to read are never ratiometric.
Charles Linquist
Bookmarks