Showing results for 
Search instead for 
Did you mean: 

STM32G4 Comparator Blanking Pulse (frequency change possible?)



I am using the comparators (COMP2) on STM32G4 and want to add some blanking windows to let the COMP2 input get rid of the system switching noise.

The technical manual gives a very brief example as shown in Fig.1.


But I need something more complex. Is the MCU able to generate a blanking window like the following figure? Do I always need to change the frequency of the timer to generates a blanking pulse like this?

Also, I am using the center aligned mode PWM, I guess this makes things worse if I want to use the same timer to generate the blanking pulse.

Thanks for your help!


Igor Cesko
ST Employee

Hello QMa.1,

The blanking window is defined by some timer TIx_OC output (according to the setting of BLANKSEL bitfield in COMPx_CSR register). Therefore is necessary to program given timer to generate such blanking window. There can be found some methods to generate this pulse on each PWM toggle: for example some "Retriggerable One-pulse mode" which is triggered by some event when main PWM toggles input (I don't know how exactly - if PWM frequency is slow enough then software can change polarity of trigger each half period).