Skip to main content
Visitor II
August 9, 2023
Question

Trying to identify noise on the I2C bus

  • August 9, 2023
  • 4 replies
  • 4078 views

I'm working on STM32G491RET on the I2C bus. I've noticed intermittent noise on SDA and sparse timing inconsistency on the SCL as pictured. Could someone advise as to the nature/cause/imact of this.

 

20230808_175110.jpg

This topic has been closed for replies.

4 replies

RhSilicon
Lead
August 9, 2023

Is breadboard being used? Or any plug-in cabling that could cause poor contact?

ONadr.1
Senior III
August 9, 2023

These short spikes are typical of poor contact on the bus conductors. They can be caused by what RhSilicon already mentioned and also poor soldering quality of the leads. Sometimes they can be induced into the bus line when switching off the inductive load, e.g. relay.

waclawek.jan
Super User
August 9, 2023

What pull-ups are you using?

JW

RhSilicon
Lead
August 9, 2023

Waveform looks consistent with not too bad values :thinking_face:

But since the SDA noises seem to be synchronized with SCL, it could be a port access problem, perhaps due to bare-metal code.

Senior
August 9, 2023

Hi, It seems base on pulse figure, the signals created by your self in code, not using libraries... If yes, I recommend, using libraries like HAL... after problem solved, try your code again to finding where is problem... 

RhSilicon
Lead
August 9, 2023

The user can also use bare-metal code based on what HAL does.

waclawek.jan
Super User
August 9, 2023

Looking closer at the waveforms, the pulse are around the 9th clock, i.e. that's ACK pulled down by the slave a tad bit later than master releases SDA, and released a tad bit sooner than master re-engages SDA. This is normal.

For experimenting, I recommend to inserting a small series resistor between master+pullup and slave, so that it creates a divider such that slave pulling down SDA (or also SCL if you are interested in investigating clock stretching from master) results in a slightly-higher-than-zero-but-still-below-threshold level when observed at the master's side. The waveforms are often revelatory.

JW