Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| test-and-measurement:analog-discovery-2:display-pmod-tmp2-data [2022/09/13 19:54] – Arthur Brown | test-and-measurement:analog-discovery-2:display-pmod-tmp2-data [2022/10/04 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Display Pmod TMP2 Data with WaveForms (Under Construction) ====== | ||
| + | |||
| + | <WRAP round todo> | ||
| + | == Under Construction == | ||
| + | </ | ||
| + | |||
| + | {{ reference: | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | This project contains a script that graphs temperature data from a Pmod TMP2 on the WaveForms Oscilloscope. | ||
| + | |||
| + | The script communicates with the Pmod using the I2C protocol and collects up to 500 data points. In addition to displaying the temperature data over time, the script calculates and plots the instantaneous rate of change. | ||
| + | |||
| + | The script uses the WaveForms Protocol Analyzer to perform an I2C Read operation to the Pmod's address, setting the 0x00 register as active. The Pmod TMP2 reports the temperature as 13-bits, with the MSB signifying the sign (+/-) of the value. Since the data is transferred as 2 bytes, some bit shifting is required to convert the numbers into a usable form. | ||
| + | |||
| + | The Power Supplies are used to feed power to the pull-up resistors required by the I2C protocol. | ||
| + | |||
| + | Please read the [[reference: | ||
| + | |||
| + | ===== Inventory ===== | ||
| + | * WaveForms | ||
| + | * Analog Discovery (Legacy) | ||
| + | * Analog Discovery 2 | ||
| + | * Pmod TMP2 | ||
| + | * Two 1 kΩ to 100 kΩ pull-up resistors | ||
| + | * {{ : | ||
| + | |||
| + | ---- | ||
| + | ===== Setup Instructions ===== | ||
| + | === 1. Hardware Setup === | ||
| + | |||
| + | This script requires that a Pmod TMP2 be connected to the Analog Discovery | ||
| + | DIO pins in the following order: | ||
| + | |||
| + | |< | ||
| + | ^ DIO Pin ^ Pmod Pin ^ | ||
| + | | DIO-0 | SCL | | ||
| + | | DIO-1 | SCA | | ||
| + | | GND | GND | | ||
| + | | V+ | VDD | | ||
| + | |||
| + | Place one resistor each between VDD, SCL, and SCA. | ||
| + | |||
| + | Leave all the jumper pins open. | ||
| + | |||
| + | ---- | ||
| + | === 2. Software Setup === | ||
| + | |||
| + | Make sure to download and extract the ZIP archive linked in the [[# | ||
| + | |||
| + | If another address needs to be set with the Pmod's J1 or J2 pins, change the address in the command on line 13 of the script as below: | ||
| + | |||
| + | '' | ||
| + | |||
| + | ---- | ||
| + | === 3. Running the Script === | ||
| + | <WRAP group> <WRAP column half> | ||
| + | Once the workspace loads, press the **Run** button in the Script window (or press F5 on the keyboard). The Analog Discovery will start communicating with the Pmod and streaming the data through the oscilloscope. | ||
| + | |||
| + | **Note:** //Due to the script not handling cases where an I2C transaction is not acknowledged, | ||
| + | </ | ||
| + | {{ reference: | ||
| + | </ | ||
| + | |||
| + | <WRAP group> <WRAP column half> | ||
| + | Note that the Oscilloscope view launches in a separate window from the script, supplies, and Protocol Analyzer. | ||
| + | |||
| + | The red line is the temperature on a scale of 0-150 °C (the units are shown as V), the cyan line is the rate of change. Typical room temperatures are around 25 °C (77 °F), so the script editor' | ||
| + | </ | ||
| + | {{ reference: | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | === 4. Stopping the Script === | ||
| + | |||
| + | When finished using the script, press the " | ||
| + | |||
| + | **Note:** //Stopping the script may require a few rapid clicks because the system is busy every 0.05 seconds, thus blocking inputs. The F6 key reliably stops the script.// | ||
| + | |||
| + | ---- | ||
| + | ===== 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 [[test-and-measurement: | ||
| + | |||
| + | For more information about how to use the Pmod TMP2 featured in this demo, please visit its [[pmod: | ||
| + | |||
| + | For technical support, please visit the [[https:// | ||

