cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G071 Break Bidirectional IO always HIGH

KoRba88
Associate III

Hi.

I want to OR two comparators to produce one fault signal to external device. While comparators on event are generating TIM1_BRK_UP_TRG_COM_IRQHandler and TIM1->SR & TIM_SR_BIF is set to 1 and my PWM output (which I use for debug) is stopped the output of TIM1_BK or TIM2_BK2 is always HIGH. Reference manual says nothing about this case and it claim that when TIM_SR_BIF is set the output must go LOW (GPIO is set as open drain with pullup and low polarity).

2 REPLIES 2

What's the content of TIMx_BDTR?

JW

hi, thanks for the replay

TIMx_BDTR after configuration = 10001000011111101110001100100

when togling BKIN nothing changes, when Comparator triggers it works as it should be and

TIMx_BDTR = 10001000011110101110001100100 (MOE = 0)

 EDIT:

even stranger things, BKIN is working normally when Comparator is off. When Comparator is ON together with BKIN, the break is only active when BKIN AND Comparators are low (why? they should be ORed not ANDed) (previously the polarity was inverted because HAL and STMCubeMX set wrongly bit in AF1 register and comparator was only working).