How to improve the accuracy of measured ADC voltage in a circuit connected to Vcc
simulate this circuit &ndash; Schematic created using CircuitLab
You can use an opamp to buffer the internal Vref of your MCU, and it becomes a ratiometric ADC.
Example for 12 bit ADC:
$$Code=\frac{4095}{V_{ref}}\cdot V_{ADC}=\frac{4095}{V_{ref}}\cdot V_{ref}\frac{R_2}{R_1+R_2} = 4095\frac{R_2}{R_1+R_2}$$
As you see, the V_ref cancels out.