I2C with STM32l432kc

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

I2C with STM32l432kc

Post by Iraton »

I need to connect 2 i2c device on my board and the pinout of the board show me that he as i2c on pin PA_9/PA_10 and PB_7/PB_6, but when i do the i2c scanner only the second one recognize the i2c, why? It's normal that only one i2c works or I'm doing something wrong?
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: I2C with STM32l432kc

Post by fpiSTM »

If it is a nucleo32 check the schematic. I guess you have some SB to rework.
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

Re: I2C with STM32l432kc

Post by Iraton »

Yes is a nucleo32 but could you be more explanatory? I don't know what you're talking about
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: I2C with STM32l432kc

Post by fpiSTM »

I talk about Soldier Bridge. Read the user manual or the schematic of the bord to see if pins you used are correct.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: I2C with STM32l432kc

Post by fpiSTM »

Just think about your first post:
PA_9/PA_10 and PB_7/PB_6
This is the pinName. You have to use PA9/PA10 and PB7/PB6 which are the pin number used at sketch level.
Moreover they are both on the same I2C: I2C1. So if you want 2 differents I2C at same time. You should connect all I2C peripherals on the same or use the I2C3 IP.

About pins and schematics with SB:
l432KC.png
l432KC.png (22.17 KiB) Viewed 1227 times
As you can see PB6/PB7 are available twice due to SB configurations.
Post Reply

Return to “General discussion”