Skip to main content
Associate II
August 10, 2023
Solved

STM32CubeMX I2C on STM32H563

  • August 10, 2023
  • 3 replies
  • 2137 views

Hi,

I use STM32CubeMx 6.9.1 on a STM32H563 project. Programming the I2C pins, there is no way to setup the I2C_SCL pin as Alternate PushPull. Only the Alternate Open Drain is possible. Why?

In my application, the I2C_SCL pin is connected to a serial EEPROM, and in my opinion there is no reason to not have this possibility.

Or I forget something?

 

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

It's reasonable for you to make it push-pull if you can guarantee slave won't drive it and you don't want to use external resistor, but it's also reasonable for CubeMX to not allow configurations which violate the I2C standard.

Making it push-pull won't make communication faster as you still need to rely on open-drain configuration on SDA. Might give a very marginal increase since SCL switches faster, but not by much.

3 replies

TDK
Super User
August 10, 2023

Slaves can stretch the clock by holding SCL low, therefore it needs to be in open drain mode.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Ez_itAuthor
Associate II
August 10, 2023

Thank you for your answer. But in my case the SCL in the slave is a pure input, and using the SCL as PushPull is the best way to have fastest communication, without adding the capacity of a multilayer resistor, isn't it?

In effect I forced the SCL as PushPull and it works well.

TDK
TDKBest answer
Super User
August 10, 2023

It's reasonable for you to make it push-pull if you can guarantee slave won't drive it and you don't want to use external resistor, but it's also reasonable for CubeMX to not allow configurations which violate the I2C standard.

Making it push-pull won't make communication faster as you still need to rely on open-drain configuration on SDA. Might give a very marginal increase since SCL switches faster, but not by much.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Ez_itAuthor
Associate II
August 11, 2023

Thank you very much!