cancel
Showing results for 
Search instead for 
Did you mean: 

stm32h7 uart i2c GPIO_InitStruct.Pull = GPIO_PULLDOWN;

wjian.2
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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

View solution in original post

1 REPLY 1
TDK
Guru

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