on 2024-12-19 07:05 AM
RCC clocks can be internally connected to timers.
The points addressed here are the following:
This article focuses on the example of the LSE clock and is based on the example of the STM32H563.
The first step is to find the interconnect information in the reference manual (RM). In the case of the STM32H563, it is given in the shape of a peripherals interconnect matrix. Section 15 of the RM0481 describes this.
In this table, we can find the following connection information:
The number in the table refers to the next subsection which gives more details about this peripheral connection. In this case, it is section 15.3.5.
For TIM2, Table 420 shows that LSE is connected to an external trigger signal tim_etr3.
In Section 39.4.5, subsection External clock source mode 2 gives more details and a diagram of the input block.
For TIM15/16, Table 450 (Table 438 is a typo error RM0481 revision 2) shows that LSE is connected to an input signal of the timer tim_ti1_in4 of TIM15 or tim_ti_in2 of TIM16.
Section 42.4.6, subsection External clock source mode 1 provides more details and a diagram of the input block.
TIM2
External clock mode 2 can be selected either as the trigger source of a slave mode or directly as a clock source.
When LSE is a trigger source, the slave mode can be any of the possible modes. The screenshot below shows the example of [External Clock Mode 1]. The trigger source is [ETR1 through Remap].
When LSE is a clock source, the slave mode can be disabled or any mode except [External Clock Mode 1]. The clock source is [ETR2 through Remap].
TIM15
The external clock mode 1 is selected on the channel 1 as [Input Capture direct mode from Remap].
TIM16
The external clock mode 1 is selected on the channel 1 as [Input Capture direct mode from Remap].