Electrical – Noises on the I2C BUS

i2cstm32

I am using stm32f407 and LM75 with I2C Bus serial communication.
In this code, I am Using a lot of interrupts and etc.Sometimes I2C Can give a error I can accept this but I am uncomfortable with signals.
There is only LM75 IC on the bus line and Rp is 4.7K ohm.

Sometimes I2C Bus give an BERR Error or I2C Status stuck busy or i2c bus line stay zero volt.

How can I fix the signal? Or is it normal?

I have tried 10pf capacitors between ground and scl and between ground and sda. But signals are same.

There are oscilloscope views below

Photo1: I2CBUS Diagram

Photo2: 1MHZ speed I2CBUS

Photo3: 100KHZ speed I2CBUS

Photo4: 400KHZ speed I2CBUS

Photo5: PROPS

Photo6: I2C ROUTES

Photo7: Ground and Supply noises(Channel 1:MCU Ground, Channel 2:MCU Supply)

i2cbus
100 KHZ
400 KHZ
1mhz
props
pcb
Ground and Supply noises

Best Answer

I would guess that the ringing on the falling edge is a measurement artifact (The black crocodile clip leads that come with scope probes are EVIL), but apart from that:

1MHz is very, very fast for I2C, especially with that relatively high pull up value. Are you sure your I2C slaves devices (all of them, not just the one you are trying to address) are capable of meeting timing at that rate?

Your 100kHz waveform looks fine to me, and your 400kHz one is not horrible (But I might take the pull up resistors down to 2.2k or so).

I would second the note about the LM75 being a little bit lockup happy, and would note that a bus reset like the one demonstrated elsewhere is a good idea at boot time as otherwise you can end up with the bus peripheral state machine not matching the processors idea of bus state, very annoying when trying to use a debugger.

My instinctive response to I2C is that I will happily do the extra routing to use SPI instead if I have any choice, so much less annoying from a software perspective (Also a noise and immunity perspective).

Having now seen the extra photos, the ringing on the falling edge is almost certainly mostly does to the length of the scope ground lead and not really present, and the waveforms are fine at 100k, and mostly ok at 400k (2.2k pull ups will make both fine), your remaining problems are probably software.