cancel
Showing results for 
Search instead for 
Did you mean: 

Clarifications on the Tim1 settings in Cube Mx

STuser2
Senior

I have the following settings in Cube Mx for TIM1

STuser2_0-1754838526230.png

The TIM1 is used for PWM generation, but the slave mode, trigger source, clock source are disabled then how Tim1 receives the clock for pwm generation.

For TIM4 it is clearly stated

STuser2_1-1754838739218.png

So i assume it will be taken from APB2 timer clock.

One final question

STuser2_2-1754838838981.png

It is mentioned TRGO2 as above but how do i know it is connected to what? Please help.

4 REPLIES 4
MHoll.2
Senior III

I don't understand Your question.

You have to select a clock source for every Timer you want to use.

TRGO2 (and TRGO) can be used as trigger for other peripherials (for example to start and ADC converter), You have to select the Triger source if used. Then You have to select it on the receving peripherial.

Please consult the Reference manuale for the MCU you are using.

 

It is an MCSDK 6.4.0 Cube MX project and I am trying to understand it.

waclawek.jan
Super User

What does the manual say, what is the meaning of "Clock source" there? 

JW

Ok, thank you for the inputs i started verifying it 

STuser2_0-1754887100385.png

As per the clock configuration the TIM1 is driven by external 8MHZ crystal and it is 170MHz clock. It is not mentioned as internal as it is external clock driven in the CubeMx settings.

STuser2_1-1754887247551.png

And for TIM4 it is driven by the internal clock as stated in the data sheet by 48MHz and also XOR of the Hall signals on TIM4Ch1, TIM4Ch2, TIM4Ch3.