Pmod TMP2数据波形显示(施工中)
设置说明
1.硬件设置
这个脚本要求Pmod TMP2被连接到模拟发现DIO引脚在以下顺序:
| 戴奥销 | Pmod销 | 
|---|---|
| DIO-0 | SCL. | 
| DIO-1 | 斯卡 | 
| 接地 | 接地 | 
| V + | VDD | 
在VDD、SCL和SCA之间分别放置一个电阻。
让所有跳线别针打开。
2.软件设置
请确保下载并解压缩链接在库存部分,以上。打开“temp.dwf3work”工作区中的波形。在设备管理器对话框中选择设备时,请确保已选择配置#4。
如果需要用Pmod的J1或J2引脚设置另一个地址,请在脚本第13行命令中修改地址,如下所示:
data = Protocol.I2C。读取({NEW ADDRESS},2,[0x00])
3.运行脚本
加载工作空间后,按运行按钮(或按键盘上的F5)。模拟发现将开始与Pmod通信,并通过示波器流数据。
注意:由于脚本不处理不承认I2C事务的情况,所以不建议在没有插入硬件的情况下运行脚本,因为它可能会使应用程序进入难以退出的阻塞状态。
请注意,Oscilloscope视图在脚本、supplies和Protocol Analyzer单独的窗口中启动。
红线表示0-150°C的温度(单位用V表示),青色线表示变化率。典型的室温大约是25°C(77°F),所以脚本编辑器的Output窗口应该显示这个数值。试着在Pmod上吹热风或冷空气,看看温度读数的变化。
4.停止脚本
当使用完脚本后,按下脚本窗口中的“Stop”按钮(或键盘上的F6),并在供应窗口中的“Master Enable is on”按钮。
注意:停止脚本可能需要进行几次快速单击,因为系统每0.05秒都很忙,因此会阻塞输入。F6键可靠地停止脚本。
最后指出
更多测试和测量设备的指南和示例项目,请访问其资源中心,可以在本wiki中找到测试和测量页面。
有关如何使用本演示中的Pmod TMP2的更多信息,请访问其资源中心.
有关技术支持,请访问Digilent论坛.

![}
===== 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:pmod:pmodtmp2:reference-manual]] for more information about the Pmod.
===== Inventory =====
  * WaveForms
  * Analog Discovery (Legacy)
  * Analog Discovery 2
  * Pmod TMP2
  * Two 1 kΩ to 100 kΩ pull-up resistors
  * {{ :reference:test-and-measurement:analog-discovery-2:display-pmod-tmp2-data:display-pmod-tmp2-data.zip |ZIP Archive with WaveForms Workspace } =====简介=====这个项目包含一个脚本,图形温度数据从Pmod TMP2上的波形示波器。该脚本使用I2C协议与Pmod通信,并收集多达500个数据点。除了显示随时间变化的温度数据外,该脚本还计算并绘制瞬时变化速率。该脚本使用WaveForms Protocol Analyzer对Pmod的地址执行I2C读取操作,将0x00寄存器设置为活动的。Pmod TMP2报告的温度为13位,MSB表示值的符号(+/-)。由于数据是以2字节的形式传输的,因此需要进行一些位移动来将数字转换成可用的形式。电源被用来给I2C协议所需的上拉电阻供电。请阅读[[reference:pmod:pmodtmp2:reference-manual]]了解更多关于pmod的信息。===== Inventory ===== * WaveForms *模拟发现(Legacy) *模拟发现2 * Pmod TMP2 *两个1 kΩ到100 kΩ上拉电阻*{{:参考:测试和测量:模拟发现-2:显示- Pmod - TMP2 -data. ZIP |ZIP Archive with WaveForms Workspace](http://www.knowreader.com/reference/_media/reference/test-and-measurement/analog-discovery-2/display-pmod-tmp2-data/shot1.png?w=600&tok=f75f0d)

