Sorry for the newbish question. I didn't find here any questions and answers that can help me with this issue so I decided to ask it.
I'm designing my first circuit with STM32L071KZ microcontroller and it powers via VBUS(USB, 5V) as a primary supply and 2xAA alkaline batteries(3V) as secondary supply.
the power supplies are regulated to 3.3V so the microcontroller and the rest of the circuit are powered by regulated voltage and not directly from VBUS or batteries.
I would like to monitor the batteries voltage level and when it drops below the specific threshold(For example, 2.2V) I will indicate it to the user.
I wonder how to wire things up. microcontroller's VDD is 3.3v and it equals to VDDA. If I got it right, when I will sample the voltage of the battery I will get a constant value because the sample is the ratio between the VDD and VDDA.
This is my power circuit block diagram to make things clear: