\n
address_offset : 0x0 Bytes (0x0)
size : 0x400 byte (0x0)
mem_usage : registers
protection : not protected
Interrupt and Status Register
address_offset : 0x0 Bytes (0x0)
size : 32 bit
access : read-only
reset_value : 0x0
reset_Mask : 0x0
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.
bits : 0 - 0 (1 bit)
access : read-only
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.
bits : 1 - 1 (1 bit)
access : read-only
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.
bits : 2 - 2 (1 bit)
access : read-only
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.
bits : 3 - 3 (1 bit)
access : read-only
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.
bits : 4 - 4 (1 bit)
access : read-only
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 .
bits : 5 - 5 (1 bit)
access : read-only
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 .
bits : 6 - 6 (1 bit)
access : read-only
Control Register
address_offset : 0x10 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
ENABLE : LPTIM enable The ENABLE bit is set and cleared by software.
bits : 0 - 0 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
LPTIM is disabled
0x1 : B_0x1
LPTIM is enabled
End of enumeration elements list.
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.
bits : 1 - 1 (1 bit)
access : read-write
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.
bits : 2 - 2 (1 bit)
access : read-write
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). 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'.
bits : 3 - 3 (1 bit)
access : read-write
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.
bits : 4 - 4 (1 bit)
access : read-write
Compare Register
address_offset : 0x14 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
CMP : Compare value
bits : 0 - 15 (16 bit)
Autoreload Register
address_offset : 0x18 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
ARR : Auto reload value
bits : 0 - 15 (16 bit)
Counter Register
address_offset : 0x1C Bytes (0x0)
size : 32 bit
access : read-only
reset_value : 0x0
reset_Mask : 0x0
CNT : Counter value
bits : 0 - 15 (16 bit)
LPTIM configuration register 2
address_offset : 0x24 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
IN1SEL : LPTIM input 1 selection The IN1SEL bits control the LPTIM Input 1 multiplexer, which connects LPTIM Input 1 to one of the available inputs. For connection details refer to .
bits : 0 - 1 (2 bit)
access : read-write
Enumeration:
0x0 : B_0x0
lptim_in1_mux0
0x1 : B_0x1
lptim_in1_mux1
0x2 : B_0x2
lptim_in1_mux2
0x3 : B_0x3
lptim_in1_mux3
End of enumeration elements list.
IN2SEL : LPTIM input 2 selection The IN2SEL bits control the LPTIM Input 2 multiplexer, which connect LPTIM Input 2 to one of the available inputs. For connection details refer to . Note: If the LPTIM does not support encoder mode feature, these bits are reserved. Please refer to .
bits : 4 - 5 (2 bit)
access : read-write
Enumeration:
0x0 : B_0x0
lptim_in2_mux0
0x1 : B_0x1
lptim_in2_mux1
0x2 : B_0x2
lptim_in2_mux2
0x3 : B_0x3
lptim_in2_mux3
End of enumeration elements list.
Interrupt Clear Register
address_offset : 0x4 Bytes (0x0)
size : 32 bit
access : write-only
reset_value : 0x0
reset_Mask : 0x0
CMPMCF : Compare match clear flag Writing 1 to this bit clears the CMP flag in the LPTIM_ISR register
bits : 0 - 0 (1 bit)
access : write-only
ARRMCF : Autoreload match clear flag Writing 1 to this bit clears the ARRM flag in the LPTIM_ISR register
bits : 1 - 1 (1 bit)
access : write-only
EXTTRIGCF : External trigger valid edge clear flag Writing 1 to this bit clears the EXTTRIG flag in the LPTIM_ISR register
bits : 2 - 2 (1 bit)
access : write-only
CMPOKCF : Compare register update OK clear flag Writing 1 to this bit clears the CMPOK flag in the LPTIM_ISR register
bits : 3 - 3 (1 bit)
access : write-only
ARROKCF : Autoreload register update OK clear flag Writing 1 to this bit clears the ARROK flag in the LPTIM_ISR register
bits : 4 - 4 (1 bit)
access : write-only
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 .
bits : 5 - 5 (1 bit)
access : write-only
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 .
bits : 6 - 6 (1 bit)
access : write-only
Interrupt Enable Register
address_offset : 0x8 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
CMPMIE : Compare match Interrupt Enable
bits : 0 - 0 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
CMPM interrupt disabled
0x1 : B_0x1
CMPM interrupt enabled
End of enumeration elements list.
ARRMIE : Autoreload match Interrupt Enable
bits : 1 - 1 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
ARRM interrupt disabled
0x1 : B_0x1
ARRM interrupt enabled
End of enumeration elements list.
EXTTRIGIE : External trigger valid edge Interrupt Enable
bits : 2 - 2 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
EXTTRIG interrupt disabled
0x1 : B_0x1
EXTTRIG interrupt enabled
End of enumeration elements list.
CMPOKIE : Compare register update OK Interrupt Enable
bits : 3 - 3 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
CMPOK interrupt disabled
0x1 : B_0x1
CMPOK interrupt enabled
End of enumeration elements list.
ARROKIE : Autoreload register update OK Interrupt Enable
bits : 4 - 4 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
ARROK interrupt disabled
0x1 : B_0x1
ARROK interrupt enabled
End of enumeration elements list.
UPIE : Direction change to UP Interrupt Enable Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to .
bits : 5 - 5 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
UP interrupt disabled
0x1 : B_0x1
UP interrupt enabled
End of enumeration elements list.
DOWNIE : Direction change to down Interrupt Enable Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to .
bits : 6 - 6 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
DOWN interrupt disabled
0x1 : B_0x1
DOWN interrupt enabled
End of enumeration elements list.
Configuration Register
address_offset : 0xC Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
CKSEL : Clock selector The CKSEL bit selects which clock source the LPTIM will use:
bits : 0 - 0 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
LPTIM is clocked by internal clock source (APB clock or any of the embedded oscillators)
0x1 : B_0x1
LPTIM is clocked by an external clock source through the LPTIM external Input1
End of enumeration elements list.
CKPOL : 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: If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 1 is active. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 2 is active. Refer to for more details about Encoder mode sub-modes.
bits : 1 - 2 (2 bit)
access : read-write
Enumeration:
0x0 : B_0x0
the rising edge is the active edge used for counting.
0x1 : B_0x1
the falling edge is the active edge used for counting
0x2 : B_0x2
both edges are active edges. When both external clock signal edges are considered active ones, the LPTIM must also be clocked by an internal clock source with a frequency equal to at least four times the external clock frequency.If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 3 is active.
0x3 : B_0x3
not allowed
End of enumeration elements list.
CKFLT : 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 : 3 - 4 (2 bit)
access : read-write
Enumeration:
0x0 : B_0x0
any external clock signal level change is considered as a valid transition
0x1 : B_0x1
external clock signal level change must be stable for at least 2 clock periods before it is considered as valid transition.
0x2 : B_0x2
external clock signal level change must be stable for at least 4 clock periods before it is considered as valid transition.
0x3 : B_0x3
external clock signal level change must be stable for at least 8 clock periods before it is considered as valid transition.
End of enumeration elements list.
TRGFLT : 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
bits : 6 - 7 (2 bit)
access : read-write
Enumeration:
0x0 : B_0x0
any trigger active level change is considered as a valid trigger
0x1 : B_0x1
trigger active level change must be stable for at least 2 clock periods before it is considered as valid trigger.
0x2 : B_0x2
trigger active level change must be stable for at least 4 clock periods before it is considered as valid trigger.
0x3 : B_0x3
trigger active level change must be stable for at least 8 clock periods before it is considered as valid trigger.
End of enumeration elements list.
PRESC : Clock prescaler The PRESC bits configure the prescaler division factor. It can be one among the following division factors:
bits : 9 - 11 (3 bit)
access : read-write
Enumeration:
0x0 : B_0x0
/1
0x1 : B_0x1
/2
0x2 : B_0x2
/4
0x3 : B_0x3
/8
0x4 : B_0x4
/16
0x5 : B_0x5
/32
0x6 : B_0x6
/64
0x7 : B_0x7
/128
End of enumeration elements list.
TRIGSEL : 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: See for details.
bits : 13 - 15 (3 bit)
access : read-write
Enumeration:
0x0 : B_0x0
lptim_ext_trig0
0x1 : B_0x1
lptim_ext_trig1
0x2 : B_0x2
lptim_ext_trig2
0x3 : B_0x3
lptim_ext_trig3
0x4 : B_0x4
lptim_ext_trig4
0x5 : B_0x5
lptim_ext_trig5
0x6 : B_0x6
lptim_ext_trig6
0x7 : B_0x7
lptim_ext_trig7
End of enumeration elements list.
TRIGEN : Trigger enable and polarity The TRIGEN bits controls whether the LPTIM counter is started by an external trigger or not. If the external trigger option is selected, three configurations are possible for the trigger active edge:
bits : 17 - 18 (2 bit)
access : read-write
Enumeration:
0x0 : B_0x0
software trigger (counting start is initiated by software)
0x1 : B_0x1
rising edge is the active edge
0x2 : B_0x2
falling edge is the active edge
0x3 : B_0x3
both edges are active edges
End of enumeration elements list.
TIMOUT : Timeout enable The TIMOUT bit controls the Timeout feature
bits : 19 - 19 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
A trigger event arriving when the timer is already started will be ignored
0x1 : B_0x1
A trigger event arriving when the timer is already started will reset and restart the counter
End of enumeration elements list.
WAVE : Waveform shape The WAVE bit controls the output shape
bits : 20 - 20 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
Deactivate Set-once mode, PWM or One Pulse waveform depending on how the timer was started, CNTSTRT for PWM or SNGSTRT for One Pulse waveform.
0x1 : B_0x1
Activate the Set-once mode
End of enumeration elements list.
WAVPOL : Waveform shape polarity The WAVEPOL bit controls the output polarity
bits : 21 - 21 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
The LPTIM output reflects the compare results between LPTIM_CNT and LPTIM_CMP registers
0x1 : B_0x1
The LPTIM output reflects the inverse of the compare results between LPTIM_CNT and LPTIM_CMP registers
End of enumeration elements list.
PRELOAD : Registers update mode The PRELOAD bit controls the LPTIM_ARR and the LPTIM_CMP registers update modality
bits : 22 - 22 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
Registers are updated after each APB bus write access
0x1 : B_0x1
Registers are updated at the end of the current LPTIM period
End of enumeration elements list.
COUNTMODE : counter mode enabled The COUNTMODE bit selects which clock source is used by the LPTIM to clock the counter:
bits : 23 - 23 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
the counter is incremented following each internal clock pulse
0x1 : B_0x1
the counter is incremented following each valid clock pulse on the LPTIM external Input1
End of enumeration elements list.
ENC : Encoder mode enable The ENC bit controls the Encoder mode Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to .
bits : 24 - 24 (1 bit)
access : read-write
Enumeration:
0x0 : B_0x0
Encoder mode disabled
0x1 : B_0x1
Encoder mode enabled
End of enumeration elements list.
Is something missing? Is something wrong? can you help correct it ? Please contact us at info@chipselect.org !
This website is sponsored by Embeetle, an IDE designed from scratch for embedded software developers.