Do I need both Master and slave( I2C ) devices to view the signal on oscilloscopes?

Hi All,
I'm new here and not familar with I2C.
I was trying to fetch the waveform from pin A4,A5 of ardunio Nano. but it seems I could not get the correct waveform from the two pins.
Do I need a slave device to write ACK to make it possible to fetch the waveform?
Or there is something wrong with my actions/code?
I have copy the sample code and upload to the board:

#include <Wire.h>

byte val = 0;

void setup() {
  Wire.begin(); // Join I2C bus
}

void loop() {
    Wire.beginTransmission(44);  // Transmit to device number 44 (0x2C)

    Wire.write(val);             // Sends value byte
    Wire.endTransmission();      // Stop transmitting

    val++;                       // Increment value

    // if reached 64th position (max)
    if(val == 64) {
        val = 0;                   // Start over from lowest value
    }

    delay(500);
}

Thanks.

Yes, IF the intent to "spy"

Hardware Hacking 101: E01 I2C Sniffing, How to Listen to Your Arduino's I2C Bus - CUJO AI

1 Like

You must relate those signals to the Arduino GROUND. Connect the scope probe ground to the Arduino ground.
If you ware trying to see the actual data bits, you need to sync the scope sweep with the I2C clock signal while looking at the data signal.

1 Like

Thanks, I'm looking at the article.

Thanks Paul, the GROUND connection seems ok.
but I don't quite understand how to do the setting for " sync the scope sweep with the I2C clock signal".

I trigger on the falling edge of the clock. If you can afford it yo can purchase one of those 24Mhz logic analyzers for less then $10.00, with the correct software it will decode the I2C and translate the data to what format you want such as Hex or ASCII. Nice part they plug into the USB port.

1 Like

Hello gilshultz,
We have an oscilloscope which include the I2C Protocol decoder. I just could not get the waveform.
I'm trying to buy a I2C device to communicate with arduino nano.

Is there an actual I2C device with the address 44?

I2C doesn't send out the complete transmission in one go, like, say, a UART serial port might. After each byte, the I2C master expects some sort of acknowledgement from the slave device before sending the next byte.

The sequence begins with a start condition on the I2C bus, followed by the device address. If the remote device doesn't send back an ack, then the transmission times out and no more bytes are sent.

1 Like

There are three kinds of signals that are asserted on the I2C Bus by Master.
1. Checking the presence of the Slave (the Roll Calling).
2. Sending data byte(s) to Slave.
3. Getting data byte(s) from Slave by issuing request command.

Which one of the above you want to monitor first?

1 Like

Hi Mark,
No device with the address 44, now I'm a bit more clear about what should I do.
I bought a LCD1602 and DS1307 just now.
I didn't suppose to get so many replies at such short time. Thank you all for the help.

Hi GolamMostafa,
I tried to send the message and decode the signal by the oscilloscope.
Thanks for the reply.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.