cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX I2C on STM32H563

Ez
Associate II

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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

View solution in original post

4 REPLIES 4
TDK
Guru

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
Associate II

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
Guru

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
Associate II

Thank you very much!