43. Low-power timer (LPTIM)

43.1 Introduction

The LPTIM is a 16-bit timer that benefits from the ultimate developments in power consumption reduction. Thanks to its diversity of clock sources, the LPTIM is able to keep running in all power modes except for Standby mode. Given its capability to run even with no internal clock source, the LPTIM can be used as a “Pulse Counter” which can be useful in some applications. Also, the LPTIM capability to wake up the system from low-power modes, makes it suitable to realize “Timeout functions” with extremely low power consumption.

The LPTIM introduces a flexible clock scheme that provides the needed functionalities and performance, while minimizing the power consumption.

43.2 LPTIM main features

43.3 LPTIM implementation

Table 298 describes LPTIM implementation on STM32MP151 devices. The full set of features is implemented in LPTIM1 and LPTIM2. LPTIM3, LPTIM4 and LPTIM5 support a smaller set of features.

Table 298. STM32MP151 LPTIM features

LPTIM featuresLPTIM1LPTIM2LPTIM3LPTIM4LPTIM5
Encoder modeXX---
External input clockXXX--
Wake-up from Stop + LP-Stop or LPLV-Stop (kernel clock from LSE or LSI only)XXXXX

43.4 LPTIM functional description

43.4.1 LPTIM block diagram

Figure 492. Low-power timer block diagram (LPTIM1 and LPTIM2)

Low-power timer block diagram (LPTIM1 and LPTIM2)

The diagram illustrates the internal architecture of the LPTIM1 and LPTIM2 blocks. It is divided into two main clock domains: the lptim_pclk clock domain and the lptim_ker_ck clock domain.

Inputs and outputs are shown on the left and right sides of the diagram:

The diagram also shows the Synchronization block between the two clock domains, the CLKMUX (0/1), and the Count mode (0/1) selection. The Glitch filter and Mux trigger are also indicated. Diagram reference code: MSv40876V6.

Low-power timer block diagram (LPTIM1 and LPTIM2)

Figure 493. Low-power timer block diagram (LPTIM3)

Block diagram of LPTIM3 showing internal components like LPTIM register interface, IRQ interface, synchronization, and clock domains (lptim_pclk and lptim_ker_ck). It includes inputs for 32-bit APB bus, lptim_pclk, lptim_it, lptim_ker_ck, and lptim_wkup. The internal logic includes a glitch filter, mux trigger, 16-bit ARR, 16-bit counter, and 16-bit compare. Outputs are LPTIM_IN1, LPTIM_OUT, and lptim_out. Reference: MSv40877V6.

This block diagram illustrates the architecture of the LPTIM3 timer. It is divided into two main clock domains: the lptim_pclk clock domain and the lptim_ker_ck clock domain. The lptim_pclk domain contains the LPTIM register interface and the IRQ interface, which are connected to a 32-bit APB bus and the lptim_it interrupt input. A synchronization block connects these two domains. The lptim_ker_ck domain contains the core timer logic. External inputs lptim_in1_mux1, lptim_in1_mux2, and lptim_in1_mux3 are combined into LPTIM_IN1, which passes through a glitch filter. The lptim_ext_trigx input is also processed by a glitch filter and a mux trigger. The mux trigger's output, along with a signal from the 16-bit counter, is fed into a prescaler. The prescaler's output goes to a 16-bit counter, which is also connected to a 16-bit compare register and a 16-bit ARR (Auto-Reload Register). The counter's output is LPTIM_OUT, and its prescaled output is lptim_out. A CLKMUX selects between lptim_ker_ck and lptim_pclk to drive the prescaler. The lptim_wkup input is also shown. Reference: MSv40877V6.

Block diagram of LPTIM3 showing internal components like LPTIM register interface, IRQ interface, synchronization, and clock domains (lptim_pclk and lptim_ker_ck). It includes inputs for 32-bit APB bus, lptim_pclk, lptim_it, lptim_ker_ck, and lptim_wkup. The internal logic includes a glitch filter, mux trigger, 16-bit ARR, 16-bit counter, and 16-bit compare. Outputs are LPTIM_IN1, LPTIM_OUT, and lptim_out. Reference: MSv40877V6.

Figure 494. Low-power timer block diagram (LPTIM4 and LPTIM5)

Block diagram of LPTIM4 and LPTIM5 showing internal components like LPTIM register interface, IRQ interface, synchronization, and clock domains (lptim_pclk and lptim_ker_ck). It includes inputs for 32-bit APB bus, lptim_pclk, lptim_it, lptim_ker_ck, and lptim_wkup. The internal logic includes a glitch filter, mux trigger, 16-bit ARR, 16-bit counter, and 16-bit compare. Outputs are LPTIM_OUT and lptim_out. Reference: MSv40878V6.

This block diagram illustrates the architecture of the LPTIM4 and LPTIM5 timers. Similar to LPTIM3, it features two clock domains: lptim_pclk and lptim_ker_ck. The lptim_pclk domain includes the LPTIM register interface and IRQ interface, connected to the 32-bit APB bus and lptim_it. A synchronization block links the domains. The lptim_ker_ck domain contains the timer's core logic. The lptim_ext_trigx input is processed by a glitch filter and a mux trigger. The mux trigger's output and a signal from the 16-bit counter are fed into a prescaler. The prescaler's output goes to a 16-bit counter, which is also connected to a 16-bit compare register and a 16-bit ARR. The counter's output is LPTIM_OUT, and its prescaled output is lptim_out. The lptim_wkup input is also shown. Reference: MSv40878V6.

Block diagram of LPTIM4 and LPTIM5 showing internal components like LPTIM register interface, IRQ interface, synchronization, and clock domains (lptim_pclk and lptim_ker_ck). It includes inputs for 32-bit APB bus, lptim_pclk, lptim_it, lptim_ker_ck, and lptim_wkup. The internal logic includes a glitch filter, mux trigger, 16-bit ARR, 16-bit counter, and 16-bit compare. Outputs are LPTIM_OUT and lptim_out. Reference: MSv40878V6.

