2025-09-04 3:00 AM
Hi,
My battery (++ LTO/Bucks) that runs everything on my PCBA is connected to VBAT (pin 1). Before the connection I have a voltage divider factor of roughly 1.374, but what I read on the pin via ADC1 channel 18 (what VBAT is routed to internally) seems to be non-sensical. With a battery voltage of 3.6V I measure roughly ~1160 mV (after multiplying by 4 and 1.374). When I tried replacing the resistors in my voltage divider by smaller ones I got higher measurement values.
VBATEN is enabled in ADC12_COMMON_CCR. Also tried to enable MONEN in PWR_BDCR1, but that didn't make any difference.
What's could be the issue here?
2025-09-04 5:50 AM - edited 2025-09-04 5:51 AM
Sounds like the cap isn't being charged up fully. Set sampling time to max.
If that's not it please show the code used.
What voltage divider are you talking about here? There's an internal one but you certainly can't change the resistors on it.