Skip to main content
NSemrHomeInit
Associate III
January 18, 2021
Question

PWM using Timer with STM32F4

  • January 18, 2021
  • 1 reply
  • 747 views

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

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
January 18, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
NSemrHomeInit
Associate III
January 19, 2021

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