43.4.2 LPTIM pins and internal signals

The following tables provide the list of LPTIM pins and internal signals, respectively.

Table 299. LPTIM input/output pins

NamesSignal typeDescription
LPTIM_IN1Digital inputLPTIM Input 1 from GPIO pin on mux input 0
LPTIM_IN2Digital inputLPTIM Input 2 from GPIO pin on mux input 0
LPTIM_ETRDigital inputLPTIM external trigger GPIO pin
LPTIM_OUTDigital outputLPTIM Output GPIO pin

Table 300. LPTIM internal signals

NamesSignal typeDescription
lptim_pclkDigital inputLPTIM APB clock domain
lptim_ker_ckDigital inputLPTIM kernel clock
lptim_in1_mux1Digital inputInternal LPTIM input 1 connected to mux input 1
lptim_in1_mux2Digital inputInternal LPTIM input 1 connected to mux input 2
lptim_in1_mux3Digital inputInternal LPTIM input 1 connected to mux input 3
lptim_in2_mux1Digital inputInternal LPTIM input 2 connected to mux input 1
lptim_in2_mux2Digital inputInternal LPTIM input 2 connected to mux input 2
lptim_in2_mux3Digital inputInternal LPTIM input 2 connected to mux input 3
lptim_ext_trigxDigital inputLPTIM external trigger input x
lptim_outDigital outputLPTIM counter output
lptim_itDigital outputLPTIM global interrupt
lptim_wakeupDigital outputLPTIM wake-up event

43.4.3 LPTIM input and trigger mapping

The LPTIM external trigger and input connections are detailed hereafter:

Table 301. LPTIM1 external trigger connection

TRIGSELExternal trigger
lptim_ext_trig0GPIO pin as LPTIM1_ETR alternate function
lptim_ext_trig1RTC_ALARMA
lptim_ext_trig2RTC_ALARM_B
lptim_ext_trig3RTC_TAMP1_OUT
lptim_ext_trig4RTC_TAMP2_OUT
lptim_ext_trig5RTC_TAMP3_OUT
Table 301. LPTIM1 external trigger connection (continued)
TRIGSELExternal trigger
lptim_ext_trig6Not connected
lptim_ext_trig7Not connected
Table 302. LPTIM2 external trigger connection
TRIGSELExternal trigger
lptim_ext_trig0GPIO pin as LPTIM2_ETR alternate function
lptim_ext_trig1RTC_ALARM_A
lptim_ext_trig2RTC_ALARM_B
lptim_ext_trig3RTC_TAMP1_OUT
lptim_ext_trig4RTC_TAMP2_OUT
lptim_ext_trig5RTC_TAMP3_OUT
lptim_ext_trig6Not connected
lptim_ext_trig7Not connected
Table 303. LPTIM3 external trigger connection
TRIGSELExternal trigger
lptim_ext_trig0LPTIM2_OUT
lptim_ext_trig1Not connected
lptim_ext_trig2LPTIM4_OUT
lptim_ext_trig3LPTIM5_OUT
lptim_ext_trig4SAI1_FS_A
lptim_ext_trig5SAI1_FS_B
lptim_ext_trig6Not connected
lptim_ext_trig7Not connected
Table 304. LPTIM4 external trigger connection
TRIGSELExternal trigger
lptim_ext_trig0LPTIM2_OUT
lptim_ext_trig1LPTIM3_OUT
lptim_ext_trig2Not connected
lptim_ext_trig3LPTIM5_OUT
lptim_ext_trig4SAI2_FS_A
lptim_ext_trig5SAI2_FS_B
Table 304. LPTIM4 external trigger connection (continued)
TRIGSELExternal trigger
lptim_ext_trig6Not connected
lptim_ext_trig7Not connected
Table 305. LPTIM5 external trigger connection
TRIGSELExternal trigger
lptim_ext_trig0LPTIM2_OUT
lptim_ext_trig1LPTIM3_OUT
lptim_ext_trig2LPTIM4_OUT
lptim_ext_trig3SAI4_FS_A
lptim_ext_trig4SAI4_FS_B
lptim_ext_trig5Not connected
lptim_ext_trig6Not connected
lptim_ext_trig7Not connected
Table 306. LPTIM1 input 1 connection
lptim_in1_muxLPTIM1 input 1 connected to
lptim_in1_mux0GPIO pin as LPTIM1_IN1 alternate function
lptim_in1_mux1Not connected
lptim_in1_mux2Not connected
lptim_in1_mux3Not connected
Table 307. LPTIM1 input 2 connection
lptim_in2_muxLPTIM1 input 2 connected to
lptim_in2_mux0GPIO pin as LPTIM1_IN2 alternate function
lptim_in2_mux1Not connected
lptim_in2_mux2Not connected
lptim_in2_mux3Not connected
Table 308. LPTIM2 input 1 connection
lptim_in1_muxLPTIM2 input 1 connected to
lptim_in1_mux0GPIO pin as LPTIM2_IN1 alternate function
lptim_in1_mux1Not connected
lptim_in1_mux2Not connected
lptim_in1_mux3Not connected
Table 309. LPTIM2 input 2 connection
lptim_in2_muxLPTIM2 input 2 connected to
lptim_in2_mux0GPIO pin as LPTIM2_IN2 alternate function
lptim_in2_mux1Not connected
lptim_in2_mux2Not connected
lptim_in2_mux3Not connected
Table 310. LPTIM3 input 1 connection
lptim_in1_muxLPTIM3 Input 1 connected to
lptim_in1_mux0Not connected
lptim_in1_mux1SAI4_FS_A
lptim_in1_mux2SAI4_FS_B
lptim_in1_mux3Not connected

43.4.4 LPTIM reset and clocks

The LPTIM can be clocked using several clock sources. It can be clocked using an internal clock signal which can be any configurable internal clock source selectable through the RCC (see RCC section for more details). Also, the LPTIM can be clocked using an external clock signal injected on its external Input1. When clocked with an external clock source, the LPTIM may run in one of these two possible configurations:

