Display Pmod TMP2 Data with WaveForms (Under Construction)
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 Inventory section, above. Open the “temp.dwf3work” workspace in WaveForms. When selecting the device in the Device Manager dialog, be sure that configuration #4 is selected.
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:
data = Protocol.I2C.Read( {NEW ADDRESS} ,2,[0x00])
3. Running the Script
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, running the script without hardware plugged in is not recommended, as it may put the application into a difficult-to-exit blocking state.
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's Output window should be showing values around that number. Try blowing hot or cold air on the Pmod to see the temperature readings change.
4. Stopping the Script
When finished using the script, press the “Stop” button in the Script window (or F6 on the keyboard) and the “Master Enable is On” button in the Supplies window.
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 page.
For more information about how to use the Pmod TMP2 featured in this demo, please visit its Resource Center.
For technical support, please visit the Digilent Forums.