Skip to main content
wjian.2
Associate III
August 19, 2023
Solved

stm32h7 uart i2c GPIO_InitStruct.Pull = GPIO_PULLDOWN;

  • August 19, 2023
  • 1 reply
  • 1632 views

para aplicar  i2c alternate function open-drain GPIO_InitStruct.Pull = GPIO_PULLDOWN o should be GPIO_PULLUP  (what diferencetween both) and uart alternate function push-pull should be pull-up or pull-down what diferencetween both?

This topic has been closed for replies.
Best answer by TDK

In general, I2C should be pulled up by an external resistor and the pin should be configured as AF open-drain without a pullup or pulldown. The internal pullup is not strong enough. Configuring it with a pullup doesn't hurt anything but isn't necessary if the external pullup is there.

In general, UART should also have an external pullup as the internal pullup is weak, but using the internal pullup will work with lower data rates. Pins should be configured as AF push-pull.

Neither I2C or UART should use a pulldown.

1 reply

TDK
TDKBest answer
August 19, 2023

In general, I2C should be pulled up by an external resistor and the pin should be configured as AF open-drain without a pullup or pulldown. The internal pullup is not strong enough. Configuring it with a pullup doesn't hurt anything but isn't necessary if the external pullup is there.

In general, UART should also have an external pullup as the internal pullup is weak, but using the internal pullup will work with lower data rates. Pins should be configured as AF push-pull.

Neither I2C or UART should use a pulldown.

"If you feel a post has answered your question, please click ""Accept as Solution""."