Stm32l0 低功耗模式、复位与时钟模块, 低功耗uart和低功耗定时器
Stm32l0 低功耗模式、复位与时钟模块, 低功耗uart和低功耗定时器
Stm32l0 低功耗模式、复位与时钟模块, 低功耗uart和低功耗定时器
January-2014
V1.1
2
System Peripherals
3
Voltage Regulator 4
4
Dynamic voltage scaling in Run mode 5
Voltage scaling optimizes the product efficiency (Consumption vs Performance)
User selects a Range (voltage scaling) according to :
External VDD
DMIPS performance required (=w/ or w/o Wait State)
Max power consumption
MHz
32
1WS
16
1WS
0WS
8
4.2 0WS
0WS
V
VCORE 1.2 V (Range 3) 1.5 V (Range 2) 1.8 V (Range 1)
5
Limitations depending on the operating power supply range
6
Maximum CPU
Operating power supply range ADC operation USB VCORE frequency
(fCPUmax)
16MHz (1ws)
VDD = 1.65 to 1.71V Not functional Not functional Range 2 or Range 3
8MHz (0ws)
Conversion time up to
VDD = 1.8 to 2.0V** Range 1, Range 2 or 32MHz (1ws)
500 Ksps Functional*
Range 3 16MHz (0ws)
Conversion time up to
VDD = 2.0 to 2.4V
500 Ksps
Conversion time up to
VDD = 2.4 to 3.6V
1.14 Msps
7
Brown Out Reset (BOR) 8
During power on, the Brown out reset (BOR) keeps the device
under reset until the supply voltage reaches the specified VBOR
threshold.
No need for external reset circuit
The BOR is available only on devices operating from 1.8V to 3.6
V, and unless disabled by option byte it will mask the POR/PDR
threshold. VDD
8
Power On Reset (POR)/Power Down Reset
9
(PDR)
VDD
Integrated POR / PDR circuitry:
For devices operating from 1.65 to 3.6 V, VPOR POR
there is no BOR and the reset is released VPDR PDR
when VDD goes above POR level and
Temporization
asserted when VDD goes below PDR level tRSTTEMPO
Reset
9
Programmable Voltage Detector (PVD) 10
10
Supply monitoring w/ or w/o Brown Out Reset 11
BOR complies w/ ALL Vdd rise/fall time = No constraints on power supply shape
3.6V
BOR_LEV0 Threshold
BOR_LEV0 Threshold 1.8V
1.8V
Safe Reset (BOR ON)
1.65V 1.65V
w/o BOR = Battery life extension (Grey Zone)
1.5V 1.5V
Safe Reset
NO BOR
Reset
Internal Reset
w/ BOR w/ BOR
w/o BOR w/o BOR
BOR not available
BOR activated by user for
BOR LEV0 is always active at power power down detection
on (even BOR is disabled by Option) Time
11
Standby Circuitry 12
Standby Circuitry contains
Low power calendar RTC (Alarm, periodic wakeup from
Stop/Standby)
20 Bytes Data backup registers
Separate 32kHz Osc (LSE) for RTC
RCC CSR register: RTC source clock selection and enable + LSE
Standby Circuitry
config
Reset only by RTC domain RESET
RCC CSR 32kHz OSC
2 Wakeup/Tamper/Timestamp pins reg (LSE)
IN 1
Tamper detection: can resets all RTC user backup registers
Wakeup
Configurable level: low/high Logic
IWDG
12
13
Low power modes: STM32L0 vs STM32F0
• The STM32L features 5 low power modes
• LP RUN: RUN mode with regulator in low power mode (down to ~10µA)
• Sleep mode (~50µA/MHz)
• LP sleep: Sleep with regulator in low power mode (down to ~4µA)
• STOP and STOP LP (~0.6µA)
• STANDBY (~0.35µA)
STM32F0 STM32L0
LP RUN
Sleep Sleep
STANDBY STANDBY
VBAT
13
14
STM32L0 Low power modes features
• The internal voltage reference can be OFF in Stop mode and Standby mode with a
fast wakeup mode option ( only for Stop mode).
• The BOR can be OFF also.
14
Low Power Modes (1/6) 15
• Entered by
• System Clock is set to multispeed internal (MSI) RC oscillator (131kHz
max)
• Execution from SRAM or Flash memory
• Internal regulator is in low power mode to minimize the regulator's operating
current.
• FLASH can be in Power Down mode (when executing from RAM)
• VREFINT can be OFF
• The system clock frequency and the number of enabled peripherals are
both limited.
15
Low Power Modes (2/6) 16
16
Low Power Modes (3/6) 17
• LP sleep Mode: Core stopped, peripherals kept running
• Internal regulator is in low power mode to minimize the regulator's operating current.
• FLASH can be in Power Down mode
• VREFINT can be OFF
• Two mechanisms to enter this mode
• Sleep Now: MCU enters SLEEP mode as soon as WFI/WFE instruction are
executed
• Sleep on Exit: MCU enters SLEEP mode as soon as it exits the lowest priority ISR
• To further reduce power consumption you can save power of unused
peripherals by gating their clock
17
Low Power Modes (4/6) 18
• STOP Mode: all periph clocks, PLL, MSI, HSI and HSE are disabled, SRAM and
register contents are preserved.
• If the RTC, LCD and IWDG are running they are not stopped (nor their clock sources)
• To further reduce power consumption the Voltage Regulator can be put in Low Power mode
• Wake-up sources:
• WFI was used for entry: any EXTI Line configured in Interrupt mode (the corresponding EXTI Interrupt
vector must be enabled in the NVIC)
• WFE was used for entry: any EXTI Line configured in event mode
• EXTI line source can be: one of the 16 external lines (so any IO), PVD, RTC alarms, RTC Tamper,
RTC Time Stamp, RTC Wakeup, Comparators 1&2 events, USB wake-up
After resuming from STOP the clock configuration returns to its reset state (MSI, HSI16 or HSI16/4
used as system clock).
• STANDBY Mode: Voltage Regulator off, the entire VCORE domain is powered off and VREFINT
can be OFF.
• SRAM and register contents are lost except registers in the STANDBY circuitry
• Wake-up sources:
• WKUP1, WKUP2 pins rising edge
• RTC alarm A, RTC alarm B, Wakeup Timer, Tamper event, TimeStamp
• External reset in NRST pin
• IWDG reset
After wake-up from STANDBY mode, program execution will restart in the same way as after a RESET.
19
Low Power Modes (6/6) 20
• STM32L0 Low Power modes: uses CortexM Sleep modes
• SLEEP, STOP and STANDBY modes
The reset circuitry, POR/PDR, is active in STANDBY and STOP modes.
STM32L15x
Feature0.9 STM32L0 STM32F10x typ
MD typ
Consumption in RUN mode w/ execute from Flash
140µA/MHz 214µA/MHz -
on Range 3
Consumption in RUN mode w/ execute from RAM on
120µA/MHz 167µA/MHz -
Range 3
Consumption in LP RUN mode w/ execute from RAM
on internal multispeed RC (MSI at 64kHz) 13µA 14µA -
20
Mode name Entry Wakeup
STM32L Low Power modes Effect on Effect on Voltage IO state Wakeup latency
21
Sleep -Peripherals clock stopped automatically -All disabled peripherals will be automatically re-
Sleep now or sleep on- during sleep mode enabled.
exit)
22
Typ current
STM32 L05* - Power consumption 23
Vdd Range
210µA/MHz 85°C
25°C
• Wake up time
• 5μs (flash)
Range1 @ 32MHz
175µA/MHz1 • 3.5 μs (ram)
8µA
139µA/MHz1 • 50μs
4.2 µA
87/MHz 6 µA
1 μA
While {1}
290 nA
3.2 µA 9502 nA
8003 nA 670 nA
4004 nA 270 nA
Dynamic Run Low-Power Run Low-Power Sleep Stop Standby w/ RTC
From Flash @ 32KHz + 1 timer @ 32KHz Standby w/o RTC
1. Dhrystone power consumption value executed from Flash with VDD=3V (Prefetch on and Prefetch off)
2. STOP mode consumption with : Full Ram retention + RTC + Low-power Pulse counter
3. STOP mode consumption with : Full Ram retention + RTC
4. STOP mode consumption with : Full Ram retention
STM32L152 ultra-low-power consumption 24
CPU ON
Peripherals activated
RAM & context preserved
238µA/MHz 85°C
25°C
Startup time:
From Stop: 5 µs
From Standby: 60 µs
300µA/MHz 12µA
Range1 @ 32MHz
6- µA
214µA/MHz
Range 3 @ 4MHz 9 µA
4.8 μA
4.4 µA 1 µA
1.4 µA
570 nA
300 nA
Dynamic Run Low-Power Run Low-Power Sleep Stop w/ RTC Standby
From Flash @ 32kHz @ 32kHz or w/o RTC
24
Quiz 25
____________
____________
• What is the difference between “Sleep Now” and “Sleep on Exit” modes?
____________
____________
25
26
System Peripherals
VDD /VDDA
System RESET
Resets all registers except some RCC
registers and RTC RPU
Sources External
RESET Filter
SYSTEM RESET
WWDG RESET
WWDG/IWDG end of count PULSE IWDG RESET
POR/PDR
GENERATOR Software RESET
A software reset (through NVIC) (min 20µs) Power RESET RESET
Low power BOR
Low power management Reset management RESET
RESET
Option Byte loader
Option byte loader Reset RESET
27
On Chip Oscillators: overview 28
28
On Chip Oscillators LSE 29
LSE feeds the RTC, optionally drives the RTC for Auto Wake-Up (AWU) from STOP/STANDBY
New compared to STM32L1
LSE oscillator has several drive level to fit quartz requirement with adapted consumption
Drive level can be changed from high level (for quick start) to lowest level for
consumption (depending on quartz used)
29
On Chip Oscillators: usage 30
30
Clock Scheme 31
System Clock (SYSCLK) sources RTC Clock (RTCCLK) and LCD Clock USB/SDIO Clock (USBCLK) provided from
(LCDCLK) sources HSI48 or the internal PLL (PLLVCO/2)
MSI
HSI16 LSE
LSI Clock-out capability on the MCO pin
HSE
HSE clock divided by 2, 4, 8 or 16 (PA08/PA09).
PLL
Configurable dividers provides AHB, Clock Security System (CSS) to backup clock in case of HSE clock failure (MSI feeds
the system clock)
APB1/2 and TIM clocks
Enabled by SW w/ interrupt capability linked to Cortex NMI
64kHz, …, 4MHz
MSI RC ADCCLK
HCLK up
16MHz to 32MHz
HSI16 RC
PCLK1 up
1 -24 to 32MHz
MHz
OSC_OUT PLL Mul PLL Div SYSCLK AHB APB1 If (APB1 pres
HSE Osc X3..x48 /2, /3, /4 Prescaler Prescaler =1) x1 TIMxCLK
OSC_IN PLLCLK up to 32 /1,2…512 /1,2,4,8,16 Else x2
MHz TIM2,6
/2
PCLK2 up
to 32MHz
SYSCLK
HSI16 CSS APB2 If (APB2 pres
/1,/2,/4,/8,/ HSE Prescaler =1) x1 TIMxCLK
MCO
16 /1,2,4,8,16 Else x2
PLLCLK TIM21,22
MSI
/2, 4, USBCLK
LSE
8,16
LSI RBGCLK
48MHz
32.768kHz
OSC32_IN RTCCLK
LSE OSc LSE
OSC32_OUT HSI USART clock
CSS LCDCLK Sys
~37kHz LSI Apb
LSI RC IWDGCLK HSI
LSE
LPTIM Sys
HSI I2C clock
Apb
Apb
HSI48 RC
CRS TIM2/21/22 ETRs 31
Peripheral gating
• The clock tree toward each register increase consumption
GPIOB 7 6 5 6
DMA1 18 15 13 18
SYSCFG &
RI 3 2 2 3 µA/MHZ
TIM2 13 11 9 11
TIM6 4 4 4 4
LCD 4 3 3 4
USB 15 7 7 7
PWR 3 3 3 3
DAC 6 5 4.5 5
………..
____________
____________
____________
• What are the clock sources that can feed the PLL input?
____________
____________
33
Universal Synchronous Asynchronous
Receiver Transmitter (USART)
USART Features (1/3) 35
• Dedicated transmission and reception flags (TxE and RxNE) with interrupt capability
USART Features (2/3) 36
• Multi-Processor communication
• USART can enter Mute mode
• Wake up from mute mode (by idle line detection or address mark detection)
When USART_CLK clock is HSI or LSE, the USART is able to wakeup the
MCU from STOP mode.
The sources of wake up from STOP mode can be the standard RXNE interrupt
(the RXNEIE bit must be set before entering Stop mode). Or, a specific
interrupt may be selected through the WUS bit fields in the USART_CR3:
Wake up on RXNE
DMA Capability 40
Master Slave
SCLK SCK
Rx MISO
Tx MOSI
USART NSS
SPI
Full Duplex
Smart Card mode (1/2) 42
USART
Tx
SCLK
Smart Card mode (2/2) STM32L0 vs
STM32L1 43
VDD
USART1 USART2
R = 10 KΩ
Tx Tx
Half Duplex
IrDA SIR Encoder Decoder 45
Once the automatic baudrate detection is activated, the USART will wait for the first character on the RX
line. The auto-baudrate completion is indicated by the setting of ABRF flag.
The clock source frequency must be compatible with the expected communication speed : When
oversampling by 16, the baud rate is between fCK/65535 and fCK/16. When oversampling by 8, the
baudrate is between fCK/65535 and fCK/8).
If the line is noisy, the correct baudrate detection is not guaranteed (BRR content may be corrupted))
USART Interrupts 48
• The MCU wakeup from STOP mode can be done using the standard RXNE interrupt.
In this case, the RXNEIE bit must be set before entering Stop mode.
• In order to be able to wake up the MCU from Stop mode, the UESM bit in the
LPUARTx_CR1 control register must be set prior to entering Stop mode.
When the wakeup event is detected, the WUF flag is set by hardware and a wakeup
interrupt is generated if the WUFIE bit is set.
Quiz 56
____________
____________
• What are the features that are not supported by the LPUART comparing to the USART?
____________
____________
Low Power Timer
LPTIM
Microcontrollers Division – Application Support Solutions Team
March 2013
Features Summary 58
• Up to 8 external triggers
• With configurable active edges: Rising edge, Falling edge and Both edges
• With digital glitch filter to avoid spurious triggers
• Up to 2 operation modes
• Continuous mode: free running mode; many counter overruns are possible
• One Shot mode: Counter stops counting when the overrun value is reached
LPTIM Features (2/3) 60
• Up to 3 configurable waveforms
• PWM waveform
• One Pulse waveform
• Set Once waveform POL = 0
LPTIMx_ARR
LPTIMx_CMP
PWM
OnePulse
SetOnce
LPTIM Features (3/3) 61
• Encoder mode
• Same operation as Encoder mode on General Purpose Timers
• Only available when LPTimer runs in Continuous mode
• Up to 6 interrupt sources
• Compare match interrupt
• Auto-reload match interrupt
• External trigger event interrupt
• Auto-reload register write completed interrupt Useful when LPTIM is clocked by a
clock source different from APB
• Compare register write completed interrupt
• Direction change interrupt; used by Encoder mode
62
Reactive peripheral
Confidential
Comparator as source 63
LSE LSI/LSE/MSI
HSE_RTC
Auto-wakeup int
MCO
LSE
LP GPIOs GPIOs GPIOs
ALARMA/B
• ADC conversion
• DAC conversion
Thank you
www.st.com/stm32l