Programming the CKSEL and COUNTMODE bits allows controlling whether the LPTIM will use an external clock source or an internal one.

When configured to use an external clock source, the CKPOL bits are used to select the external clock signal active edge. If both edges are configured to be active ones, an internal clock signal should also be provided (first configuration). In this case, the internal clock signal frequency should be at least four times higher than the external clock signal frequency.

43.4.5 Glitch filter

The LPTIM inputs, either external (mapped to GPIOs) or internal (mapped on the chip-level to other embedded peripherals), are protected with digital filters that prevent any glitches and noise perturbations to propagate inside the LPTIM. This is in order to prevent spurious counts or triggers.

Before activating the digital filters, an internal clock source should first be provided to the LPTIM. This is necessary to guarantee the proper operation of the filters.

The digital filters are divided into two groups:

Note: The digital filters sensitivity is controlled by groups. It is not possible to configure each digital filter sensitivity separately inside the same group.

The filter sensitivity acts on the number of consecutive equal samples that should be detected on one of the LPTIM inputs to consider a signal level change as a valid transition. Figure 495 shows an example of glitch filter behavior in case of a 2 consecutive samples programmed.

Figure 495. Glitch filter timing diagram

Timing diagram for a glitch filter showing CLKMUX, Input, and Filter out signals. The Input signal has a glitch (a short pulse) that is filtered out by the Filter out signal. The diagram shows two groups of 2 consecutive samples. The first group shows a glitch on the Input signal that is not reflected in the Filter out signal. The second group shows a valid transition on the Input signal that is reflected in the Filter out signal. The Filter out signal is labeled 'Filtered'.

The diagram illustrates the behavior of a glitch filter. It shows three signals: CLKMUX (a periodic clock), Input (a signal with a glitch), and Filter out (the filtered signal). The Input signal has a short pulse (glitch) that is not reflected in the Filter out signal. The Filter out signal is labeled 'Filtered'. The diagram also shows two groups of 2 consecutive samples, indicating the filter's sensitivity to consecutive samples.

Timing diagram for a glitch filter showing CLKMUX, Input, and Filter out signals. The Input signal has a glitch (a short pulse) that is filtered out by the Filter out signal. The diagram shows two groups of 2 consecutive samples. The first group shows a glitch on the Input signal that is not reflected in the Filter out signal. The second group shows a valid transition on the Input signal that is reflected in the Filter out signal. The Filter out signal is labeled 'Filtered'.

Note: In case no internal clock signal is provided, the digital filter must be deactivated by setting the CKFLT and TRGFLT bits to '0'. In that case, an external analog filter may be used to protect the LPTIM external inputs against glitches.

43.4.6 Prescaler

The LPTIM 16-bit counter is preceded by a configurable power-of-2 prescaler. The prescaler division ratio is controlled by the PRESC[2:0] 3-bit field. The table below lists all the possible division ratios:

Table 311. Prescaler division ratios

programmingdividing factor
000/1
001/2
010/4
011/8
100/16
101/32
110/64
111/128

43.4.7 Trigger multiplexer

The LPTIM counter may be started either by software or after the detection of an active edge on one of the 8 trigger inputs.

TRIGEN[1:0] is used to determine the LPTIM trigger source:

The external triggers are considered asynchronous signals for the LPTIM. So after a trigger detection, a two-counter-clock period latency is needed before the timer starts running due to the synchronization.

If a new trigger event occurs when the timer is already started it will be ignored (unless timeout function is enabled).

Note: The timer must be enabled before setting the SNGSTRT/CNTSTRT bits. Any write on these bits when the timer is disabled will be discarded by hardware.

Note: When starting the counter by software (TRIGEN[1:0] = 00), there is a delay of 3 kernel clock cycles between the LPTIM_CR register update (set one of SNGSTRT or CNTSTRT bits) and the effective start of the counter.

43.4.8 Operating mode

The LPTIM features two operating modes:

One-shot mode

To enable the one-shot counting, the SNGSTRT bit must be set.

A new trigger event will re-start the timer. Any trigger event occurring after the counter starts and before the counter reaches ARR will be discarded.

In case an external trigger is selected, each external trigger event arriving after the SNGSTRT bit is set, and after the counter register has stopped (contains zero value), will start the counter for a new one-shot counting cycle as shown in Figure 496.

Figure 496. LPTIM output waveform, single counting mode configuration

Figure 496: LPTIM output waveform, single counting mode configuration. The diagram shows three cycles of LPTIM operation. The top trace is the LPTIM counter, which ramps up linearly from 0 to LPTIM_ARR and then resets. The middle trace is the Compare signal, which is high when the counter is below the Compare level and low otherwise. The bottom trace is the PWM output, which is high when the counter is below the Compare level and low otherwise. External trigger events are indicated by lightning bolt symbols. The first trigger event starts the counter, and subsequent trigger events are ignored.

MSv39230V2

Figure 496: LPTIM output waveform, single counting mode configuration. The diagram shows three cycles of LPTIM operation. The top trace is the LPTIM counter, which ramps up linearly from 0 to LPTIM_ARR and then resets. The middle trace is the Compare signal, which is high when the counter is below the Compare level and low otherwise. The bottom trace is the PWM output, which is high when the counter is below the Compare level and low otherwise. External trigger events are indicated by lightning bolt symbols. The first trigger event starts the counter, and subsequent trigger events are ignored.

Set-once mode activated:

It should be noted that when the WAVE bit-field in the LPTIM_CFGR register is set, the Set-once mode is activated. In this case, the counter is only started once following the first trigger, and any subsequent trigger event is discarded as shown in Figure 497.

Figure 497. LPTIM output waveform, Single counting mode configuration and Set-once mode activated (WAVE bit is set)

Figure 497: LPTIM output waveform, Single counting mode configuration and Set-once mode activated (WAVE bit is set). The diagram shows a single cycle of LPTIM operation. The top trace is the LPTIM counter, which ramps up linearly from 0 to LPTIM_ARR and then resets. The middle trace is the Compare signal, which is high when the counter is below the Compare level and low otherwise. The bottom trace is the PWM output, which is high when the counter is below the Compare level and low otherwise. External trigger events are indicated by lightning bolt symbols. The first trigger event starts the counter, and any subsequent trigger event is discarded, as indicated by the 'Discarded trigger' label.

