Understanding I2C with oscillioscope

Hello everyone,

I got my DSO138 oscilloscope the other day and wanted to examine the I2C protokoll with it. To do so I connected an I2C EEPROM chip (datasheet) to my Arduino Uno and connected the GND and CLK lines to my new toy. I used 5k resistors as pull-up resisitors and uploaded the standard I2C_scanner sketch.

I have attached a picture of what my oscilloscope spit out.

I assume that the “big” pulse on the left is the start condition when the SDA line is pulled low while the SCK line is still high. But I have bunch of questions:

  • what is the long pause after the start condition?
  • why are the first and second clock pulses so small?
  • Why are the later clock pulses small compared to the start condition?
  • The clock pulses are 10us apart which would be in line with the standard 100kHz frequency. Why does my oscilloscope show a frequency of 67kHz? (Sorry if this question is too off-topic)

I want to go 400kHz but after seeing the signal I am unsure about that. Why is my signal so unclean and what can I do to improve it?

Best regards,
Mark

The clock pulses are 10us apart which would be in line with the standard 100kHz frequency. Why does my oscilloscope show a frequency of 67kHz? (Sorry if this question is too off-topic)

I wouldn't rely on that with a 25 bucks "oscilloscope".

what is the long pause after the start condition?

Are you sure there's a pause. The small humps just after the start condition might be the first clock signals.

why are the first and second clock pulses so small?

If you also think these are the first pulses where do you see a pause?

Why are the later clock pulses small compared to the start condition?

I guess a setup with a too high bus capacitance. The signal doesn't have enough time to reach the higher value. You might try a smaller pull-up resistor.

I want to go 400kHz but after seeing the signal I am unsure about that. Why is my signal so unclean and what can I do to improve it?

Take a look at this article. This guy has take pictures with a scope that is made for such frequencies and explains the influence of pull-up resistors and bus capacitance.


Figure-1:

From your scope's diagram, it is clear that the frequency of the SCK is 100 kHz (distance from one peak to another peak = 10 us ---> 1/10 us = 1000000/10 = 100 000 = 100 kHz. You should not rely on the screen calculation as you know that the SCK rate has been set at 100 kHz by the Wire.h Library as default.

For academic reasons, you may study the following theoretical timing diagram of the I2C Protocol.

Figure-2:


Figure-3:

Comparing Fig-2 and Fig-3, you could figure out the meaning of the leading large pulse of your scope's diagram.

pylon:
I guess a setup with a too high bus capacitance. The signal doesn’t have enough time to reach the higher value. You might try a smaller pull-up resistor.

Take a look at this article. This guy has take pictures with a scope that is made for such frequencies and explains the influence of pull-up resistors and bus capacitance.

Thanks for the great link.
I tried smaller pull-up resistors (down to 1k) which did help but the first 2 clock pulses remain relatively small (see first image).
What could be the reason for this?

Furthermore I also tested the SDA line (see second image) and to my surprise this signal had 3 voltage levels present. Due to the spacing of the “low levels” I assume that they are ACK bits from the slave. But this begs the question why can’t the arduino pull the signal all the way down? In the SDA signal the Vpp is 5v as it should be. But the SCK signal has a Vpp of approximately 3v. Could this also be because the arduino doesn’t pull the line all the way down?

sry forgot the first image

It probably is pulling the signal down close to zero, but it appears your o-scope is set to AC, not DC.

With 1kΩ pull-ups you're over the specs of I2C current sinking (2mA), you might fry your equipment.

Could this also be because the arduino doesn't pull the line all the way down?

This is either a measurement problem (AC mode as SurferTim mentioned) or a problem that the pull-ups aren't able to bring the voltage to that level fast enough because the bus capacitance is too high.