Typically you need to consider the impedance of the voltage divider and the= ADC input. On sampling the charging of the same/hold capacitance causes a = dip in the voltage. Might explain what you're seeing. -------- Original message --------From: James Burkart Date: 11/23/19 12:54 PM (GMT+12:00) To: "Microcontroller discussion= list - Public." Subject: [PIC] ADC operation and accurac= y, PIC18F Hey everyone!PIC18F27K40, XC8 v2.05, MPLAB 5.10, MCC v3I am monit= oring the battery voltage of a circuit using the ADC of thePIC18F27K40 via = a resistor voltage divider of 0.1% precision. I don'treally need that much = precision, but there is virtually no cost differencebetween them and 1%. Th= e positive reference of the ADC is the FVR buffer 1at 4.096V, and the negat= ive reference is VSS. It's a 10-bit ADCC set toright alignment so I assume = each bit represents 0.004V. The clock used forthe ADCC is FOSC/64, making 1= TAD =3D 1us, conversion time of 11.5us, andsampling frequency of 86.9565kH= z. When I measure the voltage at the pin,for example, I get 1.612 volts (wh= ich I assume should be 1.612/0.004 =3D 403,or 0x0193, but when I sample the= voltage and check! the value it's value Iget 0x0168, or 360, which I guess is 1.44V.What mig= ht I be doing wrong?--Sincerely,James Burkart*925.667.7175*-- http://www.pi= clist.com/techref/piclist PIC/SX FAQ & list archiveView/change your members= hip options athttp://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .