摘  要

 

USB(Universal Serial Bus)是一种新型的通用串行总线,它是快速的、双向的、同步的、可以热插拨的、动态连接且价格低廉的串行接口。正是基于这一特点,现在很多的计算机外设都有USB接口。本文正是利用这一新型USB接口来设计上位机与下位机系统之间的通信。利用新型的一线式数字温度传感器测量温度,并通过USB接口和计算机端应用软件进行通信。

本文首先介绍了本系统相关的背景知识以及USB的通信协议,进而介绍温度控制的基本意义,提出利用USB设备芯片CH372、一线式数字温度传感器DS18B20和单片机AT89C51来开发基于USB温度控制系统。采集的温度数据通过USB接口上传到上位PC机上,并利用应用软件对其进行处理。上位机应用软件用C ++ builder 编写,其运用CH372接口芯片的动态链接库建立起上位机和下位机之间的通信机制。上位机将采集到的温度数据在PC机上显示出来,并且显示实时温度采集图像。

此外,应用软件可以对下位机进行温度极限设置等简单控制功能,当采集到的温度超过某一设定极限温度,则对系统进行报警。另外下位机还为今后的扩展保留一定的资源。

 

关键词: AT89C51;USB协议; 温度采集 ;一线式温度传感器 ;CH372

 

 

 

   Abstract

 

USB (Universal Serial Bus) is a kind of new Universal Serial Bus, it is a serial bus which is very fast, dual channel, synchronous, can be pulled and plugged with the power on (Hot Swap), can be connected dynamically and very cheap. Because of this characteristic, nowadays, a great many type of computers have USB interface. The project presented in this dissertation used this new USB interface to design the communication between upper computer and down computer system. With the one wire temperature sensor, I measure the temperature and communicate with the computer application through the USB interface.

At the beginning of this dissertation, some basic knowledge about the system and communication protocol of USB (Universal Serial Bus) will be described, and later, introduced the basic meaning of temperature control, This dissertation also brought forward this idea: to develop the temperature control system which is base on the USB, and those tools the system will need are USB device chip CH372, one wire digital temperature sensor DS18B20 and single chip AT89C51.The temperature system got will upload to the upper computer’s application through USB interface. The upper computer’s application is programmed in the environment of C++ builder; the software I programmed used the DLL (dynamic link library) of CH372 and built the communication system between upper computer and down computer. The upper computer will display the temperature got by the sensor, and display the data on the screen of the PC, and display the temperature acquisition graphics simultaneously.

Besides, the applications on the upper computer can control the down computer to set the temperature limits, things like this, when the temperature exceed a temperature set in advanced, the system will alert. The down computers also keep some resources for future extensions.

 

Keywords: AT89C51; USB specification; temperature acquisition; one wire temperature sensor; CH372

 

 

 

 

目    录

 

引言···························································································· 1

1  背景知识················································································ 1

2  系统概述················································································ 2

2.1 系统的特性································································································ 2

2.2 系统的功能······························································································· 2

2.3 系统开发平台····························································································· 2

3  系统总体设计·········································································· 3

3.1 系统整体方框图·························································································· 3

3.2 系统方案比较····························································································· 3

3.2.1系统两种可行方案···················································································· 3

3.2.2方案最终选择·························································································· 4

4  系统硬件设计·········································································· 5

4.1 中央处理器—-AT89C51·············································································· 5

4.2 温度传感器DS18B20···················································································· 8

4.3 温度采集模块电路设计·············································································· 13

4.4 系统接口模块电路设计·············································································· 15

4.4.1 USB简介······························································································· 15

4.4.2 USB芯片选择························································································· 16

4.4.3 USB设备端接口设计··············································································· 18

4.5 系统硬件整体实现····················································································· 20

5  系统软件设计········································································ 20

5.1 软件设计工具··························································································· 20

5.2 系统软件设计··························································································· 21

5.2.1下位机的软件设计·················································································· 21

5.2.2上位机的软件设计·················································································· 24

6  系统调试··············································································· 25

6.1 硬件调试·································································································· 25

6.2 软件调试·································································································· 26

6.2.1 下位机的软件调试·················································································· 26

6.2.2 上位机的软件调试·················································································· 27

6.2.3 上位机和下位机联机调试········································································ 28

6.3 系统性能指标··························································································· 29

7  系统的简单操作说明······························································ 29

8  总结······················································································ 29

谢辞··························································································· 31

参考文献···················································································· 32

附录··························································································· 33

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。

最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用百度网盘软件或迅雷下载。 若排除这种情况,可在对应资源底部留言,或联络我们。

对于会员专享、整站源码、程序插件、网站模板、网页模版等类型的素材,文章内用于介绍的图片通常并不包含在对应可供下载素材包内。这些相关商业图片需另外购买,且本站不负责(也没有办法)找到出处。 同样地一些字体文件也是这种情况,但部分素材会在素材包内有一份字体下载链接清单。

如果您已经成功付款但是网站没有弹出成功提示,请联系站长提供付款信息为您处理

源码素材属于虚拟商品,具有可复制性,可传播性,一旦授予,不接受任何形式的退款、换货要求。请您在购买获取之前确认好 是您所需要的资源