Skip to main content
KoRba88
Associate II
June 5, 2021
Question

STM32G071 Break Bidirectional IO always HIGH

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

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
June 6, 2021

What's the content of TIMx_BDTR?

JW

KoRba88PL
Visitor II
August 1, 2021

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