Efficient I2C Bus debug using Mixed Signal Oscilloscopes
I2 DebuggingAs an example, consider the embedded system in Figure 3. An I2 bus is connected to multiple devices including a CPU, an EEPROM, a fan speed controller, a digital to analog converter (DAC), and a couple of temperature sensors.
Click on image to enlarge.
Now assume that one of these products was returned to engineering for failure analysis as the product was consistently getting too hot and shutting itself off. The first thing to check is the fan controller and the fans themselves, but they both appear to be working correctly.
The next thing to check for is a faulty temperature sensor. The fan speed controller polls the two temperature sensors (located in different areas of the instrument) periodically and adjusts the fan speed to regulate internal temperature.
One possibility is that one or both of these temperature sensors are not reading correctly. To see the interaction between the sensors and the fan speed controller, the first step is to connect to the I2 clock and data lines, and specify the input channels and voltage levels on the oscilloscope.
In this example, the two sensors are addresses 18 and 19 on the I2 bus, so the first move is to set up a trigger event to look for a write to address 18 (the fan speed controller polling the sensor for the current temperature). The triggered acquisition is shown in the screenshot Figure 4.
Click on image to enlarge.
In this case, channel 1 (yellow) is connected to SCLK and channel 2 (cyan) to SDA. The purple waveform The trace at the bottom of the display shows the decoded I2 bus. The upper portion of the display shows the entire acquisition. In this case, the oscilloscope captured a lot of bus idle time with a burst of activity in the middle. The lower, larger portion of the display shows this section zoomed in. The oscilloscope has decoded the content of each message going across the bus.
Taking a look at the acquired waveforms, the oscilloscope did trigger on a write to address 18 (shown in the lower left of the display). In fact, the fan speed controller attempted to write to address 18 twice, but in both cases it did not receive an acknowledge after attempting to write to the temperature sensor. (The oscilloscope indicates the no-acknowledge conditions with an exclamation point bordered in red.) The controller then checked the temperature sensor at address 19 and received back the desired information.
So, why isn’t the first temperature sensor responding to the fan controller?
Taking a look at the part on the board it turns out that one of the address lines was not soldered correctly. The temperature sensor was not able to communicate on the bus and the unit was overheating as a result. This example showed how a mixed signal oscilloscope can be used to quickly isolate a potentially elusive problem using I2 trigger and bus decoding capability.
In the example in Figure 4, the system was configured to trigger on a specific address, but it is also useful to trigger on a number of other conditions when working with I2 buses. Here are some useful triggering alternatives that are available:
* Start - triggers when SDA goes low while SCL is high.
* Repeated Start - triggers when a start condition occurs without a previous stop condition. This is usually when a master sends multiple messages without releasing the bus.
* Stop - triggers when SDA goes high while SCL is high.
* Missing Ack - slaves are often configured to transmit an acknowledge after each byte of address and data. The oscilloscope can trigger on cases where the slave does not generate the acknowledge bit.
* Address - triggers on a user specified address (as in the example above) or any of the pre-programmed special addresses including General Call, Start Byte, HS-mode, EEPROM, or CBUS. Addressing can be either 7 or 10 bits and is entered in binary or hex. Read or write may also be specified.
* Data - triggers on up to 12 bytes of user specified data values entered in either binary or hex.
* Address and Data - this allows the user to enter both address and data values as well as read vs. write to capture the exact event of interest.
These triggers allow you to isolate specific bus traffic, while the decoding capability makes it possible to see the content of every message transmitted over the bus in an acquisition.
Conclusion
The I2 serial bus is widely used, especially in systems that deal with sensors or human interfaces where simplicity and cost are more important than speed. Traditional manual decoding methods still in use to decode I2 on oscilloscope are time-consuming and inefficient. However, with the appropriate application modules installed, mixed signal oscilloscopes can trigger, decode and search I2 bus traffic, greatly improving productivity.
Dave Pereles, a staff engineer at Tektronix, has worked in the test and measurement industry in various roles including applications engineering and product management for over 25 years. Has a BS in electrical engineering from Trinity College, Hartford, CT and an MBA from Seattle University.


Loading comments... Write a comment