MSv39231V2

Figure 497: LPTIM output waveform, Single counting mode configuration and Set-once mode activated (WAVE bit is set). The diagram shows a single cycle of LPTIM operation. The top trace is the LPTIM counter, which ramps up linearly from 0 to LPTIM_ARR and then resets. The middle trace is the Compare signal, which is high when the counter is below the Compare level and low otherwise. The bottom trace is the PWM output, which is high when the counter is below the Compare level and low otherwise. External trigger events are indicated by lightning bolt symbols. The first trigger event starts the counter, and any subsequent trigger event is discarded, as indicated by the 'Discarded trigger' label.

In case of software start (TRIGEN[1:0] = '00'), the SNGSTRT setting will start the counter for one-shot counting.

Continuous mode

To enable the continuous counting, the CNTSTRT bit must be set.

In case an external trigger is selected, an external trigger event arriving after CNTSTRT is set will start the counter for continuous counting. Any subsequent external trigger event will be discarded as shown in Figure 498.

In case of software start (TRIGEN[1:0] = '00'), setting CNTSTRT will start the counter for continuous counting.

Figure 498. LPTIM output waveform, Continuous counting mode configuration

Figure 498: LPTIM output waveform, Continuous counting mode configuration. The diagram shows three synchronized waveforms: a sawtooth counter, a compare level, and a PWM output. The counter starts at 0 and increases linearly. When it reaches the compare level, it resets to 0, generating a high pulse on the PWM output. External trigger events (lightning bolts) are shown resetting the counter to 0. Some triggers occurring while the counter is already high are labeled as 'Discarded triggers'. The PWM output is low by default and goes high during the compare match. The diagram is labeled MSv39229V2.
Figure 498: LPTIM output waveform, Continuous counting mode configuration. The diagram shows three synchronized waveforms: a sawtooth counter, a compare level, and a PWM output. The counter starts at 0 and increases linearly. When it reaches the compare level, it resets to 0, generating a high pulse on the PWM output. External trigger events (lightning bolts) are shown resetting the counter to 0. Some triggers occurring while the counter is already high are labeled as 'Discarded triggers'. The PWM output is low by default and goes high during the compare match. The diagram is labeled MSv39229V2.

SNGSTRT and CNTSTRT bits can only be set when the timer is enabled (The ENABLE bit is set to '1'). It is possible to change “on the fly” from One-shot mode to Continuous mode.

If the Continuous mode was previously selected, setting SNGSTRT will switch the LPTIM to the One-shot mode. The counter (if active) will stop as soon as it reaches ARR.

If the One-shot mode was previously selected, setting CNTSTRT will switch the LPTIM to the Continuous mode. The counter (if active) will restart as soon as it reaches ARR.

43.4.9 Timeout function

The detection of an active edge on one selected trigger input can be used to reset the LPTIM counter. This feature is controlled through the TIMOUT bit.

The first trigger event will start the timer, any successive trigger event will reset the counter and the timer will restart.

A low-power timeout function can be realized. The timeout value corresponds to the compare value; if no trigger occurs within the expected time frame, the MCU is waked-up by the compare match event.

43.4.10 Waveform generation

Two 16-bit registers, the LPTIM_ARR (autoreload register) and LPTIM_CMP (compare register), are used to generate several different waveforms on LPTIM output

The timer can generate the following waveforms:

The above described modes require that the LPTIM_ARR register value be strictly greater than the LPTIM_CMP register value.

The LPTIM output waveform can be configured through the WAVE bit as follow:

The WAVPOL bit controls the LPTIM output polarity. The change takes effect immediately, so the output default value will change immediately after the polarity is re-configured, even before the timer is enabled.

Signals with frequencies up to the LPTIM clock frequency divided by 2 can be generated. Figure 499 below shows the three possible waveforms that can be generated on the LPTIM output. Also, it shows the effect of the polarity change using the WAVPOL bit.

Figure 499. Waveform generation

Figure 499: Waveform generation diagram showing LPTIM_ARR Compare, PWM, One shot, and Set once waveforms for Pol = 0 and Pol = 1.

The diagram illustrates the LPTIM output waveforms for different configurations. It is divided into two main sections: Pol = 0 (top) and Pol = 1 (bottom). Each section shows the LPTIM_ARR Compare signal (a sawtooth wave) and the resulting output signals: PWM, One shot, and Set once. Vertical dashed lines indicate the start of each period. In the Pol = 0 section, the PWM signal is high when the compare signal is below the compare level, and the One shot signal is a single high pulse at the start of each period. In the Pol = 1 section, the PWM signal is low when the compare signal is below the compare level, and the One shot signal is a single low pulse at the start of each period. The Set once signal is a single high pulse at the start of the first period in both sections.

Figure 499: Waveform generation diagram showing LPTIM_ARR Compare, PWM, One shot, and Set once waveforms for Pol = 0 and Pol = 1.

MS32467V2

43.4.11 Register update

The LPTIM_ARR register and LPTIM_CMP register are updated immediately after the APB bus write operation, or at the end of the current period if the timer is already started.

The PRELOAD bit controls how the LPTIM_ARR and the LPTIM_CMP registers are updated:

The LPTIM APB interface and the LPTIM kernel logic use different clocks, so there is some latency between the APB write and the moment when these values are available to the

counter comparator. Within this latency period, any additional write into these registers must be avoided.

The ARROK flag and the CMPOK flag in the LPTIM_ISR register indicate when the write operation is completed to respectively the LPTIM_ARR register and the LPTIM_CMP register.

After a write to the LPTIM_ARR register or the LPTIM_CMP register, a new write operation to the same register can only be performed when the previous write operation is completed. Any successive write before respectively the ARROK flag or the CMPOK flag be set, will lead to unpredictable results.

43.4.12 Counter mode

