cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 Comparator Blanking Pulse (frequency change possible?)

QMa.1
Associate

Hello,

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.

0693W00000Y959vQAB.png 

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!

0693W00000Y95AAQAZ.png 

1 REPLY 1
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).

Regards

Igor