cancel
Showing results for 
Search instead for 
Did you mean: 

Can I2C pins be in different ports?

abhijith_raj
Associate III

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?

2 REPLIES 2
Karl Yamashita
Principal

Which STM32G491xx? Upload your IOC file so we can see what pins have been used already..

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.
Andrew Neil
Super User

@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,

AndrewNeil_0-1750411121827.png

AndrewNeil_1-1750411142500.png

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:

AndrewNeil_2-1750411265664.png

https://www.st.com/resource/en/reference_manual/rm0440-stm32g4-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=1626

 

Note:

You didn't give a full part number; the above documents are for STM32G491RE 

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.