Skip to main content
Associate III
March 10, 2025
Solved

I2C speed problems

  • March 10, 2025
  • 6 replies
  • 3373 views

Hi everyone,

I’m currently working on an I2C communication setup using the Nucleo-H753ZI DK but the cubeMx document is for the STM32H743BIT (the MCU for my custom board) and aiming to run it in Fast Mode (400 kHz). However, when configuring the I2C clock speed to 400 kHz, the CLK signal becomes unstable, as shown in the attached image.

JonConesa_0-1741626901002.png

To ensure the setup is functioning correctly, I ran tests with I2C configured at 100 kHz, and the communication works perfectly in that case.

 

I’ve also included an image of the system clock configuration in case there’s something that could be optimized.

JonConesa_1-1741627197068.png

JonConesa_2-1741627277291.png

JonConesa_3-1741627293171.png

 

 

Does anyone know what might be causing the instability in the CLK signal, preventing proper communication at 400 kHz?

 

Thanks in advance for your help!

Best answer by padawan

Hi,

the internal pullups are to weak.(about 10k and more).

A good choice are 3k3 as pullup on the SDA and SCL lines.

hth

Padawan

6 replies

Andrew Neil
Super User
March 10, 2025

What pullup value are you using?

Look at the signal on an oscilloscope to see what's happening:

AndrewNeil_1-1741628448667.png

https://electronics.stackexchange.com/a/473799

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.
TDK
Super User
March 10, 2025

Increase the logic analyzer sample rate. Looks like it's just too slow to capture things at the resolution you're expecting. Compare sample rate to time between edges. Probably you only have 1-2 samples per pulse here.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JonConesaAuthor
Associate III
March 10, 2025

Thanks a lot for your response!

Regarding the pull-up, I am using the MCU’s internal pull-up.

As for the logic analyzer, I’m using a Saleae Logic 8 with a 10 MS/s sampling rate.

Also, just to add, I’m working with the PCA555, which supports 400 kHz.

TDK
Super User
March 10, 2025

Include the .SAL capture file with the waveforms you show above here.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Andrew Neil
Super User
March 11, 2025

As the others have said, MCU (not just SMT32) internal pullups are too weak - especially when you're going for high speed!

Don't just guess at the pullup value; use an oscilloscope to pick  something appropriate - as shown earlier.

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.
TDK
Super User
March 11, 2025

A logic analyzer is perfectly fine here for a 400 kHz signal. The issue is the sampling rate on the logic analyzer (in addition to the weak pullups).

"If you feel a post has answered your question, please click ""Accept as Solution""."
Andrew Neil
Super User
March 11, 2025

But the scope view would immediately & directly show the rise-time issue - which is not visible on a LA view.

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.
TDK
Super User
March 11, 2025

While true, the rise time on all bits is the same, so any errors will be cancelled out and the displayed clock rate will be accurate to the precision of the sample rate. The duty cycle will not be representative, however that doesn't matter here.

(In this case, the logic analyzer in question can also do analog captures anyway, so this is all academic.)

"If you feel a post has answered your question, please click ""Accept as Solution""."
TDK
Super User
March 11, 2025

I2C is not a fixed speed. It must wait (per the I2C spec) until a specific voltage is reached during the rising clock cycle. Since your edges are slow, the final clock speed is lower than 400 kHz. You can see the speed increase as your pullups get stronger.

A clock speed of 370 kHz or lower does not pose a problem in terms of communication.

"If you feel a post has answered your question, please click ""Accept as Solution""."