cancel
Showing results for 
Search instead for 
Did you mean: 

CONFLICT WHEN USING I2C1 STM32F4 DISCOVERY

bacnk
Associate II

I use STM32F4 Discovery, and when using I2C1 for communication, I encounter a situation where the chip becomes unresponsive while using UART and during operation with I2C1. When I use other I2C interfaces, it works normally. I want to understand what is causing I2C1 to make the chip unresponsive.

When I use other I2C interfaces, the response is only within 100ms, but when using this I2C interface, the response takes several seconds

thanks you

7 REPLIES 7

Have you checked the board's User Manual and/or Schematics to see if there's anything else on that pin?

Example just now:

https://community.st.com/t5/stm32-mcus-products/low-voltage-for-logic-high-on-nucleo-g431kb/td-p/737306

 

Imen.D
ST Employee

Hello @bacnk 

Make sure that there are no resource conflicts between I2C1 and other peripherals and that I2C1 is correctly initialized and configured in your code.

I advise you to enable timeout register and use an oscilloscope or logic analyzer to monitor the I2C bus.

 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

I use stm32f4 discovery kit, I configure i2c 2,3 similarly but when using i2c 2,3 it is normal, but when using i2c1 I have the problem of slow response chip. I use uart to check response time

I use resistor connected to 3v3, do I need to configure pull up in the code?

> I use resistor connected to 3v3, do I need to configure pull up in the code?

No, but the value of the external resistor matters, together with its capacitance.

> the chip becomes unresponsive while using UART and during operation with I2C1

Which chip? How do you know it's unresponsive?

Do you observe the SDA/SCL signals using oscilloscope or logic analyzer (LA)?

As @Imen.D pointed out above, there may be pins which are already used on the board. In particular, I2C1_SDA can be on pins PB7/PB9, I2C1_SCL on PB6/PB8, but note, that is on-board I2C device on PB6/PB9 (the CS43L22 audio codec) so if you use these pins, note that the on-board I2C device may interfere. See manual and schematics of the Disco board.

JW

Again, have you checked the board's User Manual and/or Schematics to see if there's anything else on those pins?

ie, have you checked for conflicts on the board?

 

Use an oscilloscope to see what's actually happening on the wires.

 

Please show a schematic.

Trying to describe electronic circuits in text is really ineffective - that's why we have schematics!