cancel
Showing results for 
Search instead for 
Did you mean: 

How to get one PWM output inverted?

CPrin
Associate III

I have the Shinano motor running correctly with the NUCLEO-F303RE board and the X-NUCLEO-IHM08M1. 

I'm trying now to get it working with our custom board. Unfortunately my hardware colleagues have used the NCP5304 bridge driver instead of the L6398 driver. The NCP5304 has a smitt-trigger inverter on both IN-Hi and IN-Lo inputs where the L6398 has only an inverter at the IN-Lo (LIN) input. The PWM signal to the bridge driver shows now identical signals at both inputs, which is correct for the L6398 driver. But for the NCP5304 I need one PWM signal to be inverted. Can this be done easily? I tried to do that with the MCWB by changing the "Power Stage - Driving Signals Polarity" but this seems not to be working.

3 REPLIES 3
Uwe Bonnes
Principal II

Look at the CCxP and CCXNP bits in CCER.

CPrin
Associate III

Thanks for your reply Uwe! You are right, that helped. Finally I found, that I could achieve the same by setting the "Power Stage - Driving Signals Polarity of both driving signals (High side & Low side) both to "Active Low" and this results in having one PWM output to be inverted. The "complemented from high side" box has to be "unchecked". It seems on first sight illogical but actually it is logical.

Laurent Ca...
Lead II

Adding of "STM32 Motor Control" topic.

Best regards.