cancel
Showing results for 
Search instead for 
Did you mean: 

Determining bridge divider for VBAT on STM32F40xx vs. STM32F42xx

Craig B
Associate II
Posted on May 20, 2015 at 20:15

We have two different projects that I work on, both custom boards, one with an STM32F405xx and one with an STM32F427xx.  I have a common code base that I'm using for both.  However when I monitor VBAT via ADC the value I get back on the STM32F427xx board is half what I get on the STM32F405xx for the same input voltage due to the difference in the bridge divider.  From the Ref manual:

''13.11 Battery charge monitoring

</p>

The VBATE bit in the ADC_CCR register is used to switch to the battery voltage. As theV

BAT

voltage could be higher than V

DDA

, to ensure the correct operation of the ADC, theV

BAT

pin is internally connected to a bridge divider.

When the VBATE is set, the bridge is automatically enabled to connect:

  • </p>

    VBAT/2 to the ADC1_IN18 input channel, on STM32F40xx and STM32F41xx devices

    </li>

  • </p>

    VBAT/4 to the ADC1_IN18 input channel, on STM32F42xx and STM32F43xx devices

    ''

    </li></ul>

    I use the CubeMX software to configure my projects.  So my question is this: Is there a way either at compile time (via some &sharpdefine) or runtime to determine what the bridge divider is so I can do the necessary conversion without putting in my own &sharpdefine or similar?

    Thanks,

    Craig

#stm32f4-adc-vbat-bridge-divider
2 REPLIES 2
Posted on May 20, 2015 at 20:40

I don't use Cube nor CubeMX, but the 'F42x/F43x's ADC differs also in how is the temperature sensor connected: channel 18 in 'F42x/'F43x, channel 16 otherwise. Cube appears to define ADC_CHANNEL_TEMPSENSOR to reflect this.

JW

Craig B
Associate II
Posted on May 20, 2015 at 21:39

Thanks JW.  That works!