Showing results for 
Search instead for 
Did you mean: 

Does the Comparator Polarity Selection Work on STM32H7?


I am using an STM32H743ZIT6, and attempting to have COMP1 generate an NVIC interrupt when INP2 is lower than 1/4 Vref_comp.

To this end, I set the POLARITY bit in the comparator configuration register to "1", which successfully 'inverts' the "cmp1_out" value (which is outputting "0"). Unfortunately, as soon as I set "ITEN" to "1" (enable), I get a comparator NVIC interrupt. It is my understanding (per RM0433 Figure 211) that this interrupt should only trigger when "cmp1_out" is "1". I have stepped through the program, and this interrupt is triggering immediately after "ITEN" is set, and "cmp1_out" is still "0".

I have used every comparator speed setting, and every hysteresis option. There is no relevant errata for this device, and I cannot think of any explanation other than the interrupt being triggered by the actual comparator output before polarity inversion.


you should never get an int , when setup the comp, because :

_legacyfs_online_stmicro_images_0693W00000dDWmdQAG.png-> enable comp after doing all settings !

and in comp , change output polarity while comp active, should give a int-signal, just because you generate a transition at the output of comp: