Unique Features of STM32 Low-Power Timer (LPTIM)

When developing low-power products, we pay close attention to the overall power consumption of the system. So, have you looked into the LPTIM low-power timer?

1

Introduction

In earlier years, the term LPTIM was rarely heard. With the increasing demand for low-power products, MCU manufacturers have introduced LPTIM timers aimed at low-power applications.
Timers are a common peripheral, and their prevalence is due to their wide range of applications.
All MCUs in the STM32 series are equipped with timers, have you compared the differences in timers among various series and models of MCUs?

2

Which STM32 Models Are Equipped with LPTIM Timers?

Among STM32, relatively newer MCUs have models equipped with LPTIM timers.
For example: high-performance MCUs like STM32F7 and H7, low-power MCUs like STM32L0 and L4, and the newly launched G0 and G4 series all feature this LPTIM timer.
For specific MCUs equipped with LPTIM, you can download the corresponding datasheet for details.
This article will focus on the LPTIM timer in the STM32G0.

3

Functions and Features of LPTIM

LPTIM: Low-Power Timer, which means a low-power timer.
LPTIM is a 16-bit timer, benefiting from its low power consumption.
Due to the diverse clock sources of LPTIM, it can maintain operation in all power modes (except standby mode).
Even without an internal clock source, LPTIM can still operate; thus, it can be used as a “pulse counter,” which is very useful in certain applications.
Additionally, LPTIM can wake the system from low-power mode, making it very suitable for implementing “timeout functions” with extremely low power consumption.
LPTIM introduces a flexible clock scheme that provides the required functionality and performance while minimizing power consumption.
I carefully compared the LPTIM low-power timers across various STM32 series and found that many features are essentially the same.
1. Block Diagram
Block diagram of the STM32G0 low-power timer:
Unique Features of STM32 Low-Power Timer (LPTIM)
Block diagram of the STM32L0 low-power timer:
Unique Features of STM32 Low-Power Timer (LPTIM)
By comparing the block diagrams, we can see that this LPTIM on-chip peripheral has similarities.
Of course, some details are different, such as in the STM32H7, where there are multiple LPTIMs, and there are certain differences among these LPTIMs.
2. Main Features of LPTIM
  • 16-bit incrementing counter
  • 3-bit prescaler with 8 selectable division factors (1, 2, 4, 8, 16, 32, 64, and 128)
  • Selectable clock

Internal clock sources: LSE, LSI, HSI, or APB clock

External clock source for LPTIM input (operates without LP oscillator, useful in pulse counter applications)

  • 16-bit ARR auto-reload register
  • 16-bit compare register
  • Continuous/single trigger mode
  • Selectable software/hardware input trigger
  • Programmable digital debounce filter
  • Configurable output: pulse and PWM
  • Configurable I/O polarity
  • Encoder mode
When comparing these features with other basic timers, you will find that many of these features are unique to LPTIM.
3. LPTIM RCC
Compared to other timers, the RCC of LPTIM has richer functionalities.
From the above block diagram, we can see that LPTIM can receive clock signals from multiple clock sources.
It can be clocked by internal clock signals, which can be selected from APB, LSI, LSE, or HSI clock sources through the reset and clock controller (RCC).
4. Interference Filter
This feature is also unique to LPTIM.
The LPTIM input is protected by a digital filter to prevent any glitches and noise interference from propagating internally in LPTIM, thus avoiding unexpected counts or triggers.
Filtering schematic:
Unique Features of STM32 Low-Power Timer (LPTIM)
This principle is relatively simple; if you do not understand, please refer to the reference manual for detailed explanations.
LPTIM timer has many functions, and beginners may feel overwhelmed by the amount of content at first glance. However, breaking down the content makes it much easier to understand.
This article aims to inform more friends about these features. To master the knowledge in depth, one needs to combine the manual and practical programming.
Author: strongerHuang
Source: Embedded Column
Copyright belongs to the original author; if there is any infringement, please contact for deletion.

Leave a Comment