Hi Jim,
Yes, the variation of VDDX(VDDA, VRH-VRL) voltage in device temperature and Variation from one S12ZVM device to the next may be partially compensated by additional Vbg measurement.
Why partially?
The Vbg reference voltage has a narrow variation over temperature and external voltage supply, but it is still not constant. The Vbg is measured during production test and the test voltage source cannot keep absolutely the same voltage for all the time. But the accuracy of test equipment is definitely still better than an internal voltage regulator.
For maximum accuracy, the Vbg measurement for channel correction has to be as close as possible to channel measurement in the timeline.
The temperature will probably not change very fast, but the VDDX may change very fast for example in the case of switching big load.
Anyway, we should not switch any pin during voltage measurement for best accuracy, however, this may be difficult to manage in real systems.
The example of next source reference voltage variations may be an injection current. This can influence voltage regulator especially in low power modes when injected current is close or bigger than load current (However, we typically do not measure in low power mode).
Currently, I cannot see any advantage in proposed solution with EEPROM. We should use current values for compensating current error.
Idea: I would like to recommend calculate this compensation in integer (fractional) type values instead of using float type as in my "S12ZVC192-Voltage_measurement-CW106" example code. This may significantly reduce computing time.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------