Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
learn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer:start [2019/11/20 00:00]
Arthur Brown
learn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer:start [2020/07/28 17:25]
Arthur Brown
Line 1: Line 1:
-====== Using the Protocol Analyzer ====== +====== Using the Protocol Analyzer ​(Page has Moved) ​======
- +
-{{:​reference:​instrumentation:​analog-discovery-studio:​hardware-reference-manual:​protocol-analyzer.png?​nolink&​800}} +
- +
-===== Introduction ===== +
-This guide explains the use of the //​Protocol//​ instrument in WaveForms. This instrument is used to send, receive, and spy on transactions in a variety of different digital communication protocols. +
----- +
-===== Prerequisites ===== +
-  * A Digilent Test & Measurement Device with Digital Input/​Output Channels +
-  * A Computer with WaveForms Software Installed +
- +
----- +
-===== 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'​s device list (1). Click on the device in the list to select it, then click the Select button (2) to close the Device Manager. +
- +
-**Note:** //"​DEMO"​ devices are also listed, which allow the user to use WaveForms and create projects without a physical device.// +
- +
-**Note:** //The Device Manager can be opened by clicking on the "​Connected Device"​ button in the bottom right corner of the screen (3), or by selecting "​Device Manager"​ from the "​Settings"​ menu at the top of the screen.//+
  
 +<WRAP round important 660px>
 +This guide has been replaced by [[learn/​instrumentation/​tutorials/​waveforms-protocol-analyzer/​start]],​ and is slated to be removed from the Digilent Wiki. Please update all bookmarks and saved links to the new location.
 </​WRAP>​ </​WRAP>​
