Skip to main content
JThas.1
Associate II
October 3, 2023
Question

STM32L496GT6 battery voltage monitoring

  • October 3, 2023
  • 2 replies
  • 957 views

I want to monitor battery voltage (Vbat). I use the adc function to monitor voltage on the Vbat pin, and it can't read the voltage. When I use the same function on other pins, it can read correctly. For Vbat monitoring, what are the specific configurations for it?

 

MCU: stm32l496

IDLE: STM32CUBEIDE

This topic has been closed for replies.

2 replies

TDK
October 3, 2023

Specific things are that your sampling time must be at least 12 us, and there is a 1:3 voltage divider on the circuit. These are covered in the datasheet.

TDK_0-1696340763089.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
JThas.1
JThas.1Author
Associate II
October 4, 2023

For the sampling time topic, I configure it like this:

ts=640.5

ADC clock = 32.5 MHz

tconv = (640.5+12.5)/32.5 = 20.09 us

It is enough for the minimum requirement. Or is my calculation wrong?

 

JThas1_0-1696387120067.png

 

TDK
October 4, 2023

Yes, that's sufficient.

"If you feel a post has answered your question, please click ""Accept as Solution""."