SPI Protocol Viewer


This is a workspace set up to generate SPI transactions with the Protocol Analyzer instrument's custom signal scripting tool. Through the scripting tool, the Protocol Analyzer generates a pattern corresponding to the binary ASCII values of “Hello World!”. The Logic Analyzer is set to display the values transferred through the SPI signals in decimal. The signals are generated at 40kHz, and the Logic Analyzer is set to collect 4,096 samples at a rate of 1.02MHz, resulting in an approximately 3 ms acquisition time.

To learn more about the SPI protocol, the Wikipedia article about it is a good resource.


Setup Instructions

1. Hardware Setup

Plug your Discovery device into your computer via a USB cable.

No additional hardware setup is required for this project.

2. Software Setup

Download and extract the WaveForms workspace from the SPI Protocol Viewer Workspace ZIP Archive (also linked in the inventory section, above).

Open WaveForms. Upon launch, WaveForms will generate a prompt asking to switch to the device used with the workspace. As this is the device originally used when the workspace was created and archived, select No. Navigate to Settings → Device Manager in the menu bar at the top of the window, to check that the active device is your Discovery device.

Click the Open Workspace button on the Welcome tab. Navigate to and open the spi-protocol-viewer workspace in WaveForms.

3. Running the SPI Protocol Viewer

The workspace is ready to use. Press the “Single” button in the Logic window, then press the Execute button in the Protocol Analyzer instrument. The Logic Analyzer will display the decimal values of the ASCII codes for “Hello World!”.

Note: To view the data through the Logic Analyzer while using the Protocol Analyzer, the Protocol Analyzer was placed into debug mode, which disables the Protocol Analyzer's ability to receive data. If this workspace is used to receive data through the Protocol Analyzer, the debug button will need to be deselected.

Protocol Analyzer Instrument

Logic Analyzer Instrument

Final Notes

This workspace is a good starting point for testing a SPI device through WaveForms. By simply modifying the contents of the ASCII array, different values can be sent to a SPI slave device. An additional SPI bus can be added in the Logic Analyzer to view a device's responses on the MISO data line.

For more guides and example projects for your Test and Measurement device, please visit its Resource Center, which can be found through this wiki's Test and Measurement page.

For technical support, please visit the Digilent Forums.