answer 1) is in the question ...What make i wrong?
Look at the datasheet ... ADC section ...AN0 trough a 100k serie resistor
Alain
answer 1) is in the question ...What make i wrong?
Look at the datasheet ... ADC section ...AN0 trough a 100k serie resistor
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 " !!!
*****************************************
Hello Acetronics
I want use a 100k serial resistor to reduce the possibility of descharge
the RTC backup Battery trough the PIC pin over the time.
About the value that i read in the adval variable, i don´t know if it's correct and how to calculate 3.1 V.
Regards
Pedro
What if I use higher input resistance (> 2.5kOhm) than Microchip recommends in datasheet?
"The source impedance affects the offset voltage at the analog input (due to pin leakage current). The maximum recommended impedance for analog sources is 2.5 kΩ. After the analog input channel is selected (changed), the channel must be sampled for at least the minimum acquisition time before starting a conversion."Internal leakage is ~100nA.
So, what if:
Rs = 100kOhm, V_ain = 5V -> I_in = 50uA
In this case leakage is 1/500 of input current. Should not affect too much.
By calculating Tc with 100kOhm I got 19.6uS, total time should be over 21uS
So, is code below OK or not?
This ADC is bit unclear to me and I would like to understand it better.Code:<code><font color="#000000"><b>DEFINE </b>ADC_BITS 8 <font color="#000080"><i>' ADCIN resolution (Bits) </i></font><b>DEFINE </b>ADC_CLOCK 2 <font color="#000080"><i>' ADC clock source (Fosc/32) </i></font><b>DEFINE </b>ADC_SAMPLEUS 500 <font color="#000080"><i>' ADC sampling time (uSec)</i></font></code>
BR,
-Gusse-
Bookmarks