-<WRAP column half> 
- 
-{{ :​learn:​instrumentation:​tutorials:​analog-discovery-studio-oscilloscope:​waveforms-device-manager.png?​600 |}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
- 
----- 
- 
-<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>​ 
-<WRAP column half> 
- 
-{{ :​learn:​instrumentation:​tutorials:​waveforms-instrument-panel:​waveforms-instrument-panel-protocol.png?​nolink&​600 |}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
- 
----- 
- 
-<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>​ 
-<WRAP column half> 
- 
-{{ :​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​protocol-default.png?​600 |}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
- 
----- 
- 
-==== 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 [[:​reference:​pmod:​pmodad5:​|PmodAD5]] and an Arduino UNO to spy on the SPI communications taking place between the host and peripheral. Afterwards, the Test and Measurement device will be used as the SPI master to drive communications with the PmodAD5. Make the pin connections as seen in each row of the table below: 
- 
-^ Test & Measurement Device ​ ^ Arduino Uno  ^ Pmod AD5  | 
-| DIO 0 and DIO 1      | N/A             | N/A       | 
-| Ground (down arrow) ​ | GND             | GND       | 
-| N/A                  | 5V              | VCC       | 
-| N/A                  | Digital Pin 10  | CS        | 
-| N/A                  | Digital Pin 11  | MOSI      | 
-| DIO 3                | Digital Pin 12  | MISO      | 
-| N/A                  | Digital Pin 13  | SCK       | 
- 
-</​WRAP>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​protocol-analyzer-hardware-setup.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<WRAP group> 
-<WRAP column half> 
- 
-=== 2.2 Arduino Setup === 
-Note: //This guide assumes the Arduino 1.8.9 toolset is already installed//​. ​ 
- 
-Click Sketch>​Include Library>​Manage Libraries. In the search filter type AD7193 and install the library by Anne Mahaffey. Once the download has finished, close the Library Manager window, then click File>​Examples>​AD7193>​AD7193_VoltageMeasure_Example. Click Upload to program the Arduino with the example sketch. 
- 
-</​WRAP>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-ad7193-install.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<WRAP group> 
-<WRAP column half> 
- 
-=== 2.3 Software Setup === 
- 
-Back in WaveForms, click the SPI tab below the menu bar. 
- 
-</​WRAP>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-spi-select.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
- 
-<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>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-spi-config.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<WRAP group> 
-<WRAP column half> 
- 
-=== 2.4 Protocol Spying === 
- 
-Click Receive ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-receive-button.png|}}) to begin spying on the data transmission between the Arduino and PmodAD5. The capture panel will start populating with data sent between the Arduino and the PmodAD5. Each line beginning with "​Data:"​ represents a stream of data from when chip select goes low to when it goes high (in an Active Low Chip Select configuration,​ each line is measured by Chip Select going high then low). Each 8 bit packet is separated by a comma, with the MOSI and MISO data printed respectively,​ separated by a "​|"​. 
- 
-</​WRAP>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-spi-spy.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<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>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-open-la.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
- 
-<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:​instrumentation:​tutorials:​analog-discovery-studio-voltmeter:​symbol_docking.png?​nolink}}) in the top right corner of the screen. 
- 
-**Note:** //To return to the default tabbed view later, click on the “Tabbed Windows” button ({{learn:​instrumentation:​tutorials:​analog-discovery-studio-voltmeter:​symbol_tabbed.png?​nolink}}) adjacent to the Docking Windows button.// 
- 
-</​WRAP>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-window-docking.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
- 
-<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 "​h58"​ to observe the PmodAD5 sample data being sent. 
- 
-**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>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-data.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<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: <​code>​h08 h38 h00 h64 h58 h00 h00 h00 h00</​code>​ 
-Clicking the **Execute** button will execute the SPI transmission,​ populating the Read (DQ1) section with the response, as well as outputting the write and read packets in the text box below. 
- 
-</​WRAP>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​waveforms-protocol-master-output.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-==== 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 //​Settings//​ panel is used to assign TX and RX to DIO pins. The settings panel is also used to configure the UART protocol properties: polarity, parity, baud rate, number of data bits, number of stop bits, and end-of-line character(s). 
- 
-</​WRAP>​ <WRAP column half> 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​uart-settings.png?​600|}} 
-</​WRAP>​ </​WRAP>​ 
- 
-<WRAP group> 
-<WRAP column half> 
- 
-The communications panel 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. 
- 
-In the RX field, controls and configuration are as follows: 
- 
-  * Clicking //Receive// ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​receive.png?​12|}}) will cause the instrument to listen for incoming data on the RX pin.  
-  * Clicking //Stop// ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​stop.png?​12|}}) causes it to cease listening. ​ 
-  * Clicking //Receive to File// ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​receive-to-file.png?​12|}}) has the instrument listen for data and saving it to a local 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 ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​plus.png?​12|}}) and ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​minus.png?​12|}}) above and to the right of the text field. The field may be cleared ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​clear.png?​12|}}) and its contents saved ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​save.png?​12|}}) or appended ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​append.png?​12|}}) to a file. 
- 
-</​WRAP>​ 
-<WRAP column half> 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​uart-comms.png?​600|}} 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<WRAP group> 
-<WRAP column half> 
- 
-=== 3.2 SPI Interface === 
- 
-The //​Settings//​ panel is used to configure which pins are used for chip select, clock, MOSI, and MISO, as well as to choose the chip select active level, clock frequency, polarity, phase, bit transmission order, and word transmission order. 
- 
-</​WRAP>​ 
-<WRAP column half> 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​spi-settings.png?​600|}} 
-</​WRAP>​ 
-</​WRAP>​ 
- 
- 
- 
-<WRAP group> 
-<WRAP column half> 
- 
-The communications panel exposes four different modes of functionality,​ selected using the tabs at the top of the panel. 
- 
-**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'​ Help tab for available functions and their descriptions. ​ 
- 
-**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 //​Iterations//​ and //Rate// fields specifies the number of times and rate at which, respectively,​ that the loop function is called. 
- 
-</​WRAP>​ 
-<WRAP column half> 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​spi-comms.png?​600|}} 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<WRAP group> 
-<WRAP column half> 
- 
-=== 3.3 I2C Interface === 
- 
-The //​Settings//​ panel allows the user to select which DIO pins are to be used as SCL and SDA, and to select a clock frequency and to enable support for I2C clock stretching. Specifying a frequency allows the device to filter glitches occurring for times shorter than 10% of the corresponding period. 
- 
-</​WRAP>​ 
-<WRAP column half> 
- 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​i2c-settings.png?​600|}} 
- 
-</​WRAP>​ 
-</​WRAP>​ 
- 
- 
-<WRAP group> 
-<WRAP column half> 
-**Spy** mode configures the instrument to listen for incoming data. Clicking Receive ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​receive.png?​12|}}) causes the instrument to begin listening for incoming data, echoing it in the text box. Reception of data is stopped by clicking the Stop button ({{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​stop.png?​12|}}). A timestamp may be prepended to the output text by checking the Timestamp box under the Settings button (the gear next to Receive). 
- 
-**Master** mode allows the instrument to act as an I2C master. The //Address// and //​SubAddress//​ are specified within the respective text boxes. The message to be sent may be typed within the Write text input, or by loading a binary file. //Bytes// displays the number of bytes that will be written. Clicking the //Write// button transmits the data. The number of //Bytes// to read is specified by the input next to the Read button. Clicking the //Read// button executes a read operation which is shown in the text field below the button. Read data bytes may be saved or appended to a binary or text file using the buttons to the right side of the window. 
- 
-**Custom** mode allows a communication script to be written. Please see the Protocol page within WaveForms'​ Help tab for available functions and their descriptions. ​ 
- 
-**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 //​Iterations//​ and //Rate// fields specify the number of times and rate at which, respectively,​ the loop function is called. 
-</​WRAP>​ 
-<WRAP column half> 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​i2c-comms.png?​600|}} 
-</​WRAP>​ 
-</​WRAP>​ 
----- 
-<WRAP group> 
-<WRAP column half> 
-=== 3.4 CAN Interface === 
-The //​Settings//​ panel allows selection of the digital pins that are used for the CAN interface'​s TX and RX signals, the data polarity, and the data rate. 
-</​WRAP>​ 
-<WRAP column half> 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​can-settings.png?​400|}} 
-</​WRAP>​ 
-</​WRAP>​ 
- 
-<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 //​Extended//​ box will make the CAN packets use an extended device identifier. Checking the //Remote// box will instruct the instrument to send a Remote Frame, while leaving it unchecked instructs the instrument to send a Data Frame. The //DLC// field specifies the number of data bytes for a Remote transmission request, and is disabled when sending a Data Frame. 
-</​WRAP>​ 
-<WRAP column half> 
-{{:​learn:​instrumentation:​tutorials:​analog-discovery-studio-protocol-analyzer:​can-comms.png?​400|}} 
-</​WRAP>​ 
-</​WRAP>​ 
- 
----- 
-==== Next Steps ==== 
- 
-For more guides on how to use the Digilent Test & Measurement Device, return to the device'​s Resource Center, linked from the [[reference:​instrumentation:​start|Instrumentation]] page of this wiki. 
- 
-For more information on WaveForms visit the [[reference:​software:​waveforms:​waveforms-3:​reference-manual|WaveForms Reference Manual]]. ​ 
- 
-For technical support, please visit the [[https://​forum.digilentinc.com/​forum/​8-scopes-instruments/​|Scopes and Instruments]] section of the Digilent Forums. 
  
-{{tag>analog-discovery-studio tutorial}}+{{tag>to-be-removed}}