Peripheral Clock Enable Registers - ST STM32G0 1 Series Reference Manual

Table of Contents

Advertisement

Reset and clock control (RCC)
Calibration of the HSI16 oscillator
For TIM14, TIM15 and TIM17, the primary purpose of connecting the LSE to the channel 1
input capture is to precisely measure HSISYS (derived from HSI16) selected as system
clock. Counting HSISYS clock pulses between consecutive edges of the LSE clock (the
time reference) allows measuring the HSISYS (and HSI16) clock period. Such
measurement can determine the HSI16 oscillator frequency with nearly the same accuracy
as the accuracy of the 32.768 kHz quartz crystal used with the LSE oscillator (typically a few
tens of ppm). The HSI16 oscillator can then be trimmed to compensate for deviations from
target frequency, due to manufacturing, process, temperature and/or voltage variation.
The HSI16 oscillator has dedicated user-accessible calibration bits for this purpose.
The basic concept consists in providing a relative measurement (for example, the
HSISYS/LSE ratio): the measurement accuracy is therefore closely related to the ratio
between the two clock sources. Increasing the ratio allows improving the measurement
accuracy.
Generated by the HSE oscillator, the HSE clock (divided by 32) used as time reference is
the second best method for reaching a good HSI16 frequency measurement accuracy. It is
recommended in absence of the LSE clock.
In order to further improve the precision of the HSI16 oscillator calibration, it is advised to
employ one or a combination of the following measures to increase the frequency
measurement accuracy:
set the HSISYS divider to 1 for HSISYS frequency to be equal to HSI16 frequency
average the results of multiple consecutive measurements
use the input capture prescaler of the timer (one capture every up to eight periods)
use LSE clock for the RTC and the RTC wakeup interrupt signal as time reference
The last point significantly increases the reference period for HSI16 clock pulse counting,
which improves the accuracy of a single measurement. For operation, the RTC wakeup
interrupt must be enabled.
Calibration of the HSI48 oscillator
The HSI48 oscillator is factory-calibrated.
Calibration of the LSI oscillator
The calibration of the LSI oscillator uses the same principle as that for calibrating the HSI16
oscillator. TIM16 channel1 input capture must be used for LSI clock, and HSE selected as
system clock source. The number of HSE clock pulses between consecutive edges of the
LSI signal, counted by TIM16, is then representative of the LSI clock period.
5.2.17

Peripheral clock enable registers

Each peripheral clock can be enabled by the corresponding enable bit of the
RCC_AHBENR or RCC_APBENRx registers.
When the peripheral clock is not active, the peripheral registers read or write accesses are
not supported.
Caution:
The enable bit has a synchronization mechanism to create a glitch-free clock for the
peripheral. After the enable bit is set, there is a 2-clock-cycle delay before the clock be
active, which the software must take into account.
176/1390
RM0444 Rev 5
RM0444

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF