cancel
Showing results for 
Search instead for 
Did you mean: 

PWM using Timer with STM32F4

NSemrHomeInit
Senior

Dear ST,

I am coming back to you to configure a PWM peripheral with STM32F429.

I am familiar with TI DSP and I have to implement it with ST this time.

Could you help me to configure TIMER1 for symmetrical PWM and trigger an interrupt to trig ADC. I ma using CubeIDE and CubeMX.

Thank you in advance,

S.Tarik

2 REPLIES 2

Find a TIM with CH1/CH1N outputs or program CH1 in PWM1 and CH2 in PWM2 mode

The periodicity of the TIM is controlled by the Prescaler and Period values (N-1)

ie output frequency = TIMCLK / (Prescaler + 1) / (Period + 1)

The duty goes into the Compare registers, ie CCRx = (Period + 1) / 2 for 50/50 duty

TIMCLK is typically APBxCLK * 2 in the non-DIV1 cases, see clock tree to understand options and which TIM is on which bus.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you Tesla for the precise answer.

Would please confirm that if I am using the TIM1 the external clock is the same as APB without a Prescaler?

In the reference document, ST calls the clock an internal clock. I am using an external clock, the APB2 90Mhz clock.

How I do verify that I am connected to the external clock?

Please see the picture attached to this post.

Thank you in advance,

S.Tarik0693W000007BudsQAC.png