cancel
Showing results for 
Search instead for 
Did you mean: 

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

Kenji1
Senior

Hi team!

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

Kenji1_1-1713174011476.png

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.

fig1. 

Kenji1_0-1713173616042.png

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

 

2 REPLIES 2
danhellgren
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.

fig2. 

Kenji1_0-1713312427343.png

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.