I2C SPI USB CAN eSPI Cable Testing View All Videos Quick Start Guides Software Downloads App Notes White Papers User Manuals Knowledge Base Sales Support About Us
Products Blog Sales Support Contact Search
What Are the Best Tools to Monitor and Analyze I2C or SPI Bus Traffic Over Extended Periods?
Rena Ayeras

Photo by Alexander Dummer

Question from the Customer:

I am having ongoing challenges with my prototypes. I am looking for the best tools to monitor and analyze bus traffic. In my design, an RTC (real-time clock) gets programmed by a CPU a couple of times roughly every 24 hours to generate an interrupt signal to “wake up” the CPU again after it has been set to sleep. However, there is an ongoing problem: the command packages are delivered in the correct order, but the programmed time to awaken the CPU is incorrect.

To gain more insight into this issue, I want to do the following:

  1. Monitor the I2C line and then trigger a specific device address.
  2. When triggered, I want to see the data exchange, including the duration of when the trigger needs to be re-armed for the next event for the specific device address.
  3. As this is a 48-hour test run, I want to store the data so that I can review the details of the events.

Based on those requests, which tools do you recommend for this project and could you provide some examples of using those tools?

Response from Technical Support:

Thanks for your questions! We recommend using our Beagle I2C/SPI Protocol Analyzer in conjunction with our Data Center Software to observe and record live traffic.

Using the Beagle I2C/SPI Protocol Analyzer

The Beagle I2C/SPI analyzer is a low-cost, effective tool that supports non-intrusive monitoring for the following bus protocols:

  • I2C up to 4 MHz
  • SPI up to 24 MHz†
  • MDIO up to 2.5 MHz (Clause 22 and Clause 45)

† Actual SPI capture performance is dependent on CPU speed and SPI bus throughput. 24 MHz SPI capture has been tested for typical applications (e.g., captures of a few hundred SPI packets). Depending on user configuration, the maximum achievable capture throughput for continuous streaming applications may be less than 24 MHz.

With the GUI interface, you can observe real-time traffic as well as capturing all that data for detailed analysis. Here are some guidelines to help you get started:

  • This is Quick Start video that shows the basics of connecting and starting the Beagle I2C/SPI analyzer:

  • When both troubleshooting and development are needed, we recommend using the Aardvark I2C/SPI Host Adapter with the Beagle I2C/SPI Protocol Analyzer. This video shows an example of prototyping a system using these tools together:

Capturing and Analyzing Bus Traffic with Data Center Software

Data Center Software captures raw data, which can be filtered after the capture. The data is saved to the RAM of the computer. To optimize memory in your application, there is an option to disable the capture of bit-level timing and just keep whole transfers if needed.

However, assuming the following conditions, you should have no problem capturing 48 hours of traffic:

  • If the bitrate is 100 kBit/s, and your system has 32GB of RAM, there is room for 16GB of capture that would cover two days of capture.
  • If the bitrate is faster or is not constant, then the maximum duration of the capture would differ.

Enhance Capturing and Analyzing Bus Traffic

Two software packages are available that support using the Beagle I2C/SPI analyzer:

  • Data Center Software provides a GUI interface to monitor and analyze live data, as well as an option to save the captured data to a file to share with colleagues for more detailed analysis. This software can also be used remotely via telnet. For an example of remote implementation, refer to Running Total Phase Data Center from remote system via Telnet.
  • Beagle Software API provides functional scripts that can be used as is or modified as needed for requirements specific to your setup. For instance, you could write a script using our examples as a basis that just looks for your specific device address. You can also use the API for storing captured data directly to the hard drive for extended periods of time, beyond 48 hours.

For more information about capturing data, refer to this article for capturing and storing data for extended periods and test runs. This example refers to storing SPI data, but the techniques described can be modified for storing I2C data.

Cases of Analyzing Data

There are many blogs and Knowledge Base articles that provide examples of analyzing bus traffic. Here are a few that may be helpful for your specific application. Note – some of these articles were created for SPI data. As previously mentioned, they can all be modified for working with your I2C system.

We hope this answers your questions. Additional resources that you may find helpful include the following:

If you want more information, feel free to contact us with your questions or request a demo that applies to your application.