Voltage reference buffer output does not match expected value?
Device: STM32G061 (custom board), system running at 8mhz.
I set the vrefbuf mode to Internal voltage reference mode in cubemx. According Scale 0 the expected output on Vref pin should be 2.048V but the value i measured was always 0.2-0.3V greater than expected. It is not constant, the value changes slightly after every power cycle. I see similar results for Scale 1 as well.
I have tried setting up the Vrefbuf through direct register access but without any luck.
VREFBUF->CSR |= VREFBUF_CSR_ENVR; //internal voltage reference mode
VREFBUF->CSR &= ~VREFBUF_CSR_HIZ; //Vref pin connected to vrefbuf output
while (!(VREFBUF->CSR & VREFBUF_CSR_VRR)) //wait for vref buf output to reach requested level