Oscilloscope setup for I2C

  1. Introduction
  2. Channels
  3. Start the scope running
  4. Voltage
    1. Voltage Scale
    2. Voltage Offset
  5. Set Trigger
    1. Source and edge
    2. Trigger level
    3. Trigger offset
  6. Timing scale
  7. Sample rate

Introduction

These instructions provide a quick setup for your oscilloscope for I2C monitoring. They will help you get a usable few bytes of transaction on screen. From that starting point, you can explore packets, inter-byte delays, read-to-write turnaround times, signal integrity issues and timing problems.

When setting up your oscilloscope, you need to know two parameters about your bus.

  • bus speed
  • operating voltage

You will need at least two channels to see the I2C bus.

You will need the scope to be free-running to find your signals on the screen. You will adjust the voltage to bring the signal waveforms on-screen. You might see static levels, square waves, or flat lines with occasional vertical lines as you set up. Once you have your signals on-screen, you can set up to capture signals and adjust timing to make them visible.

Channels

The I2C bus has two signals that you need to look at. Other signals may interface between the host controller and the target device.

SignalTypical statecomments
bus onlySDAIdles high
SCLIdles High
optional signalsRESET#Active lowUse for bus hangs and boot timing analysis.
INTERRUPTActive highInterrupt latency timing. Peripheral set up analysis.
ENABLEActive highPeripheral set up analysis.
POWERonPeripheral availability. Brown out analysis.

Remember, you must connect to the ground as well as the signal.

Each channel on your scope has a separate enable control to turn it on and off. Turn on each channel using this enable.

Start the scope running

  • Trigger – auto/continuous.
  • RUN – enable

Voltage

The scope may not be configured for your needs. Use the voltage scale and position controls to bring the active signals on-screen.

Voltage Scale

  • Initally 2v/div.

The I2C bus will operate at 5v or less. The optional signals may not be at the same voltage level as the I2C bus. Refer to the schematic and datasheets for the actual operating parameters.

A good starting voltage scale is 2v/div to easily accommodate 4 channels on screen at once, with some overlap. 2v/div will make the signals no more than 2.5 divisions tall, and all should be visible after you set the voltage offset. You may choose to reduce the scale for each channel individually after you set the voltage offsets.

Voltage Offset

  • Initially set to 0v.
  • Use vertical position to spread signals evenly over the screen.

Initially, zero the voltage offset of all channels. You should see SDA and SCL overlapping and just above the axis. Some oscilloscopes have a zero function for the channel voltage position.

Use the position dial to move the SDA signal’s 0v position above the SCL; this will match most datasheets you are looking at.

Set Trigger

  • source = SDA
  • Type = Falling Edge
  • Level = 0.5v
  • Offset = 0.0 seconds

Source and edge

  • SDA
  • Falling edge

You must trigger on the SDA channel to find I2C transactions on your scope. The SDA channel will have a falling edge with a valid START condition, the first event in any transaction.

Trigger level

  • Level = 0.5v

The low should, theoretically, reach 0v, but this might not always happen. A logic low is usually below 30% of the maximum voltage for the signal we are monitoring. For any I2C bus implementation, a 0.5v level should work as a rule of thumb. This level is practical if you are moving your scope probe around a segmented bus where you could be on either side of a level shifter.

A logic high should be at full voltage, but logic will recognise a high above 70%.

We would use a 50% trigger level to catch risings or falling edges.

If you know the bus voltage, use the values in the table below.

bus voltageeither
50%
falling
30%
rising
70%
5.0v2.5v1.5v3.5v
3.3v1.65v1v2v
1.8v900mv600mv1.2v
1.0v500mv300mv700mv

Remember, just because your oscilloscope recognises a state change, your hardware may not.

Trigger offset

  • 0.0 seconds

If you do not see the trigger marker on the top of your screen, you may not see events, even if you catch them. Use the horizontal scale zero function to reset the offset to be visible.

Timing scale

  • 50us/div

Timing is bus speed dependent. With our trigger set up on the START (SDA falling edge) condition, we capture from before the first bit-time. There may be some latency between the start and the first falling SCL.

speedbit timebyte timeshow
one byte

5 bytes
100 kbit/s10us90us9us/div45us/div
400 kbit/s2.5us22.5us2.25us/div12us/div
1 Mbit/s1us9us1us/div5us/div
1.7 Mbit/s588ns5.3us500ns/div5us/div
3.4 Mbit/s294ns2.6us250ns/div2us/div
5 Mbit/s200ns1.8us200ns/div1us/div

Sample rate

Most oscilloscopes have a sampling rate that tracks the timing scale. However, you do need to make sure you capture each clock edge on SCL so that you can see all the data. The sample rate should be at least twice that of the edges we are trying to catch.

modemax speedsample rate
samples/sec
standard100 kbit/s400k
fast400 kbit/s1.6M
fast+1 Mbit/s4M
high-speed1.7 Mbit/s8M
high-speed3.4 Mbit/s16M
ultra-fast5 Mbit/s20M