Avoiding the Cargo Cult: R19 and VBACKUP

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
akronmacon
Posts: 7
Joined: Thu Jun 07, 2018 4:23 am

Avoiding the Cargo Cult: R19 and VBACKUP

Post by akronmacon » Sun Sep 09, 2018 9:59 pm

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.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Post by pythoncoder » Mon Sep 10, 2018 11:07 am

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.
Peter Hinch
Index to my micropython libraries.

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Post by chrismas9 » Mon Sep 10, 2018 12:01 pm

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.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Post by pythoncoder » Mon Sep 10, 2018 6:18 pm

Interesting. Thanks for that.
Peter Hinch
Index to my micropython libraries.

akronmacon
Posts: 7
Joined: Thu Jun 07, 2018 4:23 am

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Post by akronmacon » Wed Sep 12, 2018 1:44 am

Good link for the background explanation. Thank you!

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: Avoiding the Cargo Cult: R19 and VBACKUP

Post by chrismas9 » Mon Oct 01, 2018 1:47 am

Under certain startup conditions the STM32 can momentarily connect Vbat to Vdd. The resistor protects the battery when this happens.

Post Reply