SPI Protocol Viewer
Introduction
This is a workspace set up to generate SPI transactions with theProtocol Analyzerinstrument's custom signal scripting tool. Through the scripting tool, theProtocol Analyzergenerates a pattern corresponding to the binaryASCIIvalues of “Hello World!”. TheLogic Analyzeris set to display the values transferred through the SPI signals in decimal. The signals are generated at 40kHz, and theLogic Analyzeris set to collect 4,096 samples at a rate of 1.02MHz, resulting in an approximately 3 ms acquisition time.
了解更多关于SPI协议,Wikipediaarticle about it is a good resource.
Inventory
-
A Discovery Device with Digital I/O:
-
An Analog Discovery (Legacy) can also be used.
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 theSPI 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, selectNo. Navigate toSettings → Device Managerin the menu bar at the top of the window, to check that the active device is your Discovery device.
Click theOpen Workspacebutton on the Welcome tab. Navigate to and open thespi-protocol-viewerworkspace in WaveForms.
3. Running the SPI Protocol Viewer
The workspace is ready to use. Press the “Single” button in the Logic window, then press theExecutebutton in theProtocol Analyzerinstrument. TheLogic Analyzerwill display the decimal values of theASCIIcodes 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.
Final Notes
This workspace is a good starting point for testing a SPI device through WaveForms. By simply modifying the contents of theASCIIarray, 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 theMISOdata 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'sTest and Measurementpage.
For technical support, please visit theDigilent Forums.