资源描述:
《基于USB接口的温度控制器基于USB接口的温度控制器.doc》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、摘要USB(UniversalSerialBus)是一种新型的通用串行总线,它是快速的、双向的、同步的、可以热插拨的、动态连接且价格低廉的串行接口。正是基于这一特点,现在很多的计算机外设都有USB接口。本文正是利用这一新型USB接口来设计上位机与下位机系统之间的通信。利用新型的一线式数字温度传感器测量温度,并通过USB接口和计算机端应用软件进行通信。本文首先介绍了本系统相关的背景知识以及USB的通信协议,进而介绍温度控制的基本意义,提出利用USB设备芯片CH372、一线式数字温度传感器DS18B20和单片机AT89C
2、51来开发基于USB温度控制系统。采集的温度数据通过USB接口上传到上位PC机上,并利用应用软件对其进行处理。上位机应用软件用C++builder编写,其运用CH372接口芯片的动态链接库建立起上位机和下位机之间的通信机制。上位机将采集到的温度数据在PC机上显示出来,并且显示实时温度采集图像。此外,应用软件可以对下位机进行温度极限设置等简单控制功能,当采集到的温度超过某一设定极限温度,则对系统进行报警。另外下位机还为今后的扩展保留一定的资源。关键词:AT89C51;USB协议;温度采集;一线式温度传感器;CH372A
3、bstractUSB(UniversalSerialBus)isakindofnewUniversalSerialBus,itisaserialbuswhichisveryfast,dualchannel,synchronous,canbepulledandpluggedwiththepoweron(HotSwap),canbeconnecteddynamicallyandverycheap.Becauseofthischaracteristic,nowadays,agreatmanytypeofcomputersh
4、aveUSBinterface.TheprojectpresentedinthisdissertationusedthisnewUSBinterfacetodesignthecommunicationbetweenuppercomputeranddowncomputersystem.Withtheonewiretemperaturesensor,ImeasurethetemperatureandcommunicatewiththecomputerapplicationthroughtheUSBinterface.At
5、thebeginningofthisdissertation,somebasicknowledgeaboutthesystemandcommunicationprotocolofUSB(UniversalSerialBus)willbedescribed,andlater,introducedthebasicmeaningoftemperaturecontrol,Thisdissertationalsobroughtforwardthisidea:todevelopthetemperaturecontrolsyste
6、mwhichisbaseontheUSB,andthosetoolsthesystemwillneedareUSBdevicechipCH372,onewiredigitaltemperaturesensorDS18B20andsinglechipAT89C51.Thetemperaturesystemgotwilluploadtotheuppercomputer'sapplicationthroughUSBinterface.Theuppercomputer'sapplicationisprogrammedinth
7、eenvironmentofC++builder;thesoftwareIprogrammedusedtheDLL(dynamiclinklibrary)ofCH372andbuiltthecommunicationsystembetweenuppercomputeranddowncomputer.Theuppercomputerwilldisplaythetemperaturegotbythesensor,anddisplaythedataonthescreenofthePC,anddisplaythetemper
8、atureacquisitiongraphicssimultaneously.Besides,theapplicationsontheuppercomputercancontrolthedowncomputertosetthetemperaturelimits,thingslikethis,whenthetemperatureexceedate