The LPTIM counter can be used to count external events on the LPTIM Input1 or it can be used to count internal clock cycles. The CKSEL and COUNTMODE bits control which source will be used for updating the counter.

In case the LPTIM is configured to count external events on Input1, the counter can be updated following a rising edge, falling edge or both edges depending on the value written to the CKPOL[1:0] bits.

The count modes below can be selected, depending on CKSEL and COUNTMODE values:

43.4.13 Timer enable

The ENABLE bit located in the LPTIM_CR register is used to enable/disable the LPTIM kernel logic. After setting the ENABLE bit, a delay of two counter clock is needed before the LPTIM is actually enabled.

The LPTIM_CFGR and LPTIM_IER registers must be modified only when the LPTIM is disabled.

43.4.14 Timer counter reset

In order to reset the content of LPTIM_CNT register to zero, two reset mechanisms are implemented:


Warning: There is no mechanism inside the LPTIM that prevents the two reset mechanisms from being used simultaneously. So developer should make sure that these two mechanisms are used exclusively.


43.4.15 Encoder mode

This mode allows handling signals from quadrature encoders used to detect angular position of rotary elements. Encoder interface mode acts simply as an external clock with direction selection. This means that the counter just counts continuously between 0 and the auto-reload value programmed into the LPTIM_ARR register (0 up to ARR or ARR down to 0 depending on the direction). Therefore LPTIM_ARR must be configured before starting the counter. From the two external input signals, Input1 and Input2, a clock signal is generated to clock the LPTIM counter. The phase between those two signals determines the counting direction.

The Encoder mode is only available when the LPTIM is clocked by an internal clock source. The signals frequency on both Input1 and Input2 inputs must not exceed the LPTIM internal clock frequency divided by 4. This is mandatory in order to guarantee a proper operation of the LPTIM.

Direction change is signaled by the two Down and Up flags in the LPTIM_ISR register. Also, an interrupt can be generated for both direction change events if enabled through the DOWNIE bit.

To activate the Encoder mode the ENC bit has to be set to '1'. The LPTIM must first be configured in Continuous mode.

When Encoder mode is active, the LPTIM counter is modified automatically following the speed and the direction of the incremental encoder. Therefore, its content always represents the encoder's position. The count direction, signaled by the Up and Down flags, correspond to the rotation direction of the encoder rotor.

According to the edge sensitivity configured using the CKPOL[1:0] bits, different counting scenarios are possible. The following table summarizes the possible combinations, assuming that Input1 and Input2 do not switch at the same time.

Table 312. Encoder counting scenarios

Active edgeLevel on opposite signal (Input1 for Input2, Input2 for Input1)Input1 signalInput2 signal
RisingFallingRisingFalling
Rising EdgeHighDownNo countUpNo count
LowUpNo countDownNo count
Falling EdgeHighNo countUpNo countDown
LowNo countDownNo countUp
Both EdgesHighDownUpUpDown
LowUpDownDownUp

The following figure shows a counting sequence for Encoder mode where both-edge sensitivity is configured.

Caution: In this mode the LPTIM must be clocked by an internal clock source, so the CKSEL bit must be maintained to its reset value which is equal to '0'. Also, the prescaler division ratio must be equal to its reset value which is 1 (PRESC[2:0] bits must be '000').

Figure 500. Encoder mode counting sequence

Timing diagram for Encoder mode counting sequence showing T1, T2, and Counter signals. T1 and T2 are complementary square waves. The Counter signal increments during the 'up' phase (T1 high, T2 low) and decrements during the 'down' phase (T1 low, T2 high). The diagram shows three phases: 'up', 'down', and 'up'.

The diagram illustrates the encoder mode counting sequence. It shows three signals: T1, T2, and Counter. T1 and T2 are complementary square waves. The Counter signal increments during the 'up' phase (T1 high, T2 low) and decrements during the 'down' phase (T1 low, T2 high). The diagram shows three phases: 'up', 'down', and 'up'. The Counter signal starts at a low value, increments during the first 'up' phase, decrements during the 'down' phase, and increments again during the final 'up' phase. The reference ID MS32491V1 is located in the bottom right corner of the diagram area.

Timing diagram for Encoder mode counting sequence showing T1, T2, and Counter signals. T1 and T2 are complementary square waves. The Counter signal increments during the 'up' phase (T1 high, T2 low) and decrements during the 'down' phase (T1 low, T2 high). The diagram shows three phases: 'up', 'down', and 'up'.

43.4.16 Debug mode

When the microcontroller enters debug mode (core halted), the LPTIM counter either continues to work normally or stops, depending on the DBG_LPTIM_STOP configuration bit in the DBG module.

43.5 LPTIM low-power modes

Table 313. Effect of low-power modes on the LPTIM

ModeDescription
CSleep (MPU or MCU sub-system state)No effect. LPTIM interrupts cause the sub-system to exit CSleep mode.
Stop + LP-StopIf the LPTIM is clocked by an oscillator available in Stop mode, LPTIM is functional and the interrupts cause the device to exit the Stop mode.
LPLV-StopSame as Stop + LP-Stop mode, except that only LSE or LSI are allowed as kernel clock source.
Standby or ShutdownThe LPTIM peripheral is powered down and must be reinitialized after exiting Standby mode.

43.6 LPTIM interrupts

The following events generate an interrupt/wake-up event, if they are enabled through the LPTIM_IER register:

Note: If any bit in the LPTIM_IER register (Interrupt Enable Register) is set after that its corresponding flag in the LPTIM_ISR register (Status Register) is set, the interrupt is not asserted.

Table 314. Interrupt events

Interrupt eventDescription
Compare matchInterrupt flag is raised when the content of the Counter register (LPTIM_CNT) matches the content of the compare register (LPTIM_CMP).
Auto-reload matchInterrupt flag is raised when the content of the Counter register (LPTIM_CNT) matches the content of the Auto-reload register (LPTIM_ARR).
External trigger eventInterrupt flag is raised when an external trigger event is detected
Auto-reload register update OKInterrupt flag is raised when the write operation to the LPTIM_ARR register is complete.
Compare register update OKInterrupt flag is raised when the write operation to the LPTIM_CMP register is complete.
Direction changeUsed in Encoder mode. Two interrupt flags are embedded to signal direction change:
  • – UP flag signals up-counting direction change
  • – DOWN flag signals down-counting direction change.

