cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 Comparator (COMP1) Blanking Pulse Width (using TIM1_OC5)

JY.1
Associate II

Hi,

I'm using STM32G474 and trying to understand how COMP1 output blanking should be setup. From the reference manual, it can be set by using TIM1_OC5, but I didn't find anywhere mentioning how can i configure the length of the blanking period.

Any tips or examples that can guide me through would be very helpful. Thanks!

5 REPLIES 5
Amel NASRI
ST Employee

Hi @JY.1​ ,

The example COMP_OutputBlanking is available on STM32CubeG4 package.

The purpose of this example is to explain how to use the Comparator peripheral output blanking feature.

Please refer to the readme.txt file to understand more about the used configuration and how the Comparator output signal is behaving (an explanation is provided there).

In this example, COMP1 and TIM2_OC3 are used. It is easy to do a similar example on your side following next steps:

  • open the provided ioc file
  • enable TIM1, configure channel 5 on STM32CubeMX
  • select "Timer 1 Output Compare 5" as Blanking Source for Comp1

Regarding the previously mentioned example, you need to look to the projects under following folders:

  • STM32Cube_FW_G4\Projects\B-G474E-DPOW1\Examples\COMP\COMP_OutputBlanking
  • STM32Cube_FW_G4\Projects\NUCLEO-G474RE\Examples\COMP\COMP_OutputBlanking
  • STM32Cube_FW_G4\Projects\STM32G474E-EVAL\Examples\COMP\COMP_OutputBlanking

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Amel,

I found that example but the TIM configuration was using upcounting as Edge-aligned. Is there any other example that does the same output blanking but Center-aligned instead? Thanks

JY

Is there a way to configure the "Comparator output blanking future" for center aligned pwm mode ? I hope it is not only applicable for edge aligned pwm mode .

Hi JY,

I am working on motor control with STM32G4, and the comparator for current protection are too much sensitive with the Mosfet glitch.

Have you found an example using output blanking source with center aligned mode ?

Thanks

Hi BG,

I am working on motor control with STM32G4, and the comparator for current protection are too much sensitive with the Mosfet glitch.

Have you found an example using output blanking source with center aligned mode ?

Thanks