Normally things would be easier if you have a voltage regulator and you can know that your reference voltage is fixed.
Assuming I have a 10-bit A/D, and counts are in au (arbitrary units), we can map from a count to a voltage (think y = m*x + b). Take the example of getting a reading of 620au from an ADC register with a reference provided by a 3.3V regulator:
V_sample(counts) = (V_ref - 0)V / (1023 - 0)au * counts au = 3.3V / 1023au * 620au = 2V
Assume a system powered by a single-cell lipo (V_nominal = 3.7V, charges to 4.2V).
Now instead of an external voltage reference, all I have is an internal fixed voltage reference of 2.048V.
How does the math work out to cancel out the negative effect of my battery voltage (and A/D high reference) slowly dropping over time?
This has to be a common thing for low-cost projects, no?