Use of Vref+ pin of PIC16F87xA ADC [applicable to all micro]

The maximum analog voltage you can give to your PIC (directly, without any divider) is 5V. So whatever analog signal you are trying to measure, make sure that the i/p volt to that pin should not exceed beyond 5V. If you want to measure voltage more than 5V, you should use resistor voltage divider network. The values of resistances required depends on the range of input voltage. For 5V your micro will produce 1024.

What does Vref- do?

Suppose in your experiment, if you are sure that your input analog signal will always between 2.5 -5V, then you can fix the Vref- to 2.5V , and use the entire 10-bit range to measure the voltage between 2.5 -5V. That means you will get reading 0 for i/p 2.5V, and 1024 for i/p 5V or more. This enhances the accuracy of analog measurements this way. Well, Vref+ will be at 5V in that case.

Comments

I think you made a mistake. If VREF+ is set for 2.5V, then your range is 0V to 2.5V, (provided that VREF- is VSS) with 0->0 reading and 2.5V-> 1023 ADC reading.
 
Thanks Thamid, Typing error. a "-" sing was missing. The line should be "...you can fix the Vref- to 2.5V...." .Now corrected
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…