STMicroelectronics STM32WL5 Series Reference Manual page 303

Advanced arm-based 32-bit mcus with sub-ghz radio solution
Table of Contents

Advertisement

RM0453
The TIM17 input capture channel can be a GPIO line or an internal clock of the MCU. This
selection is performed through the TI1_RMP[1:0] bits in the TIM17_OR register. The
possibilities are listed below:
TIM17 channel1 is connected to the GPIO (refer to the alternate function mapping in
the device datasheets).
TIM17 channel1 is connected to the MSI Clock.
TIM17 channel1 is connected to the HSE32/32 Clock.
TIM17 channel1 is connected to the microcontroller clock output (MCO). This selection
is controlled by the MCOSEL[3:0] bits in the
(RCC_CFGR).
Calibration of the HSI16 and the MSI
For TIM16, the primary purpose of connecting the LSE to the channel 1 input capture is to
be able to precisely measure the HSI16 and MSI system clocks (for this, HSI16 or MSI must
be used as the system clock source). The number of HSI16 (MSI, respectively) clock counts
between consecutive edges of the LSE signal, provides a measure of the internal clock
period. Taking advantage of the high precision of LSE crystals (typically a few tens of ppms),
it is possible to determine the internal clock frequency with the same resolution and to trim
the source to compensate for manufacturing-process- and/or temperature- and voltage-
related frequency deviations.
The MSI and HSI16 oscillator both have dedicated user-accessible calibration bits for this
purpose.
The basic concept consists in providing a relative measurement (the HSI16/LSE ratio): the
precision is therefore closely related to the ratio between the two clock sources. The higher
the ratio is, the better the measurement is.
If LSE is not available, HSE32/32 is the better option in order to reach the most precise
calibration possible.
It is however not possible to have a good enough resolution when the MSI clock is low
(typically below 1 MHz). In this case, the following is recommended:
Accumulate the results of several captures in a row.
Use the timer input capture prescaler (up to one capture every eight periods).
Use the RTC wake-up interrupt signal (when the RTC is clocked by the LSE) as the
input for the channel 1 input capture. This improves the measurement precision. For
this purpose the RTC wake-up interrupt must be enabled.
Calibration of the LSI
The LSI calibration follows the same pattern than the HSI16, but changing the reference
clock. It is necessary to connect the LSI clock to the TIM16 channel 1 input capture. Then
the HSE32 must be defined as system clock source. The number of HSE32 clock counts
between consecutive edges of the LSI signal provides a measure of the internal low-speed
clock period.
The basic concept consists in providing a relative measurement (the HSE32 / LSI ratio): the
precision is therefore closely related to the ratio between the two clock sources. The higher
the ratio is, the better the measurement is.
RCC clock configuration register
RM0453 Rev 5
Reset and clock control (RCC)
303/1450
371

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32WL5 Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Stm32wl55 seriesStm32wl54 series

Table of Contents