Support Question of the Week: How Can I Best Capture SPI Bus Data for Calibration and Analysis – Use a Host Adapter or a Protocol Analyzer?

I am debugging a TI C2000 microcontroller using SPI.  The setup:

  • The PC (personal computer) side of the SPI bus is the slave.
  • The packet rate is 10kHz, 100 bits/packet.

Looking at the specifications about the AardvarkTM I2C/SPI Host Adapter, I understand that when acting as a slave, the maximum clock rate of the Aardvark host adapter is 4Mhz.  My questions:

  1. Can the Aardvark host adapter be used to log data on the PC at the packet rate of 10kHz, 100 bits/packet?
  2. What is the time limit for logging data?
  3. Using both the Data CenterTM Software and an Aardvark host adapter, is it possible to both log data and graph data using your LabVIEW drivers and API? The graph data will be used for calibration; the logged data will be used for offline analysis.

Note – there is no slave on the SPI bus.  Because I am debugging the microcontroller, I am thinking about outputting the data via SPI and transferring data to the PC. It looks like the Aardvark host adapter could be used as an SPI slave or to monitor the bus to capture SPI bus data.

Thanks for your questions! Analyzing data is a legacy feature of the Aardvark host adapter.  As an SPI slave, the Aardvark host adapters supports up to 4MHz, which supports your packet rate of 1MHz (10 K packet rate per second x 100 bits per packet).

However, in your case, as you only need to monitor SPI traffic from the microcontroller and do not need to send a response, we recommend using the BeagleTM I2C/SPI Protocol Analyzer.  The Beagle protocol analyzer is a dedicated I2C and SPI sniffer.  In comparison, the Beagle protocol analyzer has more robust features and provides a better interface (with the Data Center software) for examining the data.

 

Using the Beagle I2C/SPI Protocol Analyzer to log and graph data using Data Center Software and LabVIEW. Figure 1: Beagle I2C/SPI Protocol Analyzer

 

Regarding LabVIEW - we provide the LabVIEW driver for the Beagle analyzer, so you can take advantage of using LabVIEW to graph data. These drivers simply wrap the C API and expose the functionality to LabVIEW. For each call, the bg_spi_read function (or SPI Read VI) returns the next SPI message seen on the bus. There is no limit to how long you can capture data, as long as data is grabbed fast enough so that the buffers in the Beagle Software API libraries do not overflow. For the speeds that you are using, overflow should not occur. For information about API software, please refer to section 6 of the Beagle Protocol Analyzer User Manual.

To view a graph in LabVIEW and save the data for offline analysis, the data will need to be logged in the LabVIEW application. The SPI example provided with the Beagle LabVIEW drivers already writes the data to a file; you will need to add the graphing function to the API software. For additional information, please refer to the following documents:

Aardvark Host Adapter User Manual
Beagle Protocol Analyzer User Manual
Beagle LabVIEW Driver
Beagle Software API
Data Center Software User Manual
Total Phase Products
Product Selector Guide

 We hope this answers your question. If you have other questions about our host adapters or other Total Phase products, feel free to email us at sales@totalphase.com or submit a request for technical support.

Leave a Reply