Showing results for 
Search instead for 
Did you mean: 

How to set CHxN to high when outputting PWM using commutation interrupt for 6-step?


Hi team!

I testing MP6530 three-phase BLDC pre-driver with STM32G474RE.
This drive's gate drive need to control like below.


I wrote a code that uses commutaion interrupts.
I have attached the test code, so please see the code for details.

And the problem is that I want to set the EN signal to high when outputting PWM, but I cannot set it to high.
I want to set EN signal to high like fig1.

PWM signal is assigned to CH1, CH2, CH3 of TIM1.
EN signal is assigned to CH1N, CH2N, CH3N of TIM1.



Is there a way to set CH1N, CH2N, and CH3N to high during PWM output?


Associate II

Hi Kenji

I assume you you want to put EN low so you can detect BEMF.

Not sure why you use CH1N as it is the inverse of CH1.

I would set/reset the EN with a GPIO out-port. But I assume you are already doing that according to the figure. 


Hi danhellgren-san.

To control MP6530 pre-driver, below PWM and ENx signal are require.
And I want to do that with timer synchronization and complementary PWM output.



The problem is that when using complementary output, CHxN cannot be kept at high level during PWM output.If not use complementary PWM and use the GPIO port instead of CHxN and timer periodic interrupt , it is possible to output as shown in Fig 2.

However, in that case, time synchronization (commutation timing pre load) cannot be used.

The purpose is to perform commutation control without using software as much as possible.