43.7 LPTIM registers

Refer to Section 1.2: List of abbreviations for registers for a list of abbreviations used in register descriptions.

The peripheral registers can only be accessed by words (32-bit).

43.7.1 LPTIM interrupt and status register (LPTIM_ISR)

Address offset: 0x000

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.DOWNUPARROKCMP OKEXT TRIGARRMCMPM
rrrrrrr

Bits 31:7 Reserved, must be kept at reset value.

Bit 6 DOWN: Counter direction change up to down

In Encoder mode, DOWN bit is set by hardware to inform application that the counter direction has changed from up to down. DOWN flag can be cleared by writing 1 to the DOWNCF bit in the LPTIM_ICR register.

Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to Section 43.3: LPTIM implementation.

Bit 5 UP: Counter direction change down to up

In Encoder mode, UP bit is set by hardware to inform application that the counter direction has changed from down to up. UP flag can be cleared by writing 1 to the UPCF bit in the LPTIM_ICR register.

Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to Section 43.3: LPTIM implementation.

Bit 4 ARROK: Autoreload register update OK

ARROK is set by hardware to inform application that the APB bus write operation to the LPTIM_ARR register has been successfully completed. ARROK flag can be cleared by writing 1 to the ARROKCF bit in the LPTIM_ICR register.

Bit 3 CMPOK: Compare register update OK

CMPOK is set by hardware to inform application that the APB bus write operation to the LPTIM_CMP register has been successfully completed. CMPOK flag can be cleared by writing 1 to the CMPOKCF bit in the LPTIM_ICR register.

Bit 2 EXTTRIG: External trigger edge event

EXTTRIG is set by hardware to inform application that a valid edge on the selected external trigger input has occurred. If the trigger is ignored because the timer has already started, then this flag is not set. EXTTRIG flag can be cleared by writing 1 to the EXTTRIGCF bit in the LPTIM_ICR register.

Bit 1 ARRM: Autoreload match

ARRM is set by hardware to inform application that LPTIM_CNT register's value reached the LPTIM_ARR register's value. ARRM flag can be cleared by writing 1 to the ARRMCF bit in the LPTIM_ICR register.

Bit 0 CMPM: Compare match

The CMPM bit is set by hardware to inform application that LPTIM_CNT register value reached the LPTIM_CMP register's value. CMPM flag can be cleared by writing 1 to the CMPMCF bit in the LPTIM_ICR register.

43.7.2 LPTIM interrupt clear register (LPTIM_ICR)

Address offset: 0x004

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.DOWN
CF
UPCFARRO
KCF
CMPO
KCF
EXTTR
IGCF
ARRM
CF
CMPM
CF
wwwwwww

Bits 31:7 Reserved, must be kept at reset value.

Bit 6 DOWNCF: Direction change to down clear flag

Writing 1 to this bit clear the DOWN flag in the LPTIM_ISR register.

Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to Section 43.3: LPTIM implementation.

Bit 5 UPCF: Direction change to UP clear flag

Writing 1 to this bit clear the UP flag in the LPTIM_ISR register.

Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to Section 43.3: LPTIM implementation.

Bit 4 ARROKCF: Autoreload register update OK clear flag

Writing 1 to this bit clears the ARROK flag in the LPTIM_ISR register

Bit 3 CMPOKCF: Compare register update OK clear flag

Writing 1 to this bit clears the CMPOK flag in the LPTIM_ISR register

Bit 2 EXTTRIGCF: External trigger valid edge clear flag

Writing 1 to this bit clears the EXTTRIG flag in the LPTIM_ISR register

Bit 1 ARRMCF: Autoreload match clear flag

Writing 1 to this bit clears the ARRM flag in the LPTIM_ISR register

Bit 0 CMPMCF: Compare match clear flag

Writing 1 to this bit clears the CMPM flag in the LPTIM_ISR register

43.7.3 LPTIM interrupt enable register (LPTIM_IER)

Address offset: 0x008

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.DOWNI
E
UPIEARRO
KIE
CMPO
KIE
EXT
TRIGIE
ARRM
IE
CMPM
IE
rwrwrwrwrwrwrw

Bits 31:7 Reserved, must be kept at reset value.

Bit 6 DOWNIE: Direction change to down Interrupt Enable

Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to Section 43.3: LPTIM implementation.

Bit 5 UPIE: Direction change to UP Interrupt Enable

Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to Section 43.3: LPTIM implementation.

Bit 4 ARROKIE: Autoreload register update OK Interrupt Enable

Bit 3 CMPOKIE: Compare register update OK Interrupt Enable

Bit 2 EXTTRIGIE: External trigger valid edge Interrupt Enable

Bit 1 ARRMIE: Autoreload match Interrupt Enable

Bit 0 CMPMIE: Compare match Interrupt Enable

Caution: The LPTIM_IER register must only be modified when the LPTIM is disabled (ENABLE bit reset to '0')

43.7.4 LPTIM configuration register (LPTIM_CFGR)

Address offset: 0x00C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.ENCCOUNT
MODE
PRELOADWAVPOLWAVETIMOUTTRIGEN[1:0]Res.
rwrwrwrwrwrwrwrw
1514131211109876543210
TRIGSEL[2:0]Res.PRESC[2:0]Res.TRGFLT[1:0]Res.CKFLT[1:0]CKPOL[1:0]CKSEL
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 Reserved, must be kept at reset value.

Bit 29 Reserved, must be kept at reset value.

Bits 28:25 Reserved, must be kept at reset value.

Bits 15:13 TRIGSEL[2:0]: Trigger selector

The TRIGSEL bits select the trigger source that will serve as a trigger event for the LPTIM among the below 8 available sources:

000: lptim_ext_trig0

