Skip to main content
DKuro.1
Associate III
Apr 21, 2020 9:56 AM UTC
Solved

Break function in TIM1 -> Pin configure automatically as output? It should be input

Hi,

I am using STM32G474 th STM32CubeIDE and I want to implement the break function for TIM1.

When I configure the pin PA6 in the pinout view as TIM1_BKIN I expect that the port will be automatically configured as input, but after I checked in the GPIO configuration of the TIM1 I see that the pin was configured as Alternate Function Open Drain.

Why is that happening?

And if I try to configure it manually in the MX_GPIO_Init() function, my code is, obviously removed.

What should I do?

Thanks!!

Daniel

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Apr 21, 2020 10:20 AM UTC

> I see that the pin was configured as Alternate Function Open Drain.

Alternate Function means, that the pin's direction is controlled by the connected peripheral.

Open Drain in that context means, that should the peripheral decide to turn the given pin to output (which in your particular case it won't as BKIN is always input), it would be open drain rather than push-pull.

JW

3 replies

waclawek.jan
waclawek.janBest answer
Super User
Apr 21, 2020 10:20 AM UTC

> I see that the pin was configured as Alternate Function Open Drain.

Alternate Function means, that the pin's direction is controlled by the connected peripheral.

Open Drain in that context means, that should the peripheral decide to turn the given pin to output (which in your particular case it won't as BKIN is always input), it would be open drain rather than push-pull.

JW

DKuro.1
DKuro.1Author
Associate III
Apr 21, 2020 10:35 AM UTC

Great JW, thanks for your answer.

Before I make a short circuit and just to be 100% sure.

TIM1_BKIN in my configuration, is an INPUT, right?

waclawek.jan
Super User
Apr 21, 2020 7:15 PM UTC

Yes.

JW