cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F373 measuring VBAT with internal ADC1

Andreas Fecht
Associate II
Posted on October 03, 2017 at 13:46

Hello,

I'm using a STM32F373VCT6 and I have a problem with VBAT and ADC.

I have connected a CR2032 Batterie to the VBAT-Pin.

The RTC works fine with the batterie when the main power ist lost.

But if I try to measure the VBAT-Voltage with the internal ADC1 I get always 0.

The sampling on all other channels works fine; only the ADC_CHANNEL_VBAT gives this value.

Is there anyting else to do to measure the VBAT-voltage with the internal ADC1?

I'm working with CubeMX4.22.1 and CUBE V1.9.0.

Best regards

Andreas

#vbat-adc-stm32f373
3 REPLIES 3
Posted on October 03, 2017 at 13:57

Read RM0313, 12.10  Battery voltage monitoring

The VBATEN bit in the SYSCFG_CTRL register allows the backup battery voltage on the

V BAT pin to be measured.

Note also that - as that chapter states it too - the divider loads the battery significantly.

JW

Andreas Fecht
Associate II
Posted on October 27, 2017 at 11:53

Hello,

I found another problem at the measuring of the VBAT-Voltage with the internal ADC!

I'm using the HAL-STM32Cube_FW_F3_V1.9.0 and if I select the battery channel,

the HAL-ADC-Routines activate automatic the battery-bridge,

but the routine don't switch off the bridge after measuring.

I have to do this after measuring:

CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_VBAT); // switch off battery-bridge

Otherwise the battery is empty ~one year later.

Greetings Andreas

Posted on November 20, 2017 at 05:34

Oh, boy!

I just RE-discovered this on last Friday. 

On my custom stm32F446RE board.

Without the presence of VDD, VBat sinks only 0.8uA to support RTC and LSE.

(A coin cell with 220mAh can probably run until my supervisor get retired.

:(

)

Once power on and the ADC internal channel hocks on VBAT, 

It draws about 26uA from my coin cell. (due to internal resistor bridge for ADC circuit.)

Should had read this post first!

DON'T FORGET TO SWITCH OFF ADC VBAT CHANNEL!

.Zt