cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 PWM and break input from comp

benjamin Gräf
Associate II

Hello!

I have a question regarding pwm and the break input function from the comparator. I am using a STM32F303 and generating a complementary pwm outpout with timer20 on ch1 and nch1 with a deadtime. This is working just fine. Now I wanted to implement the break function, the timer20 is internally connected to comp4. So I configured comp4 to output interal section to BKIN2 tim20.

If the comp4 output is high, the ch1 of timer20 should be on and the nch1 of timer should be off. But there is the problem, when i start the comparator in my programm and it triggers, it sets both signals (ch1 and nch1) to 0. Any ideas what I am missing here?

I am using CubeMX for configuration. I attached screenshots of my configuration of timer and comparator.

Any help is welcomed 🙂

1 REPLY 1
benjamin Gräf
Associate II

So I figured it out and, the bits OSSR and OSSI needed to be set...

For anyone who has the same issues