Figure 7. Frequency Measurement With Tim16 In Capture Mode; Figure 8. Frequency Measurement With Tim17 In Capture Mode - ST STM32C0 Series Getting Started

Hardware development
Hide thumbs Also See for STM32C0 Series:
Table of Contents

Advertisement

TIM17
By setting the TI1SEL[3:0] field of the TIM17_TISEL register, the clock selected for the input capture channel1 of
TIM17 can be one of the following:
GPIO (refer to the alternate function mapping in the device datasheets)
HSE divided by 32
MCO (MCU clock output)
MCO2 (MCU clock output)
MCO and MCO2 are controlled, respectively, by the MCOSEL[3:0] and MCO2SEL[3:0] bitfields of the clock
configuration register (RCC_CFGR). All clock sources can be selected for the MCO and MCO2 pins.
Calibration of the HSI48 oscillator
For TIM14, TIM16 and TIM17, the primary purpose of connecting the LSE to the channel 1 input capture is to be
able to precisely measure the HSISYS clock (derived from HSI48) selected as system clock. Counting HSISYS
clock pulses between consecutive edges of the LSE clock (the time reference) allows measuring the HSISYS
(and HSI48) clock period. Such measurement can determine the HSI48 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 HSI48 oscillator can then be trimmed to compensate for deviations from target frequency, due to
manufacturing, process, temperature and/or voltage variation.
The HSI48 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 improves 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 HSI48 frequency measurement accuracy. It is recommended in the absence of the LSE clock.
AN5673 - Rev 2
Figure 7.
Frequency measurement with TIM16 in capture mode
TI1SEL[3:0]
GPIO
LSI
LSE
MCO2
Figure 8.
Frequency measurement with TIM17 in capture mode
TI1SEL[3:0]
GPIO
HSE
/ 32
MCO
MCO2
Internal / external clock measurement with TIM14 / TIM16 / TIM17
TIM 16
TI1
TIM 17
TI1
AN5673
page 15/32

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents