3
\$\begingroup\$

I have a problem with VBAT voltage measurement on a STM32F401VB. As can be seen in the picture below, the ADC output is correct (identical to the calculated value "ADC Should") in the upper region of the input voltage, but incorrect when the input voltage drops below approximately 1V. graph At 0V input voltage the ADC value is 239 when it should be close to zero. The other ADC channels work as expected, so I think this has something to do with the internal VBAT circuitry.

Does anybody know what this could be caused by?

\$\endgroup\$
11
  • 1
    \$\begingroup\$ What is the source impedance and how is it connected? This looks like a Schottky diode drop. \$\endgroup\$ Commented Nov 25, 2017 at 15:45
  • \$\begingroup\$ " the V BAT pin is internally connected to a bridge divider by 2. This bridge is automatically enabled when VBATEN is set, to connect V BAT /2 to the ADC1_IN17 input channel. As a consequence, the converted digital value is half the V BAT voltage." Looks like an internal ST issue on IN17 sensing near gnd. \$\endgroup\$ Commented Nov 25, 2017 at 16:05
  • \$\begingroup\$ the internal divider has quite high impedance and long sampling time is needed to have the correct values. Increase the time and do more than one reading. ignore the first one. \$\endgroup\$ Commented Nov 25, 2017 at 18:08
  • 1
    \$\begingroup\$ Whatever the error cause is, if it only affects accuracy of Vbat, anything below 1V is dead anyways. \$\endgroup\$ Commented Nov 26, 2017 at 21:08
  • 1
    \$\begingroup\$ Yes, I measured directly at the pin. I contacted ST and they basically just replied "You are using the VBAT pin outside of its specifications (below minimum voltage)". So it seems that the pin is not directly connected to the ADC via a voltage divider but via a circuit that doesn't work below 1V. \$\endgroup\$
    – Fr4nky
    Commented Apr 8, 2018 at 12:32

1 Answer 1

2
\$\begingroup\$

Looks like it could be noise related. Assuming it is you can try:

  • Setting a longer sample time on the ADC and see if the lower end values improve. If that improves somewhat then maybe even take 4-5 readings and average them (potentially ignoring the first).
  • Measuring the input to the ADC with a scope and see if there really is a noise floor of around 0.5v (seems odd but depending what else is on the circuit)
  • Potentially check whether there is a seperate power supply pin for the ADC. VREF or AVCC it's sometimes called but depends on the chip. (I know some STM32 chips have this) and attach caps and ferrites to make the reference voltage cleaner.
  • Worst case try and use an external ADC pin to your battery and see if thats better. If it is then it seems unique to the internal VBAT ADC circuitry which could be an STM problem and not your own. (Check the errata documents for your chip. They will normally publish known issues there)
\$\endgroup\$
2
  • \$\begingroup\$ The sample time is already at the highest value and the measured noise is much lower than 0.5V. The other ADC pins work fine, but unfortunately all of them are used for something else so I have to use the VBAT pin. I think the the VBAT pin is not directly connected to the ADC via a voltage divider (like it is described in the datasheet) but via a circuit that doesn't work below 1V. The errata does not mention this but when contacting ST I got the answer "You are using the VBAT pin outside of its specifications (below minimum voltage)". So I guess I will not be able to get it to work. \$\endgroup\$
    – Fr4nky
    Commented Apr 8, 2018 at 12:34
  • \$\begingroup\$ Yep, looking at the data sheet you are using it below its limits. \$\endgroup\$ Commented Apr 14, 2018 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.