cancel
Showing results for 
Search instead for 
Did you mean: 

Phase-shift PWM with STM32F407

jantje7600
Associate
Posted on February 27, 2017 at 15:10

How can I create a phase-shifted pwm signal ? The frequency is fixed. The board is STM32F407 discovery board so I am not 100% sure if this is possible.

If it is, how can I achieve this?

#phase-shift #stm32f4-discovery
10 REPLIES 10
Posted on February 27, 2017 at 15:34

Phase shifted, but referenced to what?

JW

Posted on February 27, 2017 at 17:11

Seem to recall toggle mode being used to control relative phase across different channels.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 27, 2017 at 22:37

Yes, but sort of rigid if you want to call it PWM...

JW

PS. Still don't know phase shift to what, external input, other pwm, what freq range etc.etc. Hate to polish the crystal ball.

Posted on February 27, 2017 at 22:55

Signs point to multi-phase output

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dylan
Associate III
Posted on May 17, 2017 at 11:30

I am interested in this too, was this ever resolved? I would like to double edge PWM, is this possible with STM32? I have tried to do it using asymmetric centre-aligned PWM, but I cannot figue out how to define the second CCRx value (if that is what it is called). A visual reference of what I am trying to achieve:

0690X000006072DQAQ.png

Thanks.

Posted on May 17, 2017 at 12:11

Newer STM32 TIM have features to achieve this within one timer, but here it calls for two timers in master-slave arrangement, with the same compare configuration for the channel providing the output, master having one more compare channel set up to provide a trigger out at the 'offset', slave being reset from master.

It may need some tweaking when the offset changes to prevent spurious pulses.

JW

Posted on May 17, 2017 at 12:56

Look for 'Asymmetric PWM mode' and/or better 'Combined PWM mode' in the narrative of TIM chapters.

ST tends to maintain the version of IP blocks within a sub-family (although, unfortunately, they don't publish this info, at least not in a concise form, only as configuration for the idiotic CubeMX) so F446 probably no and L476 yes.

JW

dylan
Associate III
Posted on May 17, 2017 at 13:19

Great, I will look into that and report back, thanks

Waclawek.Jan

‌!

Posted on May 17, 2017 at 12:27

Hi

Waclawek.Jan

‌,

Thanks for the response. I have the STM32F446RET6, does this have have the TIM features you speak of, if so could you please refer me to which timer supports this please? I also have a STM32L476RGT6U that I can use to achieve this.

Thanks,

Dylan