cancel
Showing results for 
Search instead for 
Did you mean: 

Double Edge PWM: STM32F4 & CubeMX

dylan
Associate III
Posted on May 17, 2017 at 11:16

Hi All,

I would like to set my STM32F4 Nucleo to do double edge PWM, but for the life of me I cannot figure out how to do it. More specifically I am trying to do it on three channels of TIM1. To put it visually, I am trying to do something like this:

0690X00000606rzQAA.png

Thanks for you time.

Dylan

8 REPLIES 8
Nesrine M_O
Lead II
Posted on May 17, 2017 at 12:15

Hi

ELMHIRI.Syrine

,

Thank you for the response. I have had a look at the cook book but it is gibberish to me, I find it very difficult to follow. Perhaps you could refer me to the section that would aid me?

Thanks,

Dylan

Uwe Bonnes
Principal II
Posted on May 17, 2017 at 22:07

You can't do this with a single  channel of some TIMer. Maybe a HRTIM channel can do that. Or you use 2 channels and connect both channels logical.

Posted on May 17, 2017 at 22:11

https://community.st.com/0D70X000006ShHUSA0

Posted on May 17, 2017 at 23:15

Hi

Bonnes.Uwe

‌,

Thanks for the response. Yes, my progress today has shown that you are right. For starters, this is not possible with the STM32F4 as it does not incorporate the new timer features of newer micros. The STM32L4 timers do have this features and so I have migrated to one of these. I am still working out how to use it, but at least I know it is there. This is documented in AN4013: STM32 Cross-Series Timers Overview.

Thanks,

Dylan

Posted on May 17, 2017 at 23:25

 This is documented in AN4013: STM32 Cross-Series Timers Overview.

Nice catch.

JW

Posted on May 17, 2017 at 23:36

You can use two timer outputs and a single external gate to combine the two signals on F4.

Posted on May 17, 2017 at 23:49

From my perspective it's easier to use several timers in master-slave configuration.

Yet another option is to use the timer-driven-DMA-to-GPIO.

JW