I2C on MEGA 2560

Hi all,
it must be a very silly error somewhere but I can’t figure out what’s wrong.

I’m trying to set up an I2C connection with an gyrometer.

I put 2 2.2kOhm pull-up resistors on SDA and SCL outputs (pins 20,21) connected to the 5V pin, and plugged a scope on them. I didn’t yet plug the slave.

I wrote a very simple program:

Wire.setClock(100000L);
Wire.begin();
Wire.beginTransmission(0x1D);
Wire.write(0x53);
Wire.endTransmission();

I recorded the first frame emitted from the Arduino board: see picture. It seems that I get the same signal SDA or SCL but not both.

What I see surprises me; I thought I would find a SCL twice as fast as SDA and a beautiful start bit.

Has anyone an idea, please ? I’m stuck :frowning:

Yours

Looks like they are shorted to me. 2.2K is also strong for a pullup, 4.7K is usually sufficient for 1 device and 5V. 1D= 00011101 53 = 01010011

So the data line definitely does not look correct.

There won't be a start bit. See here for more on i2C http://www.gammon.com.au/i2c

no2: Hi all, it must be a very silly error somewhere but I can't figure out what's wrong.

I'm trying to set up an I2C connection with an gyrometer.

I put 2 2.2kOhm pull-up resistors on SDA and SCL outputs (pins 20,21) connected to the 5V pin, and plugged a scope on them. I didn't yet plug the slave.

....

Has anyone an idea, please ? I'm stuck :-(

Yours

Your 'scope image looks like both probes are on the SCL line, and you have a lot of capacitance on the the SCL line. with 2.2k pullups, I would expect a faster square wave without that big delay curve.

Chuck.