2025-06-19 11:39 PM - last edited on 2025-06-20 2:26 AM by Andrew Neil
Hi,
I’m currently implementing I2C in slave mode using the STM32G491 series. Due to pin constraints, we’re considering using SCL and SDA pins from different GPIO ports—for example, SCL from port PA and SDA from port PC. Is it acceptable to assign I2C pins from different ports for a single peripheral?
Also, we noticed a pin labeled I2C_SMBA. Could you explain its purpose? Can we use it for CLK or DATA?
2025-06-19 11:52 PM
Which STM32G491xx? Upload your IOC file so we can see what pins have been used already..
2025-06-20 2:23 AM - edited 2025-06-20 2:24 AM
@abhijith_raj wrote:Due to pin constraints, we’re considering using SCL and SDA pins from different GPIO ports—for example, SCL from port PA and SDA from port PC. Is it acceptable to assign I2C pins from different ports for a single peripheral?
So long as they are both for the same I2C peripheral - ie, both for I2C1, or both for I2C2, or both for I2C3.
The peripheral number is included in the AF pin name; eg,
https://www.st.com/resource/en/datasheet/stm32g491re.pdf
via: https://www.st.com/en/microcontrollers-microprocessors/stm32g491re.html#documentation
So there, for example, you have the SDA for I2C1 available in both Port A and Port B
@abhijith_raj wrote:Also, we noticed a pin labeled I2C_SMBA. Could you explain its purpose? Can we use it for CLK or DATA?
See the Reference Manual:
Note:
You didn't give a full part number; the above documents are for STM32G491RE