




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、the design of embedded mcu network measure andcontrol systemgao guanwang, wang yanpeng, sha zhanyoucollege of information science and engineering,hebei university of science and technology, ,shijiazhuang hebei, chinaabstractthis paper introduces a type of embedded mcu network measure and control sys
2、tem based on ethernet, which adopts high speed mcu with kernel of 8052. through controlling the special chip for ethernet, the system realized the function of tcp/ip protocol. since the system can be used as a independent system, any computer on the net can control the system or transmit order and d
3、ata to the system through standard tcp/ip protocol. equipped the system by digital temperature sensor, it can be used to measure industry field temperature and transmit the results to computer through network, and then get temperature curve. and its measure and control range are all -10125,the accur
4、acy is, the resolution reaches 0.1. this system have many advantages such as simple structure,better universal, communicating through network, flexible usage, low cost etc. it can be adapted by various of intelligent sensor and has better extend ability. it can be used in the fields of remote data a
5、cquisition, remote measurement and control and so on.keywords: embedded mcu network measure and control system; ethernet; system parameter; digital temperature sensor.1.introductionthe development history of the measure and control system experienced six phases in the following. (1)the traditional c
6、ontrol system consists of mcu, pc or ipc. (2) the measurement and control system based on pc bus. (3) distributed control system (dcs). (4) dcs system based on lan. (5) hart bus which is developed by the 2-wire 4ma 20ma standard signal, and is a kind of fieldbus used between the intelligent field eq
7、uipment and automatic control equipment. (6) since 90s of the 20th century, with the rapid development of the internet, it becomes possible that more quickly, more convenient and more economical gaining and exchanging information. so measurement and control system can become the client of the global
8、 network. at present, the remote control system based on internet is driving the development of measurement and control technology, and has been applied in monitor fields of the nuclear power station, the oil transport pipeline, the power networks run and robot. the remote control system based on in
9、ternet has advantage of the quick information transfer, strong interactivity and low cost, while it can achieve data sharing.the existing network control equipment use mostly modem chip, with the ppp protocol dialing to the internet or special network by telephone network. although this method can r
10、ealize the network control and data transmission, it depends on the telephone, make its use cost increase significantly. additionally, transmission speed is no more than several hundreds kbps (usually only a few tens kbps or lower) because of the limit of telephone network, and it is not adequate fo
11、r the needs of large quantities of data transmission. therefore, the network measurement and control technology based on ethernet get more and more important. the ethernet is a widely used lan standard, which can be defined by ieee-802.3 standard, and it can support 10mbps, 100mbps, or 1000mbps band
12、width, often with twisted-pair cable or fiber as the transmission medium. its characteristic is the low price, mature technology, flexible application.2.design scheme of edesign plandesign plandesign plandesign plandesign planmbedded microcontroller network systemit is a type of embedded mcu measure
13、 and control system based on ethernet network system, using a microprocessor with 8052 as kernel. it realized common arp, ip, icmp, tcp and udp protocol part function of tcp/ip on ethernet by controlling rtl8019as which is a special ethernet chip. it can be used as an independent system on ethernet
14、network. any computer on ethernet can visit the system via the standard tcp/ip protocol, transport control commands or data among them. the system function has the following characteristics: (1) the simple structure; (2) with low cost, it is convenient to apply in many nodes; (3) strong adaptation c
15、an be used with various equipment; (4)it can communicate through the internet. this system used serial interface for data acquisition, it can adapt all kinds of intelligent sensor and has strong ability of expansion, and can be widely used in remote data acquisition, remote control, etc. the circuit
16、 diagram and the system program flowchart of embedded microcontroller network system are respectively shown in figure 1, figure 2in order to realize the standard tcp/ip protocol with microcontroller, winbond company w78e58 mcu production is used as main control chip in the circuit design. the w78e58
17、 mcu can meet the following three conditions: the first, it is compatible with mcs - 51 series microcontroller, the second, the internal program memory is 32kb, and it is enough to write into a large program, the third, fast clock frequency can reach the 40mhz level.figure 1. circuit block diagram o
18、f embedded c network systemthe w78e58 as the center, along with the direction of data transmission, it can constitute two main function modules: one is data acquisition channel, which is connected the w78e58 serial input/output port via max232 interface chip, the two is finishing read and write oper
19、ations or control to ethernet interface chip and 32kb external ram (62256) via w78e58 p0 port and p2 port. so sensors (or controller) data or control signal come from the network was first ethernet chip received, and then sent to the w78e58 mcu for data processing , then transport to 89c51 mcu from
20、the serial port, the 89c51 package the data into standard tcp/ip packets, then send to remote host. to adapt the network system to different sensors and web host, the syetem connected with a 2kbit external flash memory at24c02 in addition, which was used to store the system parameters such as ip add
21、ress, port, serial port setting and so on.figure 2. system program flow diagramthe two light-emitting diodes are connected to the two serial port data lines to indicate serial data status.3.embedded microcontroller network system circuit designnetwork sensor adopts the american dallas company ds1821
22、 1-wire programmable digital temperature sensor. mcu adopts atmel company at89c51 microcontroller, which is fully compatible with mcs - 51 series microcontroller. it has 4kb flash program memory to store users program avoid extending external program memory. in order to adapt embedded microcontrolle
23、r network system, it receives control commands, data, and transmits the values of temperature and states through serial port. serial port level transition chip uses maxim company max232 chip.the ds1821 has two operating modes: 1-wire mode and thermostat mode. the 1-wire mode is fit asdigital thermom
24、eter or temperature measuring system; in thermostat mode, user need to program toconstitute the temperature control system. two working mode can transform each other. the at89c51chip converts control commands and data received by serial port into 1-wire signal for ds1821 , thensend to ds1821, thus i
25、t accomplished control ds1821. the ds1821 return 1-wire signal of status value or temperature value. the at89c51 recognise and convert these signal and send out from the serial port.the w78e58 microcontroller uses 22.1184 mhz crystal oscillator, as figure 3 shows. the power-up reset circuit composed
26、 by c1 and r3. the preset switch s1-1 is used to set entering setting status or normal working status when the system power up. the p1.5 (net label reset) connects to reset pin of network card, and accomplishes the reset funtion to the network card.figure 3. w78e58 mcu circuit diagramthe ram memory
27、62256 connects to mcu with typical circuit. the 74hc373 is used to latch the low 8 bits address bus. the 62256 address range is 0x0000 0x7fff. the sda and scl pins on externalmemory at24c02 connect to mcu p1.7 and p1.6 pins respectively. the w78e58 software simulate thetiming of i2c bus on p1.6, p1.
28、7 pins, thus it accomplished read and write operations of at24c02. thewrite protect pin connect to low-level, does not perform the write protect. while connecting a0, a1, a2pins to gnd, read and write address is respectively 0xa1 and 0xa0. the serial interface chip max232pins of cputxd and cpurxd co
29、nnect to mcu pins of txd and , rxd respectively.this system can use any isa interface network card which is compatible with ne2000. the newnetwork card can be set with their own set program on computers in order to meet the basic requirementsof the embedded network system. the specific procedures ar
30、e as follows:(1) enter into the ms-dos operating systems, run network card set program.(2) according to the table 1 set the network card.(3) choose yes to exit the setting program and these settings take effect. pull out this card from thecomputer, insert it into the system board.4.system parameters
31、 custom settingsthe network system provides custom function of initialization parameters. the user can flexibly andconveniently set all system initialization parameters by using super system tool of windows operatingsystem.firstly, connect the system serial port to a computer serial port, here is co
32、m2. from the “start” menu,select program -attachment -communication, lauch hyper system, and there is a connectiondescribe dialog box, waiting to input a connection name, enter setup and click the ok. then a “connect to” window appears, at connection with place, choose com2 which is connection port
33、between system and computer and click ok. then set the communication parameters for com2 in com2 attribute setting window. click ok to enter the hyper system main interface.in order to get better result in the process of configuration parameters, it is necessary to set “hypersystem”more detailedly.
34、click properties button on the toolbar, open “properties” dialog box. choosesettings, click ascii code set button in ascii settings window. after finishing these settings thesystem return to main interface, hyper system in a waiting connection status.put preset switch s1-1 to off position, the green
35、 light display serial port data transmission and thered light display the network data transmission.5 the program design essential and application of network sense systemmcu accomplish writing and reading data to ds1821 with timing. the timing transmits data bits andcommand word decided which kind o
36、f operation is needed5.1.write timingthe mcu pull i/o pin (1-wire bus) from high level to low level as a start of of writing cycle. writetiming includes two types: write “1” timing and write “0” timing. the time keep at least 60us, there is 1s restore time between two write cycles at least.ds1821 ta
37、ke a sampling in 15s-60s time after the i/o line change into a low level. if i/o line ishigh level that one bit “1” is writed, if i/o line is low level that one bit “0” is writed. write timingwaveform is shown in figure 4.when the mcu begin writing “1” cycle, must pull i/o line to low level and then
38、 release, pull into ahigh level in the 15s time. when the mcu begin writing “0” cycle, should also pull i/o line into lowlevel, and maintain 60s time.figure 4. read and write cycle waveform a) write cycle b) read cycle5.2.read timingwhen the mcu pull i/o line from high level to low level, the read c
39、ycle will begin, and i/o line remainlow level time for 1s at least. the ds1821 output data take effect within 15s after read timing fallingedge appear. during this time, the mcu should release the i/o line, so that it is in input status to read data.the read timing end after 15s, owe to the external
40、 pull-up resistors , the i/o line become high level againread a bit data need at least 60 s time, there is at leas 1s restore time between two bit dada.readingtiming waveform is shown in figure 4b.use the temperature control system to measure certain industrial field temperature, then transmit dadat
41、o the computer by the network, eventually obtaining temperature curve is shown in figure 5.figure 5. temperature curveconclusionnetwork measure and control technology play an important role in industrial system. ethernet is a lanstandard used widely, which is defined by ieee802.3, can support 10mbps
42、, 100mbps and 1000mbpsbandwidth, often use twisted-pair cable or fiber as the transmission medium. its characteristic is the lowprice, mature technology and flexible application.embedded microcontroller network measure and control system based on ethernet has thecharacteristic of advanced performanc
43、e, flexible application and low cost etc, so that the system can begeneralize and apply.嵌入式單片機網(wǎng)絡(luò)測控系統(tǒng)的設(shè)計沙占友河北科技大學(xué)信息學(xué)院,河北石家莊 050054摘要介紹一種基于以太網(wǎng)的嵌入式單片機網(wǎng)絡(luò)測控系統(tǒng),它采用具有8052內(nèi)核的高速單片機,通過對專用以太網(wǎng)芯片的控制,在以太網(wǎng)上實現(xiàn)了tcp/ip協(xié)議的功能,可作為以太網(wǎng)的一個獨立系統(tǒng),網(wǎng)絡(luò)上的任何一臺計算機都可通過標準的tcp/ip協(xié)議對其進行控制,傳輸控制命令或數(shù)據(jù)。將該網(wǎng)絡(luò)測控系統(tǒng)配上數(shù)字溫度傳感器后實際測量工業(yè)現(xiàn)場溫度,然后通過網(wǎng)絡(luò)傳輸
44、給計算機,可獲得溫度曲線,其測溫范圍與控溫范圍均為-10+125,測溫精度為,分辨率達0.1。該系統(tǒng)具有結(jié)構(gòu)簡單、通用性強、通過internet進行通信、使用靈活、成本低等優(yōu)點,適配多種智能傳感器并具有較強的擴展能力,適用于遠程數(shù)據(jù)采集、遠程測控等領(lǐng)域。關(guān)鍵詞:嵌入式單片機網(wǎng)絡(luò)測控系統(tǒng);以太網(wǎng);系統(tǒng)參數(shù);設(shè)置;數(shù)字溫度傳感器1 引言測控系統(tǒng)的發(fā)展歷史大致經(jīng)歷了以下6個階段:以單片機、pc機或工控機為核心而構(gòu)成傳統(tǒng)的測控系統(tǒng);由pc機總線構(gòu)成的測控系統(tǒng)由多臺微處理機組成的集散控制系統(tǒng)(tdcs)基于lan的tdcs系統(tǒng)由兩線制4ma-20ma標準信號發(fā)展起來的、用在智能化現(xiàn)場設(shè)備與自運控制設(shè)備之
45、間的現(xiàn)場總線hart總線20世紀90年代以來,隨著因特網(wǎng)的高速發(fā)展,使得更快捷、更方便、更經(jīng)濟地獲取并交流信息成為可能,測控系統(tǒng)也因此而變成這種全球化網(wǎng)絡(luò)的客戶端。目前,基于internet的遠程測控系統(tǒng)正推動著測控技術(shù)的發(fā)展,并在核電站監(jiān)控、室友輸送管道的遠程監(jiān)測、并網(wǎng)運行監(jiān)控和機器人的遠程控制等領(lǐng)域得到了應(yīng)用?;趇nternet的遠程測控系統(tǒng)具有信息傳遞快捷、交互性強、經(jīng)濟方便等特點,能實現(xiàn)數(shù)據(jù)共享。現(xiàn)有的網(wǎng)絡(luò)測控設(shè)備大多采用modem芯片,是通過電話網(wǎng)用的ppp協(xié)議撥號到internet或?qū)S镁W(wǎng)絡(luò)的。這種方法雖然可以實現(xiàn)網(wǎng)絡(luò)控制與數(shù)據(jù)傳輸,但它依賴于電話網(wǎng),使其使用成本也顯著提高。另外
46、手電話網(wǎng)的限制,其傳輸速率最高只可能達到幾百kbps(通常只有幾十kbps甚至更低),難以滿足大量數(shù)據(jù)傳輸?shù)男枰R虼?,基于以太網(wǎng)的網(wǎng)絡(luò)測控技術(shù)也為人們所重視。以太網(wǎng)是一種應(yīng)用廣泛的局域網(wǎng)標準,它由ieee-802.3所定義,可支持10mbps100mbps或1000mbps帶寬,常以雙絞線或光纖作為傳輸介質(zhì)。其特點是價格經(jīng)濟,技術(shù)成熟,應(yīng)用靈活。2 嵌入式單片機網(wǎng)絡(luò)系統(tǒng)的設(shè)計方案一種基于以太網(wǎng)的嵌入式單片機網(wǎng)絡(luò)測控系統(tǒng),采用具有8052內(nèi)核的高速單片機,通過對專用以太網(wǎng)芯片rtl8019as的控制,在以太網(wǎng)上實現(xiàn)了tcp/ip中常用的arp、ip、icmp、udp等協(xié)議的部分功能。它完全可作
47、為以太網(wǎng)的一個獨立系統(tǒng),網(wǎng)絡(luò)上的任何一臺計算機都可通過標準的tcp/ip協(xié)議對其進行控制,在它們直徑傳輸命令或數(shù)據(jù)。該系統(tǒng)在功能上有以下特定:結(jié)構(gòu)簡單,使用靈活;成本低,便于大規(guī)模及多通路應(yīng)用;適配性強,可配合多種系統(tǒng)設(shè)備使用;internet進行通信。該系統(tǒng)采用串口作為與數(shù)據(jù)采集部分的接口,適配多種智能傳感器并具有較強的擴張能力,可防范用于遠程數(shù)據(jù)采集、遠程測控等領(lǐng)域。嵌入式單片機網(wǎng)絡(luò)系統(tǒng)的電路寬途和系統(tǒng)的程序流程圖分別如圖1、圖2所示。為了在單片機上實現(xiàn)標準的tcp/ip協(xié)議,在電路設(shè)計上采用了華邦公司生產(chǎn)的w78e58單片機作為主控芯片。w78e58單片機能滿足以下三個條件:第一,與mc
48、s-51系列單片機兼容;第二,內(nèi)部有較大的程序存儲空間(32kb),免去了因程序過大而無法寫入的后顧之憂;第三,運行速度快(最高時鐘頻率可達40mhz)。以w78e58為核心,沿著數(shù)據(jù)傳遞的方向向向兩側(cè)延伸,可以構(gòu)成兩個主要的功能模塊:一是從w78e58的p0和p2口,對以太網(wǎng)接口芯片卡及32kb的外部kam(62256)。進行讀、寫操作或控制。這樣從網(wǎng)絡(luò)上發(fā)送來的傳感器(或控制器)的數(shù)據(jù)或控制型號首先被以太網(wǎng)芯片接受,再送至w78e58單片機進行處理,然后從串行口輸出到89c51單片機,89c51單片機將其打包成標準的tcp/ip數(shù)據(jù)包,再發(fā)送到遠程主機。為使網(wǎng)絡(luò)系統(tǒng)能與不同的傳感器及網(wǎng)上主
49、機相匹配,還外接一片2kbit的閃速存儲器at24c02,用來存放ip地址、端口、串行口設(shè)置等系統(tǒng)參數(shù)。圖 嵌入式單片機網(wǎng)絡(luò)系統(tǒng)的電路框圖在串口的兩條數(shù)據(jù)線上接上了兩只發(fā)光二級管,用來指示串口是否有數(shù)據(jù)。圖 系統(tǒng)的程序流程圖3 嵌入式單片機網(wǎng)絡(luò)系統(tǒng)的電路設(shè)計網(wǎng)絡(luò)傳感器采用美國dallas公司最新推出的ds1821型單線可編程數(shù)字溫度傳感器。單片機選用單片機完全兼容,內(nèi)含4kbflash程序存儲器,可方便地將程序?qū)懭胄酒?,不用外擴程序存儲器。為了能和嵌入式單片機網(wǎng)絡(luò)系統(tǒng)相配合,現(xiàn)通過串行口輸入控制命令、數(shù)據(jù),輸出溫度及狀態(tài)值。串口電平轉(zhuǎn)換芯片選擇maxim公司的max232.ds1821有兩種工作模式:單線模式和自動控溫模式。選擇單線模式適合構(gòu)成數(shù)字溫度計或測溫系統(tǒng);若選用自控模式,用戶就必須預(yù)先對芯片進行編程后才能構(gòu)成溫控系統(tǒng)。兩種工作模式可互相轉(zhuǎn)換。利用at89c51單片機把串行口發(fā)來的控制命令、數(shù)據(jù)轉(zhuǎn)換成ds1821可以識別的單線信號,再發(fā)送到ds1821,對其進行編程控制,將ds1821以單線訪問的第狀態(tài)值或溫度值進行識別轉(zhuǎn)換,最后從串行口發(fā)送出去。w78e58單片機采用22.1184mhz的石英晶體
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- T-ZSA 278-2024 軌道交通.用銑磨機器人
- 2025年度高新技術(shù)企業(yè)員工離職競業(yè)限制補償金合同
- 二零二五年度教育行業(yè)人才招聘定金協(xié)議
- 二零二五年度金融機構(gòu)間反洗錢合作協(xié)議
- 2025年度金融項目評審合同風(fēng)險控制
- 二零二五商場合同管理操作手冊附小時計費服務(wù)條款
- 2025年度環(huán)保產(chǎn)業(yè)合作開發(fā)合伙協(xié)議書
- 二零二五年度供用熱力合同糾紛司法解釋及執(zhí)行難點解析
- 二零二五年度超市促銷活動商品陳列策劃合同
- 2025沈陽公司總經(jīng)理聘用合同全面規(guī)范管理細則
- 醫(yī)務(wù)人員醫(yī)德醫(yī)風(fēng)培訓(xùn)
- 人教版初中歷史八上-第2課 第二次鴉片戰(zhàn)爭
- 黑龍江省哈爾濱市2024年高三一模試題(數(shù)學(xué)試題理)試題
- 全國計算機等級考試一級試題及答案(5套)
- 公司安全事故隱患內(nèi)部舉報、報告獎勵制度
- 產(chǎn)品方案設(shè)計模板
- 部隊通訊員培訓(xùn)
- 2024-2030年中國企業(yè)在安哥拉投資建設(shè)化肥廠行業(yè)供需狀況及發(fā)展風(fēng)險研究報告版
- 物業(yè)公司水浸、水管爆裂事故應(yīng)急處置預(yù)案
- 河南省公務(wù)員面試真題匯編7
- SF-T0095-2021人身損害與疾病因果關(guān)系判定指南
評論
0/150
提交評論