cancel
Showing results for 
Search instead for 
Did you mean: 

Change PWM polarity at update event with STM32 Timers?

SJung.1899
Associate II

I am using the adanced control and the general purpose timers witch the STM32F334K8T6 to drive one half-bridge and one full-bridge.

The problem lies with the full bridge:

I use the general purpose timer with two times asymmetrical PWM (center aligned mode) which gives me a lot of freedom. Period and all Duty-Cycles are preloaded and always refreshed at the update event. However, I would like to change polarity of the two signals on an update event, too. I can change polarity but what is the best way changing it at the right moment (when the update event occurs).

If I am not mistaken there is no hardware solution for this. What do you propose? Should i poll the counter value or do it by some kind of intterupt? Periods are comparably short (10us), so an update event occurs every 5us.

I hope that the attached figure helps you to understand what I mean.

Thanks in advance,

Samuel0693W000001pkmMQAQ.png

10 REPLIES 10

Jarda,

Okay, maybe I know the reason.

I usually go to google for links to ST web, as it's way faster than searching on ST web, and also way faster than loading the STM32 family web folder or product web folder and then browse through its idiotic javascriptoids (which is a thing to consider, too).

That yielded this link (with rev.6):

https://www.st.com/resource/en/application_note/cd00160362-using-the-stm32f0f1f3g0lx-series-dma-controller-stmicroelectronics.pdf

So now I took the pain to go through the product webfolder, resulting in this link (with rev.7):

https://www.st.com/resource/en/application_note/cd00160362-using-the-stm32f0f1f3gxlx-series-dma-controller-stmicroelectronics.pdf

Spot the differences... :)

Can this please be fixed.

Thanks,

JW

@JHOUD​