Page 1 of 1

Avoiding the Cargo Cult: R19 and VBACKUP

Posted: Sun Sep 09, 2018 9:59 pm
by akronmacon
I'm designing my own version of a MicroPython board based on the PYBv1.1 for my own home ecosystem of tinkering. [And it's an instructive exercise!]

When walking through the PYBv1.1 I see the note:

"R19 prevents a silicon failure from short circuiting the backup battery."

I imagine the reasoning is: There is little current draw on a backup battery (~3ma), so the drop across R19 should be acceptable and the power lost in it should be minimal. If the STM32F405 were to develop some kind of short, this prevents our coin cell from getting hot and causing problems as it dumps all its juice into the short limited only by its own internal resistance.

This raises the questions: Is this (The STM32 shorting internally) a problem which is/has been encountered often? Is this simply proactive good practice?

I don't see this concern addressed in the STM32F4xx reference manual section on the Backup Battery Domain.

I didn't want to just adopt this idiom into my design without getting a feeling for how it came to be.

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Posted: Mon Sep 10, 2018 11:07 am
by pythoncoder
That has puzzled me too. The pin doesn't source voltage so the purpose of the resistor is unclear. However, from what I know of Damien, he wouldn't put it there (with a note) without good reason.

I wonder if the failure mode is when the Pyboard is powered only by a backup cell and something is shorted on the board? It's easy to forget that the board is still powered: I once stopped the 32KHz oscillator by manually handling such a board.

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Posted: Mon Sep 10, 2018 12:01 pm
by chrismas9
This is a UL requirement for use of coin cells. See this post:

https://www.embedded.com/electronics-bl ... uirements-

Pyboard uses the second circuit with two diodes and a resistor where the two diodes are replaced by an active MOSFET changeover switch in the STM32. The STM32 prevents back current flowing into the cell and in case of an STM32 failure the resistor limits the fault current to 14 mA which is below the UL 25 mA limit.

Inclusion of this resistor is not an indication of unreliability of the STM32 but is included as a safety item as mandated by UL. I recommend including it in all designs using coin cells. Also for safety only Lion / LiPo cells with internal cell protection or an external fuse should be connected to the JST connector.

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Posted: Mon Sep 10, 2018 6:18 pm
by pythoncoder
Interesting. Thanks for that.

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Posted: Wed Sep 12, 2018 1:44 am
by akronmacon
Good link for the background explanation. Thank you!

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Posted: Mon Oct 01, 2018 1:47 am
by chrismas9
Under certain startup conditions the STM32 can momentarily connect Vbat to Vdd. The resistor protects the battery when this happens.