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
test-and-measurement:analog-discovery-2:pmod-jstk [2021/05/14 23:04] – ↷ Page moved from reference:test-and-measurement:analog-discovery-2:pmod-jstk to test-and-measurement:analog-discovery-2:pmod-jstk Arthur Browntest-and-measurement:analog-discovery-2:pmod-jstk [2022/09/12 12:19] (current) – changed forum.digilentinc.com to forum.digilent.com Fausto Soares
Line 9: Line 9:
 ===== Inventory ===== ===== Inventory =====
   * A Digilent Test and Measurement device that supports WaveForms' //Scope//, //Patterns//, and //Logic// instruments.   * A Digilent Test and Measurement device that supports WaveForms' //Scope//, //Patterns//, and //Logic// instruments.
-    * [[https://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Analog Discovery 2]] +    * [[https://digilent.com/shop/analog-discovery-2-100ms-s-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Analog Discovery 2]] 
-    * [[https://store.digilentinc.com/analog-discovery-studio-a-portable-circuits-laboratory-for-every-student/|Analog Discovery Studio]]+    * [[https://digilent.com/shop/analog-discovery-studio-a-portable-circuits-laboratory-for-every-student/|Analog Discovery Studio]]
     * //An Analog Discovery (Legacy) can also be used.//     * //An Analog Discovery (Legacy) can also be used.//
-  * [[https://store.digilentinc.com/pmod-jstk2-two-axis-joystick/|Pmod JSTK2]]+  * [[https://digilent.com/shop/pmod-jstk2-two-axis-joystick/|Pmod JSTK2]]
     * A Pmod JSTK (Legacy) is pin-compatible and can also be used.     * A Pmod JSTK (Legacy) is pin-compatible and can also be used.
   * WaveForms Installation   * WaveForms Installation
-    * [[reference:software:waveforms:waveforms-3:start|Resource Center]]+    * [[software:waveforms:waveforms-3:start|Resource Center]]
   * {{reference:test-and-measurement:analog-discovery-2:pmod-jstk:displaying-joystick-position.zip|ZIP Archive}}   * {{reference:test-and-measurement:analog-discovery-2:pmod-jstk:displaying-joystick-position.zip|ZIP Archive}}
     * //Includes a WaveForms workspace for displaying positional data captured from the Pmod JSTK2.//     * //Includes a WaveForms workspace for displaying positional data captured from the Pmod JSTK2.//
Line 25: Line 25:
 This script utilizes the pattern generator to produce the clock and chip select signals required for SPI communication with the Pmod. The logic analyzer is used to take samples of the data every 5 milliseconds, which is pushed into an array that is displayed in the oscilloscope window as a reference channel. The array contains 500 points, so the X-Y plot will display a trace of the joystick position. When either of the 3 buttons on the Pmod are pressed, the display is cleared and three points in the top portion of the plot represent the left, center, and right buttons. This script utilizes the pattern generator to produce the clock and chip select signals required for SPI communication with the Pmod. The logic analyzer is used to take samples of the data every 5 milliseconds, which is pushed into an array that is displayed in the oscilloscope window as a reference channel. The array contains 500 points, so the X-Y plot will display a trace of the joystick position. When either of the 3 buttons on the Pmod are pressed, the display is cleared and three points in the top portion of the plot represent the left, center, and right buttons.
  
-The script performs bit-wise operations to convert the data into a usable form. As the [[reference:pmod:pmodjstk2:reference-manual|Pmod JSTK2 Reference Manual]] states, the X- and Y-coordinates are each passed to the Test and Measurement device as 10 bits contained within 2 bytes. The first byte in the set contains the 8-least significant bits, and the last 2 bits of the second byte are the 2 most-significant bits of the coordinate. The fifth byte indicates the status of the three buttons, represented by the 3 least-significant bits. See the chart below for a visualization of the data. Thus, the data, taken as 16-bit words is processed into a 10-bit number ranging from 0 to 1023. After the number is generated it is added to an array which is displayed as the X-Y plot.+The script performs bit-wise operations to convert the data into a usable form. As the [[pmod:pmodjstk2:reference-manual|Pmod JSTK2 Reference Manual]] states, the X- and Y-coordinates are each passed to the Test and Measurement device as 10 bits contained within 2 bytes. The first byte in the set contains the 8-least significant bits, and the last 2 bits of the second byte are the 2 most-significant bits of the coordinate. The fifth byte indicates the status of the three buttons, represented by the 3 least-significant bits. See the chart below for a visualization of the data. Thus, the data, taken as 16-bit words is processed into a 10-bit number ranging from 0 to 1023. After the number is generated it is added to an array which is displayed as the X-Y plot.
  
-For a better understanding of the what the script is doing, please read the [[reference:pmod:pmodjstk2:reference-manual|Pmod JSTK2 Reference Manual]] and see Figure 1, below.+For a better understanding of the what the script is doing, please read the [[pmod:pmodjstk2:reference-manual|Pmod JSTK2 Reference Manual]] and see Figure 1, below.
  
 {{ reference:test-and-measurement:analog-discovery-2:pmod-jstk:flow_diagram.png?400 |}} {{ reference:test-and-measurement:analog-discovery-2:pmod-jstk:flow_diagram.png?400 |}}
Line 83: Line 83:
 ==== Final Notes ==== ==== Final Notes ====
  
-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 [[reference:test-and-measurement:start]] page.+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:start]] page.
  
-For more information about how to use the Pmod JSTK2 featured in this demo, please visit its [[reference:pmod:pmodjstk2:start|Resource Center]].+For more information about how to use the Pmod JSTK2 featured in this demo, please visit its [[pmod:pmodjstk2:start|Resource Center]].
  
-For technical support, please visit the [[https://forum.digilentinc.com|Digilent Forums]].+For technical support, please visit the [[https://forum.digilent.com|Digilent Forums]].
  
 {{tag>project analog-discovery-2 analog-discovery analog-discovery-studio}} {{tag>project analog-discovery-2 analog-discovery analog-discovery-studio}}