Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
test-and-measurement:guides:waveforms-protocol-analyzer [2022/09/12 15:48] – changed forum.digilentinc.com to forum.digilent.com Jeffrey | test-and-measurement:guides:waveforms-protocol-analyzer [2024/02/29 14:27] (current) – [Using the Protocol Analyzer] replaced image Fausto Soares | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Using the Protocol Analyzer ====== | ||
+ | ~~TechArticle~~ | ||
+ | |||
+ | {{test-and-measurement: | ||
+ | |||
+ | ===== Introduction ===== | ||
+ | Protocol Analyzers are used to send, receive, and spy on transactions in a variety of different digital communication protocols. This guide explains the use of WaveForms' | ||
+ | ---- | ||
+ | ===== Prerequisites ===== | ||
+ | * A Digilent Test & Measurement Device with Digital Input/ | ||
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * Only the SPI and I2C protocols in Primary/ | ||
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * [[test-and-measurement: | ||
+ | * A Computer with WaveForms Software Installed | ||
+ | * //Arduino UNO, or other microcontroller - optional, for testing// | ||
+ | * // | ||
+ | |||
+ | ---- | ||
+ | ===== Guide ===== | ||
+ | ==== 1. Opening the Protocol Analyzer ==== | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 1.1 === | ||
+ | Plug in the Test & Measurement Device, then start WaveForms and make sure the device is connected. | ||
+ | |||
+ | If no device is connected to the host computer when WaveForms launches, the **Device Manager** will be launched. Make sure that the device is plugged in and turned on, at which point it will appear in the Device Manager' | ||
+ | |||
+ | **Note:** //" | ||
+ | |||
+ | **Note:** //The Device Manager can be opened by clicking on the " | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{ reference: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 1.2 === | ||
+ | Once the Welcome page loads, in the instrument panel at the left side of the window, click on the **Protocol** button to open the //Protocol Analyzer// instrument. | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 1.3 === | ||
+ | Once the //Protocol Analyzer// instrument opens, the window contains the spy panel (1.) showing captured data, the configuration panel (2.) above the spy panel, and the control toolbar (3.) at the top of the window. | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== 2. Using the Protocol Analyzer ==== | ||
+ | |||
+ | //The //Protocol Analyzer// can be used to spy on protocol communications to validate data flow. It may also be used to drive protocol communication to verify peripheral functionality. This section explains how to spy and then drive communication.// | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 2.1 Hardware Setup === | ||
+ | |||
+ | To demonstrate the capabilities of the //Protocol Analyzer// instrument, this guide uses a [[pmod: | ||
+ | |||
+ | ^ Test & Measurement Device | ||
+ | | DIO 0 | Digital Pin 10 | CS | | ||
+ | | DIO 1 | Digital Pin 13 | SCK | | ||
+ | | DIO 2 | Digital Pin 11 | MOSI | | ||
+ | | DIO 3 | Digital Pin 12 | MISO | | ||
+ | | Ground (down arrow) | ||
+ | | N/A | 5V | VCC | | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 2.2 Arduino Setup === | ||
+ | Note: //This guide assumes the [[https:// | ||
+ | |||
+ | Click Sketch> | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 2.3 Software Setup === | ||
+ | |||
+ | Back in WaveForms, click the SPI tab below the menu bar. | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | When the SPI tab is opened, it is initially set to spy on the data sent on MISO and MOSI, however it must be configured to match the PmodAD5 SPI communication properties. In the configuration panel, set the frequency to 1 MHz, the clock polarity to 1 and the clock phase to 1 (SPI Mode 3). | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 2.4 Protocol Spying === | ||
+ | |||
+ | Click Receive ({{: | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 2.5 Logic Analyzer === | ||
+ | |||
+ | The //Logic Analyzer// can be used alongside the //Protocol Analyzer// to visualize the timing of the data being sent. In the //Protocol Analyzer// click the **Logic Analyzer** button in the top right corner, which opens the //Logic Analyzer// instrument. | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | In order to show both the //Protocol Analyzer// and the //Logic Analyzer// instruments on the screen at once, click on the Docking Windows button ({{learn: | ||
+ | |||
+ | **Note:** //To return to the default tabbed view later, click on the “Tabbed Windows” button ({{learn: | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | Click the **Protocol** button near the right side of the control the control bar, then SPI MOSI to set a trigger on the MOSI pin. A trigger configuration popup window will open. Change the //Value// setting to " | ||
+ | |||
+ | **Note:** //The //Protocol Analyzer// can't be used for spying if the //Logic Analyzer// is enabled.// | ||
+ | |||
+ | Close the //Logic Analyzer// by clicking the **X** in the top right corner of the instrument. | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 2.6 Driving Communications === | ||
+ | |||
+ | The //Protocol Analyzer// may also be used to drive peripheral communications. To begin, remove the 4 data connections between the Arduino and PmodAD5, keeping the 5V and GND pins connected. Next, click open the Master tab. | ||
+ | |||
+ | Set mode to Read Write. Next, in the Write (DQ0) text box, enter the sequence of bytes below: < | ||
+ | Clicking the **Execute** button will execute the SPI transmission, | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | ==== Note: Using Multiple Instruments ==== | ||
+ | The //Protocol Analyzer// instrument can be used with other WaveForms instruments. Using multiple instuments at the same time is helpful in a wide variety of situations. One example would be to use the //Protocol Analyzer// to configure a device under test, the //Pattern Generator// or //Protocol Analyzer// to stimulate the device, and capturing the result in the //Logic Analyzer//, all at the same time. More information on how instruments can be operated together can be found in the [[test-and-measurement: | ||
+ | |||
+ | It should be noted that while multiple instruments can use any Digital Input pin, and those pins can be used as Digital Outputs, no more than one instrument can control a Digital Output pin at a time. WaveForms accounts for this by disabling instruments using a shared output, or by displaying a message stating that a shared output is currently used by a different instrument. | ||
+ | ---- | ||
+ | ==== 3. Protocol Analyzer User Interface Overview ==== | ||
+ | //This section describes the various controls present in the //Protocol Analyzer// instrument.// | ||
+ | |||
+ | The //Protocol Analyzer// interface is separated into a settings panel and a communication panel. The settings panel is used to configure which pins will be used for a protocol’s transmission and the protocol’s properties. The communication panel is where data may be inputted for transmission and incoming data is displayed. Each protocol has different settings and communication panels which will be discussed in the following sections. | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 3.1 UART Interface === | ||
+ | |||
+ | The // | ||
+ | |||
+ | </ | ||
+ | {{ reference: | ||
+ | </ | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | **Spy** mode configures the instrument to listen for incoming data. In the TX & RX field, controls and configuration are as follows: | ||
+ | |||
+ | * Clicking //Receive// ({{: | ||
+ | * Clicking //Stop// ({{: | ||
+ | * Clicking //Receive to File// ({{: | ||
+ | * Clicking //Cancel// stops this process. | ||
+ | * Checking //TX Echo// causes any data transmitted using the TX field with also be displayed within the RX field. | ||
+ | |||
+ | The size of the text in the RX field may be adjusted with ({{: | ||
+ | |||
+ | The communications panel in **Send & Receive** mode, contains a TX field and a RX field. | ||
+ | |||
+ | The TX field has a text box where characters to be sent may be typed in. With the //Auto// option checked, characters are sent as they are typed. Otherwise, characters may be sent by clicking //Send// or by hitting the Enter key. When //Escape// is checked, escaped characters (\t, \n, \0, etc.) will be accepted. Clicking the //Send File// button, to the right of the Escape box, will transmit the contents of a chosen file. | ||
+ | |||
+ | The RX field in this mode contains the same settings as the TX & RX field in Spy mode. | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | {{ reference: | ||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 3.2 SPI Interface === | ||
+ | |||
+ | The // | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | {{: | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | The communications panel exposes four different modes of functionality, | ||
+ | |||
+ | **Spy** mode simply configures the instrument to listen for incoming data on the MISO pin. The //Mode// dropdown allows selection between Three-wire, Standard, Dual and Quad modes. Checking the //Command// box tells the instrument to interpret the first N bits of a transaction as a command. The //Data Bits// field specifies the expected length of a SPI transaction. | ||
+ | |||
+ | **Master** mode allows the instrument to act as a SPI master. | ||
+ | |||
+ | * //Mode// allows selection of transmission mode. | ||
+ | * //Command bits// specifies command word length. | ||
+ | * //Command// specifies the command word which is sent before the read and/or write operation. | ||
+ | * //Word bits// specifies the word length. Words is the number of words for the next transmission. | ||
+ | * //Write// specifies the words to send and Read shows the read words. | ||
+ | |||
+ | When writing, data can be represented in binary, decimal or hexadecimal format, and may be imported from a binary or text file using the //Open// button. Likewise, data can be saved to a binary or text file using //Save// or //Append// when reading. | ||
+ | |||
+ | **Custom** mode allows a communication script to be written. Please see the Protocol page within WaveForms' | ||
+ | |||
+ | **Sensor** mode also allows for a communication script to be written. It allows for more precise timing of repeated transactions than in Custom mode. The // | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | {{: | ||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | |||
+ | === 3.3 I2C Interface === | ||
+ | |||
+ | The // | ||
+ | |||
+ | </ | ||
+ | <WRAP column half> | ||
+ | |||
+ | {{ reference: | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | **Spy** mode configures the instrument to listen for incoming data. Clicking Receive ({{: | ||
+ | |||
+ | **Master** mode allows the instrument to act as an I2C master. The //Address// and // | ||
+ | |||
+ | **Custom** mode allows a communication script to be written. Please see the Protocol page within WaveForms' | ||
+ | |||
+ | **Sensor** mode also allows for a communication script to be written. It allows for more precise timing of repeated transactions than in Custom mode. The // | ||
+ | </ | ||
+ | <WRAP column half> | ||
+ | {{ reference: | ||
+ | </ | ||
+ | </ | ||
+ | ---- | ||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | === 3.4 CAN Interface === | ||
+ | The // | ||
+ | </ | ||
+ | <WRAP column half> | ||
+ | {{: | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP column half> | ||
+ | The communication panel contains a TX and an RX field. The TX field has a text box where the data to be transmitted can be entered. Clicking the //Execute// button sends the data. The TX field also has an //ID// input for the device identifier. Checking the // | ||
+ | </ | ||
+ | <WRAP column half> | ||
+ | {{: | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | <WRAP group>< | ||
+ | === 3.5 AVR Protocol === | ||
+ | The AVR tab provides an interface for interacting with and programming AVR microcontrollers. As with other protocols, each of the signals associated with the protocol can be assigned to any of the device' | ||
+ | </ | ||
+ | {{reference: | ||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP group> | ||
+ | === 3.6 Menu Bar === | ||
+ | The **File** Menu contains options for saving/ | ||
+ | |||
+ | The **Control** menu contains options for starting and halting the instrument also listing hotkeys for the operations and a button for opening the Logic Analyzer. | ||
+ | |||
+ | The **View** menu contains a drop-down menu for setting the maximum number of lines, a drop-down menu for selecting a timestamp format to be prepended to the data and a checkbox which enables/ | ||
+ | |||
+ | From the **Window** menu other opened WaveForms instruments, | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | ==== Next Steps ==== | ||
+ | |||
+ | For more guides on how to use the Digilent Test and Measurement Device, return to the device' | ||
+ | |||
+ | For more information on WaveForms visit the [[software: | ||
+ | |||
+ | For technical support, please visit the [[https:// |