001: lptim_ext_trig1

010: lptim_ext_trig2

011: lptim_ext_trig3

100: lptim_ext_trig4

101: lptim_ext_trig5

110: lptim_ext_trig6

111: lptim_ext_trig7

See Section 43.4.3: LPTIM input and trigger mapping for details.

Bit 12 Reserved, must be kept at reset value.

Bits 11:9 PRESC[2:0]: Clock prescaler

The PRESC bits configure the prescaler division factor. It can be one among the following division factors:

000: /1

001: /2

010: /4

011: /8

100: /16

101: /32

110: /64

111: /128

Bit 8 Reserved, must be kept at reset value.

Bits 7:6 TRGFLT[1:0]: Configurable digital filter for trigger

The TRGFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an internal trigger before it is considered as a valid level transition. An internal clock source must be present to use this feature

00: any trigger active level change is considered as a valid trigger

01: trigger active level change must be stable for at least 2 clock periods before it is considered as valid trigger.

10: trigger active level change must be stable for at least 4 clock periods before it is considered as valid trigger.

11: trigger active level change must be stable for at least 8 clock periods before it is considered as valid trigger.

Bit 5 Reserved, must be kept at reset value.

Bits 4:3 CKFLT[1:0]: Configurable digital filter for external clock

The CKFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an external clock signal before it is considered as a valid level transition. An internal clock source must be present to use this feature

Bits 2:1 CKPOL[1:0]: Clock polarity

If LPTIM is clocked by an external clock source:

When the LPTIM is clocked by an external clock source, CKPOL bits is used to configure the active edge or edges used by the counter:

Refer to Section 43.4.15: Encoder mode for more details about Encoder mode sub-modes.

Bit 0 CKSEL: Clock selector

The CKSEL bit selects which clock source the LPTIM will use:

Caution: The LPTIM_CFGR register must only be modified when the LPTIM is disabled (ENABLE bit reset to '0').

43.7.5 LPTIM control register (LPTIM_CR)

Address offset: 0x010

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RST
ARE
COUN
TRST
CNT
STRT
SNG
STRT
ENA
BLE
rwrsrwrwrw

Bits 31:5 Reserved, must be kept at reset value.

Bit 4 RSTARE: Reset after read enable

This bit is set and cleared by software. When RSTARE is set to '1', any read access to LPTIM_CNT register will asynchronously reset LPTIM_CNT register content.

This bit can be set only when the LPTIM is enabled.

Bit 3 COUNTRST: Counter reset

This bit is set by software and cleared by hardware. When set to '1' this bit will trigger a synchronous reset of the LPTIM_CNT counter register. Due to the synchronous nature of this reset, it only takes place after a synchronization delay of 3 LPTimer core clock cycles (LPTimer core clock may be different from APB clock).

This bit can be set only when the LPTIM is enabled. It is automatically reset by hardware.

Caution: COUNTRST must never be set to '1' by software before it is already cleared to '0' by hardware. Software should consequently check that COUNTRST bit is already cleared to '0' before attempting to set it to '1'.

Bit 2 CNTSTRT: Timer start in Continuous mode

This bit is set by software and cleared by hardware.

In case of software start (TRIGEN[1:0] = '00'), setting this bit starts the LPTIM in Continuous mode.

If the software start is disabled (TRIGEN[1:0] different than '00'), setting this bit starts the timer in Continuous mode as soon as an external trigger is detected.

If this bit is set when a single pulse mode counting is ongoing, then the timer will not stop at the next match between the LPTIM_ARR and LPTIM_CNT registers and the LPTIM counter keeps counting in Continuous mode.

This bit can be set only when the LPTIM is enabled. It will be automatically reset by hardware.

Bit 1 SNGSTRT: LPTIM start in Single mode

This bit is set by software and cleared by hardware.

In case of software start (TRIGEN[1:0] = '00'), setting this bit starts the LPTIM in single pulse mode.

If the software start is disabled (TRIGEN[1:0] different than '00'), setting this bit starts the LPTIM in single pulse mode as soon as an external trigger is detected.

If this bit is set when the LPTIM is in continuous counting mode, then the LPTIM will stop at the following match between LPTIM_ARR and LPTIM_CNT registers.

This bit can only be set when the LPTIM is enabled. It will be automatically reset by hardware.

Bit 0 ENABLE: LPTIM enable

The ENABLE bit is set and cleared by software.

0:LPTIM is disabled

1:LPTIM is enabled

43.7.6 LPTIM compare register (LPTIM_CMP)

