cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with COMP1 and COMP2 as TIM1 break function sources.

MGard.2
Associate II

Hi,

I am using STM32L476. COMP1 and COMP2 are configured in window mode, and that is working great. I am also using TIM1 break function. Below is a summary of the problem that I am encountering:

  • If I use COMP1, and only COMP1, as a source for BREAK or BREAK2, the break function works fine.

  • If I use COMP2, and only COMP2, as a source for BREAK or BREAK2, the break function works fine.

  • If I use COMP1 or COMP2 as an ADDITIONAL source for a BREAK or BREAK2 configuration which was previously working, the break function stops working.

I don't know if that's because there is a problem with the break function not accepting multiple sources (that should not be the case, as the manual clearly says that multiple sources are possible and they are ORed), or if there is a problem when using COMP1 / COMP2 as a break source (maybe that's related to the window mode configuration).

Therefore, I just wanted to know if anybody already managed to use COMP1 AND COMP2 as sources for BREAK or BREAK2.

Thanks a lot for your feedback.

Michel

1 ACCEPTED SOLUTION

Accepted Solutions
MGard.2
Associate II

I found my error. COMP1 and COMP2 output polarities were not compatible with the OR that is performed on all BREAK sources. By inverting the polarities, the BREAK function works fine with both sources enabled at the same time.

My bad.

View solution in original post

2 REPLIES 2

> COMP1 and COMP2 are configured in window mode

Only COMP2 has WINMODE bit, as you need both comparators for window mode.

JW

MGard.2
Associate II

I found my error. COMP1 and COMP2 output polarities were not compatible with the OR that is performed on all BREAK sources. By inverting the polarities, the BREAK function works fine with both sources enabled at the same time.

My bad.