I’m trying to determine the true equation to arrive at the voltage on the A/D input of a LPC2138. I designed my voltage divider circuit to give a full scale of 3V input to the A/D, based on this line from the User’s Manual:
“Measurement range 0 to 3 V”
Now I’m trying to calculate that voltage and I read this section:
“Zero in the field indicates that the voltage on the Ain pin was less than, equal to, or close to that on VSSA, while 0x3FF indicates that the voltage on Ain was close to, equal to, or greater than that on V3A.”
i.e. the output of the pin is V/V3A. I have 3.3V going in to VREF and VDDA3.
What does ‘V3A’ refer to? In my configuration, is a the maximum reading going to be 3/3.3, or 3.3/3.3?
AVRef for the ARM is a separate supply and can be connected to 3.3V. However, probably that 3.3V supply is in error by a percent or two, which means your readings will be in error likewise.
You can use a precision 3V reference that is powered from 3.3V. Now your readings will be accurate, similar to the reference accuracy.
You probably don’t want to rely on a single reading, but rather average them. If you shift every reading taken 6 bits left and add that to the running total, then average that, you can essentially get rid of the half-bit errors.