Battery Backup for RTC Clock & Registers on STM32 Nucleos
.
The Nucleo range now seems to be fitted with an LSE crystal for accurate RTC usage. In order to allow the clock to run in power-off state, & additional backup registers to be non-volatile, you must add a coin cell battery.
I salvaged a battery holder for CR2025/2032 cells from an old PC motherboard. It can be mounted conveniently on the underside of the board, pins poking through the slots which separate the ST-Link part from the main board: The -ve side of the battery can be connected to ground at the blue user switch. A solid wire is soldered to the +ve pin and taken back through the slot to the underside of the board. Those wires are sufficient to hold it in place, but the holder could be further fixed with glue if needed.
The +ve wire must be connected to VBAT on the underside: The 0-Ohm resister at SB45 must be removed, and the +3V from the coin cell taken to the right hand pad. (I re-soldered the resistor to the left hand pad in case I needed it in future).
That's all that is required; switching between VBAT & +3V3 is done automatically by the STM32.
4 comments on Battery Backup for RTC Clock & Registers on STM32 Nucleos:
Please log in to post comments.
I did this same thing, it works well. Love how the switchover is integrated into the chip so you don't really need anything else. I am curious if anyone has recommendations if additional components are needed for a commercial product. For example adding a schottky diode to protect against accidental reverse battery insertion. Maybe adding a small resistor to limit current in case of a fault. I suppose the ESR of the battery is already quite high.