AN4718 Application Note: How To Design A V System Based On STM32L0/L1 Series (With External Components)
AN4718 Application Note: How To Design A V System Based On STM32L0/L1 Series (With External Components)
Application note
How to design a VBAT system based on
STM32L0/L1 series (with external components)
Introduction
This document describes how to design applications powered by interruptible power supply,
which have to retain the content of the backup registers and to keep running RTC, when
VDD is turned off or unplugged. The device needs to be connected to an external backup
voltage supplied by a battery or by another power source: this mode is called VBAT.
The battery powered application with single power supply, which is powering the device
during the whole application life time, can take a benefit from the low-power modes of the
devices, such as STOP or STANDBY. This allows to retain the content of the backup
registers and RTC information, while suspending the non-active part of the device without
any additional component needed.
In applications requiring RTC, while VDD is turned off or unplugged, products, belonging to
STM32L0 and STM32L1 series, need external components configurations, while the VBAT
mode is self-managed by products belonging to STM32L4 series.
Use cases provided:
Simple diagram to allow backup domain with minimum external component: diagram
allowing longer battery lifetime
Diagram for applications implementing USB
Diagram for IoT or mobile application using only coin cells
Low power diagram for IoT
Different possibilities are proposed, showing the trade-off between lifetime and cost.
Content
9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
10 Acronyms used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
11 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
List of figures
0DLQGHWHFWLRQRSWLRQDO
0DLQVXSSO\
9''9''$
670/
9%$&.83 670/
%$5
6FKRWWN\WRDYRLG
EDFNZDUGFXUUHQW
9&RLQFHOO VXSHUFDSDFLWRU
06Y9
The detection of the main supply low voltage is done by STM32L0/STM32L1 MCU,
integrated Programmable Voltage Detector (PVD) only during RUN mode (not needed in
STOP, where the device consumption is extremely low).
As an example, for a 3.3 V supply, PVD threshold can be set to 3.05 V or 2.85 V.
The main recovery detection is checked by activating PVD during periodic wake-up; if VDD
is below PVD threshold, STM32L0/STM32L1 MCU goes back to STOP mode.
Warning: The more often the main supply detection is checked, the
faster the supercapacitor voltage will drop.
In this use case, the main supply detection is done through the wakeup pin: PVD polling is
then no more necessary: this will improve the supercapacitor lifetime, comparing to what is
described inside the Section 1.
6763)/
2WKHU,&V
3026
0DLQ6XSSO\
9 9''9''$
9VV
670/
670/
' ,2
µ¶VWRSPRGH
' µ¶UXQPRGH
9%$&.83
%$5$6 :DNHXS
VXSHUFDS GLRGHVLQ627/
06Y9
The schottky diodes implemented in this schematic (see Figure 2), allow to charge the
supercapacitor and to avoid reverse current to main supply source.
When main supply disappears, thanks to the detection with GPIO threshold programmable
on wake-up (EXTI lines), STM32L0/STM32L1 MCU will drive PMOS gate to '1', so that
current will flow from the supercapacitor through the diode D2 to VDD /VDDA of the
STM32L0/STM32L1 MCU supply pins, to keep minimum RTC domain voltage.
When main supply is turned on, wake-up GPIO threshold is reached, so that I/O drives then
low level and current will flow to VDD/VDDA supply pins through PMOS.
VDD/VDDA can also be switched to VBACKUP when STM32L0/STM32L1 MCU goes into
STOP mode, to allow user to remove main supply in very safe way.
Supercapacitor is charged as soon as main supply is high enough versus resistor and diode
D1 drops.
This use case shows how, with few components, the user can exchange the coin cell,
keeping some informations like RTC in STM32L0/STM32L1 MCU.
'
9''9''$
9&RLQFHOO
5
%$5
6FKRWWN\WRDYRLGEDFNZDUGFXUUHQW 670/
670/
%$5 ' 9VV
6FKRWWN\WRDYRLGEDFZDUGFXUUHQW
'
%$5
6FKRWWN\WRDYRLGEDFNZDUGFXUUHQW
VXSHUFDSDFLWRU
06Y9
Warning: The more often the battery re-insertion is checked, the faster
the supercapacitor voltage will drop.
When coin cell is plugged back, current will flow to VDD/VDDA supply pins through diode D3.
Coin cell re-insertion is detected through periodic wake up from the MCU.
Supercapacitor is charged as soon as coin cell voltage is high enough versus resistor and
diode D1 drops.
All diodes are mandatory to avoid any unwanted supercapacitor discharge.
The purpose of the Figure 4: Coin cell and supercapacitor backup is to show that using a
push button to switch back the application on main supply, the lifetime of the application is
significantly improved.
%DWWHU\LQVHUWLRQ
GHWHFWLRQ
6763)962
:DNHXS
3026 3026
0DLQVXSSO\ 9GG9GGD
9&RLQFHOO
9VV
670/
670/
' $ODUPRXW
µ¶VWRSPRGH
' µ¶UXQPRGH
9%$&.83
:DNHXS
%$5$6
VXSHUFDSDFLWRU GLRGHVLQ627/
06Y9
When the battery insertion is detected and when the MCU enters in STOP/STANDBY mode,
the main supply is disconnected and VDD uses the backup supply (capacitor or
supercapacitor charged through a resistor).
In this use case there is no need to monitor VDD in STOP/STANDBY mode: if coin cell is
removed, the MCU is already in low power mode under Vbackup.
The Figure 4 shows:
Schottky diode to avoid reverse current (diode on VDD path could eventually be
replaced by a MOS)
PVD (for instance at 2V) is ON only in RUN mode, to detect battery disconnection and
enter low power mode
RTC ALARM OUT output can be used to turn-on automatically the MOSFET when
exiting from low-power mode
Alarm out is a standard GPIO by default and needs to be configured as falling edge trigger.
First power up is guaranteed when coin cell is present and user has pressed the button:
current will flow from coin cell to VDD/VDDA through PMOS. STM32L0/STM32L1 MCU will
start and the GPIO used for alarm out, will be configured as push pull drive low.
When coin cell is removed or dead, thanks to the detection with GPIO threshold
programmable on Wake-up1 (EXTI lines), STM32L0/STM32L1 MCU will drive PMOS gates
to '1' with alarm_out (GPIO pin set as falling edge trigger event) so that current will flow from
supercapacitor through diode D2 to VDD /VDDA of the STM32L0/STM32L1 MCU supply pins
to keep minimum RTC domain voltage.
When coin cell is replaced, Wake-Up1 GPIO threshold is reached so that alarm out drives
then '0' level and current will flow to VDD/VDDA supply pins through PMOS.
This schematic showed in Figure 4 allows user to change coin cell in very safe way before
restarting.
Supercapacitor is charged as soon as main supply is high enough versus resistor and diode
D1 drops.
Other wake-up events can also turn-on the MOS like the user button.
If VDD decoupling capacitor is big enough, this can be avoided: in this case, wake-up energy
is coming from this capacitor and the supercapacitor, till the software enables again the
MOS via an I/O.
When the embedded USB FS controller is used, the LDO implemented on the board can
also be used to supply the application, when the USB cable is plugged (See Figure 5).
6763)/ 39'21FRQWLQXRXVO\
3026 3026
0DLQVXSSO\
9''9''$
9&RLQFHOO
966
670/
' 670/
%DFNXSVXSSO\ ' $ODUPRXW
%$5$6
VXSHUFDSDFLWRU GLRGHVLQ627/
06Y9
To improve lifetime in USB application, STM32L0/STM32L1 MCU current is sunk from VBUS
when it is available.
When LDO 3.3V used for USB purpose, will be turned ON, it will turn off PMOS gates, so
that VDD/VDDA current comes from LDO.
Coin cell removal is detected by STM32L0/STMM32L1 PVD in RUN mode. As soon as
voltage drops, STM32L0/STM32L1 MCU is put in STOP mode and it drives alarm out GPIO
to high level. Current will flow from supercapacitor through diode D2 to VDD /VDDA of the
STM32L0/STM32L1 MCU supply pins to keep minimum RTC domain voltage.
When coin cell is plugged back, current will flow to VDD /VDDA supply pins through PMOS.
Supercapacitor is charged by coin cell as soon as coin cell voltage is high enough versus
resistor and diode D1 drops.
All diodes are mandatory to avoid any unwanted supercapacitor discharge.
The Figure 6 shows that in an application using two coin cells, this application should be
able to switch from one to the other.
6763)/ 39'21FRQWLQXRXVO\
3026 3026
0DLQVXSSO\
9''9''$
9&RLQFHOO
3 3
966
670/
670/
3026 3026
%DFNXSVXSSO\ 0DLQFRPPDQG
9&RLQFHOO
3 3
%DFNXSFRPPDQG
06Y9
If a voltage drop is detected by the STM32L0/STM32L1 MCU internal PVD, the MCU
switches from main to backup supply.
This application works in both cases: V1<V2 or V1>V2.
Figure 7 shows a schematic with a reduced number of components, when application needs
to switch from one coin cell to another one, keeping voltage on VDD ball for its retention.
%LDVLQJVFKRWWN\GLRGHV
39'21FRQWLQXRXVO\
0DLQVXSSO\ 0,&
9''9''$
9&RLQFHOO
9VV
670/
670/
%DFNXSVXSSO\ 0DLQFRPPDQG
9&RLQFHOO
%DFNXSFRPPDQG
06Y9
In some application, user may decide to use an external voltage detector. An external
component can be then used to detect low voltage and switch from one coin cell to the
second one (see Figure 8).
3 3
9VV
3026 3026
%DFNXSVXSSO\ 0DLQFRPPDQG
670/
9&RLQFHOO 670/
3 3
%DFNXSFRPPDQG
6701 6XVSHQG
2SHQ'UDLQRXWSXW
06Y9
The above schematics shows the use of an external low voltage detector like STM1061N.
Consumption is about 1 uA. Around 2 uA are saved compare to use an internal PVD.
When coin cell1 is present, current is flowing from coin cell1 to VDD/VDDA through PMOS P1
and P2. After power up, main command drives low level, whereas backup command drives
high level.
Coin cell1 removal is detected by STM1061N.
When removal is detected, STM1061N drives low level suspend (GPIO pin), so that
STM32L0/STM32L1 MCU drives with main command gates P1/P2 to high level and with
backup command P3/P4 to low level.
Current is then flowing from coin cell2 through P3/P4 to VDD/VDDA.
9 Conclusion
In this application note the schematics of the main applications using STM32L0/STM32L1
MCUs, and requiring RTC sustained (i.e. VBAT mode) are proposed.
Selection between different proposals will be mainly done depending on the Bill of Material
cost and system lifetime.
10 Acronyms used
11 Revision history
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or
the design of Purchasers’ products.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.