Address offset: 0x014

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
CMP[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 CMP[15:0]: Compare value

CMP is the compare value used by the LPTIM.

Caution: The LPTIM_CMP register must only be modified when the LPTIM is enabled (ENABLE bit set to '1').

43.7.7 LPTIM autoreload register (LPTIM_ARR)

Address offset: 0x018

Reset value: 0x0000 0001

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
ARR[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 ARR[15:0]: Auto reload value

ARR is the autoreload value for the LPTIM.

This value must be strictly greater than the CMP[15:0] value.

Caution: The LPTIM_ARR register must only be modified when the LPTIM is enabled (ENABLE bit set to '1').

43.7.8 LPTIM counter register (LPTIM_CNT)

Address offset: 0x01C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
CNT[15:0]
rrrrrrrrrrrrrrrr

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 CNT[15:0]: Counter value

When the LPTIM is running with an asynchronous clock, reading the LPTIM_CNT register may return unreliable values. So in this case it is necessary to perform two consecutive read accesses and verify that the two returned values are identical.

It should be noted that for a reliable LPTIM_CNT register read access, two consecutive read accesses must be performed and compared. A read access can be considered reliable when the values of the two consecutive read accesses are equal.

43.7.9 LPTIM configuration register 2 (LPTIM_CFGR2)

Address offset: 0x024

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.IN2SEL[1:0]Res.Res.IN1SEL[1:0]
rwrwrwrw

Bits 31:6 Reserved, must be kept at reset value.

Bits 5:4 IN2SEL[1:0]: LPTIM input 2 selection

The IN2SEL bits control the LPTIM Input 2 multiplexer, which connect LPTIM Input 2 to one of the available inputs.

00: lptim_in2_mux0

01: lptim_in2_mux1

10: lptim_in2_mux2

11: lptim_in2_mux3

For connection details refer to Section 43.4.3: LPTIM input and trigger mapping.

Note: If the LPTIM does not support encoder mode feature, these bits are reserved. Please refer to Section 43.3: LPTIM implementation.

Bits 3:2 Reserved, must be kept at reset value.

Bits 1:0 IN1SEL[1:0]: LPTIM input 1 selection

The IN1SEL bits control the LPTIM Input 1 multiplexer, which connects LPTIM Input 1 to one of the available inputs.

00: lptim_in1_mux0

01: lptim_in1_mux1

10: lptim_in1_mux2

11: lptim_in1_mux3

For connection details refer to Section 43.4.3: LPTIM input and trigger mapping.

Note: If LPTIM does not implement external input clock, these bits are reserved. Please refer to Section 43.3: LPTIM implementation.

Caution: The LPTIM_CFGR2 register must only be modified when the LPTIM is disabled (ENABLE bit reset to '0').

43.7.10 LPTIM x peripheral hardware configuration register (LPTIMx_HWCFGR)(x = 1 to 5)

Address offset: 0x3F0

Reset value: Block 1: 0x0001 0804

Reset value: Block 2: 0x0001 0804

Reset value: Block 3: 0x0000 0804

Reset value: Block 4: 0x0000 0804

Reset value: Block 5: 0x0000 0804

31302928272625242322212019181716
CFG4[7:0]Res.Res.Res.Res.CFG3[3:0]
rrrrrrrrrrrr
1514131211109876543210
CFG2[7:0]CFG1[7:0]
rrrrrrrrrrrrrrrr

Bits 31:24 CFG4[7:0]: peripheral hardware configuration 4

This is read only bit-field and is read as CFG4[7:0] = option register

Bits 23:20 Reserved, must be kept at reset value.

Bits 19:16 CFG3[3:0]: peripheral hardware configuration 3

This is read only bit-field and is read as CFG3[3:0] = encoder mode(1:enabled and 0:disabled)

Bits 15:8 CFG2[7:0]: peripheral hardware configuration 2

This is read only bit-field and is read as CFG2[7:0] = trigger number

Bits 7:0 CFG1[7:0]: peripheral hardware configuration 1

This is read only bit-field and is read as CFG1[7:0] = input multiplexer size

43.7.11 LPTIM peripheral version identification register (LPTIM_VERR)

Address offset: 0x3F4

Reset value: 0x0000 0014

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.MAJREV[7:4]MINREV[3:0]
rrrrrrrr

Bits 31:8 Reserved, must be kept at reset value.

Bits 7:4 MAJREV[7:4]: Major revision

This is read only bit-field and is read as MAJREV[7:4] = 1.

Bits 3:0 MINREV[3:0]: Minor revision

This is a read only bit-field and is read as MINREV[3:0] = 4.

43.7.12 LPTIM peripheral type identification register (LPTIM_PIDR)

Address offset: 0x3F8

Reset value: 0x0012 0011

31302928272625242322212019181716
P_ID[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
P_ID[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 P_ID[31:0]: Peripheral type identifier

This a read only register and is always read as P_ID[31:0] = 0x00120011.

43.7.13 LPTIM registers map size identification register (LPTIM_SIDR)

Address offset: 0x3FC

Reset value: 0xA3C5 DD01

31302928272625242322212019181716
S_ID[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
S_ID[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 S_ID[31:0]: Registers map size identifier

This a read only register and is always read as S_ID[31:0] = 0xA3C5DD01.

This register identifies the size of the memory region allocated to the LPTIM registers. The size of this memory region is 1 KB.

43.7.14 LPTIM register map

The following table summarizes the LPTIM registers.

Table 315. LPTIM register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x000LPTIM_ISRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DOWN(1)DOWN(1)UP(1)ARROKCMPOKEXTRIGARMCMPM
Reset value00000000
0x004LPTIM_ICRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DOWNCF(1)UPCF(1)ARROKCFCMPOKCFEXTRIGCFARMCFCMPMCF
Reset value00000000
0x008LPTIM_IERRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DOWNIE(1)UPIE(1)ARROKIECMPOKIEEXTRIGIEARMIECMPMIE
Reset value00000000
0x00CLPTIM_CFGRRes.Res.Res.Res.Res.Res.Res.ENC(1)COUNTMODEPRELOADWAVEPOLWAVETIMOUTTRIGENRes.TRIGSEL[2:0]PRESCTRGFLTRes.CKFLTCKPOLCKSEL
Reset value00000000000000000000000
0x010LPTIM_CRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RSTARECOUNTSTCNTSTRTSNGSTRTENABLE
Reset value000000
0x014LPTIM_CMPRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CMP[15:0]
Reset value0000000000000000
0x018LPTIM_ARRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ARR[15:0]
Reset value0000000000000001
0x01CLPTIM_CNTRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CNT[15:0]
Reset value0000000000000000
0x024LPTIM_CFGR2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.IN2SEL[1:0]Res.Res.IN1SEL[1:0]
Reset value0000
0x3F0LPTIM_HWCFGRCFG4[27:20]Res.Res.Res.Res.CFG3[19:16]CFG2[15:8]CFG1[7:0]
Reset valuexxxxxxxxxxxxxxxxxxxxxxxxxxx
0x3F4LPTIM_VERRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MAJREV[7:4]MINREV[3:0]
Reset value00010100
0x3F8LPTIM_PIDRP_ID[31:0]
Reset value00000000000100100000000000001001
0x3FCLPTIM_SIDRS_ID[31:0]
Reset value10100011110001011101110100000001
  1. 1. If LPTIM does not support encoder mode feature, this bit is reserved. Please refer to Section 43.3: LPTIM implementation.

Refer to Section 2.5 on page 149 for the register boundary addresses.