Brandon, Vcc is not always 5.0000 Volts. Take the following example: The a/d converter outputs a value between 0 and 0x3ff regardless of the reference used. If you use Vcc for the reference and it is exactly 5.0 volts, each step is 5.0 / 0x3ff = 4.88 mV per step. Now, lets say that you want to measure a 5.0 volt nominal input using a resistor divider consisting of 2 resistors of the same value (for simplicity). This means that the a/d actually sees 2.5 volts which would be converted to a value of 2.5 / 4.88 mV = 512. Now, lets assume Vcc is 4.5 V. 4.5 / 0x3ff = 4.39 mV per step, so measuring the same 2.5 volt input would result in a value of 2.5 / 4.39 mV = 569. This is a huge loss of accuracy which may or may not be acceptable. When the PIC software actually uses the returned value and it assumes the original 4.88 mV per step, the 569 returned value would be calculated as 569 * 4.88mV = 2.78V at the center of the divider or 2.78*2 = 5.56V at the input - an 11% error. If you use VRef with a tight tolerance reference, the number should be accurate within a bit or 2, depending on noise. With 2 bits of error, the dither (independent of Vcc) would be 4*4.88mV = .019V at the divider, or .019*2 = .039V at the input as calculated by the software. Which would you rather have, an error of 0.56V or an error of 0.039V? Again, it depends on the accuracy required. Also, remember that several PICs can run fine well below 4.75V. I've seen parts spec'd at 4.75V min run fine at about 2.0 Volts. Do you still want accurate reporting if Vcc is "out of spec"? Now, your turn. Do a similar analysis for the "valid" Vcc range of 5.25V to 4.75V with the software still assuming 5.0V nominal. Ken ----- Original Message ----- From: "Brandon Stewart" To: Sent: Thursday, June 27, 2002 10:22 PM Subject: [PIC]: 16F877, RA3, Vref? > What is the purpose of having this Vref? Why not use the internal 5V > reference all the time? If it is for accuracy reasons, then if your 5v line > goes wacky... then can you count on the PIC during that time anyway? > > > > Thanks, > Brandon > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu