2023-08-10 03:19 AM
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?
Solved! Go to Solution.
2023-08-10 09:53 AM
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.
2023-08-10 05:47 AM
Slaves can stretch the clock by holding SCL low, therefore it needs to be in open drain mode.
2023-08-10 09:22 AM
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.
2023-08-10 09:53 AM
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.
2023-08-10 11:05 PM
Thank you very much!