2025-01-08 02:52 AM
I am using the Nucleo-G0B1RE board for I2C communication with BMS AFE IC. I am able to communicate with AFE if i use I2C1 port. I have tested it with [PB9, PB8] and [PA9, PA10]. If i use I2C2 or I2C3 it doesn't work. In case of I2C2 it only works if i use [PA9, PA10] pins that are common pins between I2C1 and I2C2. If i use any other pins of I2C2 and I2C3 it doesn't work.
As per my application requirement i have to use [PB3,PB4] and it is not working with these pins. Please Help with this
2025-01-08 03:09 AM - edited 2025-01-08 03:14 AM
Hello,
hard to tell without any code. Your description "doesn't work" also isn't very informative.
2025-01-08 03:19 AM
As @filipxsikora said, you need to provide more details.
@Choudharyas wrote:In case of I2C2 it only works if i use [PA9, PA10] pins that are common pins between I2C1 and I2C2. If i use any other pins of I2C2 and I2C3 it doesn't work.
That suggests that the problem lies on those other pins rather that I2C1 vs I2C2.
Pullups?
Have you checked the board's User Manual and/or Schematics to see if PB3,PB4 are "occupied" by anything else?
Have you used an oscilloscope and/or logic analyser to see what's happening on the wires?
Post your schematics.
Show your code.
Do you get HAL error returns in the failing cases?
2025-01-08 03:23 AM
CLK is enabled for I2C peripheral as well as for GPIO. Pull-up resistor are present on BMS board. The same code is working if i use the I2C1 and for I2C2 also if i use the [PA9, PA10] Pins. I am using CubeMX to generate the code and making all the necessary changes when i change the I2C pins.
2025-01-08 03:27 AM
Pull-up resistor are present on BMS board. Hardware and firmware all are same i am only changing the i2C pins and using the cubeMX to generate the code.
I use logic analyzer and got nothing on that. I also checked the Board schematic and in that PB3 and PB4 are directly connected to 'CN9' connector.
2025-01-08 03:32 AM
@Choudharyas wrote:I use logic analyzer and got nothing on that.
What about an oscilloscope - it will show "analogue" details that a LA won't.
Can you set PB3,4 just as GPIO outputs, and toggle them?