資源描述:
《基于rs485總線的遠(yuǎn)程測(cè)量系統(tǒng)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、摘要 RS-485總線由于采用平衡發(fā)送、差分接收的方式,以共模抑制能力強(qiáng),靈敏度高,傳輸距離遠(yuǎn),傳輸速率高的特點(diǎn)在遠(yuǎn)程通訊、遠(yuǎn)程測(cè)量中已得到廣泛應(yīng)用,尤其是在控制領(lǐng)域,將各種控制信息通過(guò)RS-485總線實(shí)現(xiàn)遠(yuǎn)距離的監(jiān)測(cè)和控制。 本文主要介紹單片機(jī)與微機(jī)通過(guò)RS-485串行總線進(jìn)行遠(yuǎn)程通信的測(cè)量系統(tǒng)的設(shè)計(jì),包括一臺(tái)PC作為主機(jī)進(jìn)行數(shù)據(jù)的處理和多個(gè)AT82S52單片機(jī)作為從機(jī)進(jìn)行實(shí)時(shí)的溫度測(cè)量,從機(jī)是由DS18B20溫度傳感器與AT89S52單片機(jī)組成一個(gè)簡(jiǎn)單、實(shí)用的實(shí)時(shí)溫度測(cè)量系統(tǒng),從機(jī)可以進(jìn)行獨(dú)立測(cè)量,并且將實(shí)時(shí)測(cè)量的溫度信息通過(guò)具有485總線接口的MAX
2、485芯片將數(shù)據(jù)傳送給主機(jī)PC機(jī)處理,以實(shí)現(xiàn)遠(yuǎn)距離的實(shí)時(shí)監(jiān)控和數(shù)據(jù)的遠(yuǎn)距離傳輸。整個(gè)系統(tǒng)設(shè)計(jì)簡(jiǎn)單、使用靈活方便、價(jià)格低廉,且能夠直接輸出數(shù)字量、因此具有很強(qiáng)的實(shí)用性。 關(guān)鍵詞:遠(yuǎn)程測(cè)量;RS-485;單片機(jī);異步通訊;DS18B20Abstract RS485busduetothesendingandreceivingbalancewaytodifferenceofcommonmoderejectioncapabilityisstrong,highsensitivity,thetransmissiondistance,thecharacteristicso
3、fhightransmissionrateinremotecommunication,remotemeasurementhasbeenwidelyused,especiallyinthecontrolfield,willallkindsofcontrolinformationthroughtheRS485busrealizingremotemonitoringandcontrol. Thispapermainlyintroducesthesingle-chipmicrocomputerandcomputerthroughtheRS485serialbusfo
4、rremotecommunicationmeasurementsystemdesign,includingaPCashostdataprocessingandmulti-AT82S52singlechipmicrocomputerasfromreal-timetemperaturemeasurementmachine,fromthemachineisthetemperaturesensorDS18B20AT89S52MCMandformasimpleandpracticalreal-timetemperaturemeasurementsystem,fromth
5、emachinemayconductindependentmeasurement,andthetemperatureoftherealtimemeasurementinformationthrougha485businterfaceoftheMAX485chipswilldatatothehostPCmachineprocessing,inordertorealizetheremotereal-timemonitoranddatatransmittedoveralongdistance.Thewholesystemdesignissimple,flexible
6、andconvenientuse,thepriceislow,andcanoutputthedigitalquantitydirectly,thereforehastheverystrongpracticability. Keywords:Remotemeasurement;RS-485;MCU;Asynchronouscommunication;DS18B20 目錄摘要iAbstractii第一章緒論11.1選題背景11.2選題意義1第二章系統(tǒng)設(shè)計(jì)的整體規(guī)劃32.1RS-485系統(tǒng)設(shè)計(jì)的要求32.2系統(tǒng)主要技術(shù)參數(shù)32.3系統(tǒng)方案的確定42.3.1溫度傳感
7、器的選擇42.3.2單片機(jī)控制器的選擇62.3.3RS485總線接口芯片選擇7第三章遠(yuǎn)程測(cè)量系統(tǒng)硬件設(shè)計(jì)93.1基于RS-485總線的硬件設(shè)計(jì)93.2RS-232C/RS-485轉(zhuǎn)換電路113.3溫度測(cè)量系統(tǒng)硬件設(shè)計(jì)123.3.1單片機(jī)控制器AT89S52123.3.2數(shù)字溫度傳感器DS18B20173.4溫度測(cè)量系統(tǒng)整體電路圖18第四章系統(tǒng)的軟件設(shè)計(jì)194.1基于RS-485總線的PC機(jī)與單片機(jī)通信的軟件設(shè)計(jì)194.1.1AT89S52串行口控制寄存器SCON和PCON194.1.2AT89S52單片機(jī)串行口的工作方式204.1.3波特率的計(jì)算214.1.4
8、基于RS-485總線的PC機(jī)與單片機(jī)通