Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
learn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer [2019/06/20 22:23] – [2. Using the Protocol Analyzer] Andrew Holzerlearn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer [2019/08/06 20:25] – [3. Protocol Analyzer User Interface Overview] Andrew Holzer
Line 67: Line 67:
  
 ==== 2. Using the Protocol Analyzer ==== ==== 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 group>
Line 73: Line 75:
 === 2.1 Hardware Setup === === 2.1 Hardware Setup ===
  
-This step describes setting up simple loopback circuit that connects the Test Measurement device's digital input/output (DIO) channel 0 pin with DIO channel 1 pin. These channels will be used to demonstrate the UART transmit and receive functions of the //Protocol Analyzer//.+To demonstrate the capabilities of the //Protocol Analyzer// instrument, this guide uses [[: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. This step describes how to setup the hardware.
  
-Connect the Test & Measurement devices DIO channel 0 pin (first solid pink wireto the devices DIO channel 1 pin (first solid green wire).+First, connect the Arduino's pin 10 to the AD5's pin 1, the Arduino's pin 11 to the AD5's pin 2, the Arduino's pin 12 to the AD5's pin 3, the Arduino's pin 13 to the AD5's pin 4, Arduino's GND to the AD5's pin 5 and finally Arduino's 5V to the AD5's pin 6. 
 + 
 +Next, connect the Test & Measurement device's digital input/output (DIOchannel 0 pin to the chip select (pin 1of the AD5, the DIO channel 1 pin to the AD5's clock (pin 4), the DIO channel 2 pin to the AD5's MOSI (pin 2) and finally the DIO channel 3 pin to the AD5's MISO (pin 3). 
  
 </WRAP> </WRAP>
Line 88: Line 92:
 <WRAP column half> <WRAP column half>
  
-=== 2.2 ===+=== 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>
 <WRAP column half> <WRAP column half>
  
-FIXME image+{{:learn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer:waveforms-protocol-ad7193-install.png?600|}}
  
 </WRAP> </WRAP>
Line 101: Line 108:
 <WRAP column half> <WRAP column half>
  
-=== 2.3 ===+=== 2.3 Software Setup === 
 + 
 +Back in WaveForms, click the SPI tab below the menu bar.
  
 </WRAP> </WRAP>
 <WRAP column half> <WRAP column half>
  
-FIXME image+{{:learn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer:waveforms-protocol-spi-select.png?600|}}
  
 </WRAP> </WRAP>
Line 114: Line 123:
 <WRAP column half> <WRAP column half>
  
-=== 2.4 ===+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>
 <WRAP column half> <WRAP column half>
  
-FIXME image+{{:learn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer:waveforms-protocol-spi-config.png?600|}} 
 + 
 +</WRAP> 
 +</WRAP> 
 + 
 +<WRAP group> 
 +<WRAP column half> 
 + 
 +=== 2.3 Protocol Spying === 
 + 
 +Click {{:learn:instrumentation:tutorials:analog-discovery-studio-protocol-analyzer:waveforms-protocol-receive-button.png|}} Receive 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.4 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 () in the top right corner of the screen. 
 + 
 +Note: To return to the default tabbed view later, click on the “Tabbed Windows” button () adjacent to the Docking Windows button. 
 + 
 +Click the Docking Windows button, further up in the top right corner, to split the screen between the //Protocol Analyzer// and //Logic Analyzer//
 + 
 +</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 then SPI MOSI to set a trigger on the MOSI pin. A SPI Trigger popup window will open. Change Value 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. 
 + 
 +</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.5 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 the Master tab. 
 + 
 +Set mode to Read Write. Next, in the Write (DQ0) section, write h08 h38 h00 h64 h58 h00 h00 h00 h00. 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>
 </WRAP> </WRAP>
 ==== 3. Protocol Analyzer User Interface Overview ==== ==== 3. Protocol Analyzer User Interface Overview ====
 +//This section describes the various controls present in the //Protocol Analyze// instrument.
  
 +<WRAP group>
 +<WRAP column half>
 +
 +=== 3.x ===
 +
 +</WRAP>
 +<WRAP column half>
 +
 +</WRAP>
 +</WRAP>
 ---- ----
 {{tag>tutorial analog-discovery-studio}} {{tag>tutorial analog-discovery-studio}}