Hi PSoC73, thanks for the reply, I forgot about that, let's say that I will probably use the ADC in differential mode which will attenuate these effects I describe like the ground shift. But my concern is being able to connect and disconnect the voltage divider dynamically to avoid wasting power and I'm still not sure if mixing analog power with digital GPIOs is a good idea. Thanks again for the advice.
This method is just adapt with rail-to-rail range. AI_Pos and AI_Neg must stay within Vdd to Vss. If you want more spacious range, I recommend you to proper analog isolator.
But, More stable way is Isolate after ADC stage. Use a digital isolator, that is accurate. Do not use photo-couppular, It's my experience.
Your question is also a f() of the resolution and accuracy you are
looking for. Clearly digital ground will have noise on it, and ohmic
drop. Noise you can take out of A/D result by filter/averaging. However
it has to be uncorrelated noise to be effective. And digital noise has
strong correlated components in it typically. Ohmic drop by cal routine.
And all of this a f() of resolution you are seeking.
Possible references that may be of use -
I'll try your suggestions to see how they work for me. Thanks a lot for your replies.