外文翻譯---嵌入式單片機(jī)網(wǎng)絡(luò)測(cè)控系統(tǒng)的設(shè)計(jì)_第1頁
已閱讀1頁,還剩14頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、<p>  The Design of Embedded MCU Network Measure and</p><p>  Control System</p><p>  GAO Guanwang, WANG Yanpeng, SHA Zhanyou</p><p>  College of Information Science and Engine

2、ering,Hebei University of Science and Technology, ,Shijiazhuang Hebei, China</p><p><b>  Abstract</b></p><p>  This paper introduces a type of embedded MCU network measure and contro

3、l system 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 indep

4、endent system, any computer on the net can control the system or transmit order and data to the system through standard TCP/IP protocol. Equipped the system by digital temperature sensor, it can be used to mea</p>

5、<p>  Keywords: Embedded MCU Network Measure and Control System; Ethernet; System parameter; Digital Temperature Sensor.</p><p>  1.Introduction</p><p>  The development history of the mea

6、sure and control system experienced six phases in the following. (1)The traditional control system consists of MCU, PC or IPC. (2) The measurement and control system based on PC bus. (3) Distributed Control System (DCS).

7、 (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 equipment and automatic control equipment. (6) Since 90

8、s of the 20th century, wit</p><p>  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 c

9、an realize 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

10、 kbps or lower) because of the limit of telephone network, and it is not adequate for the needs of large quan</p><p>  2.Design Scheme of Edesign Plandesign Plandesign Plandesign Plandesign Planmbedded Micro

11、controller Network System</p><p>  It is a type of embedded MCU measure and control system based on Ethernet network system, using a microprocessor with 8052 as kernel. It realized common ARP, IP, ICMP, TCP

12、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 network. Any computer on Ethernet can visit the system v

13、ia the standard TCP/IP protocol, transport control commands or data among them. The system function has the </p><p>  In order to realize the standard TCP/IP protocol with microcontroller, Winbond Company W7

14、8E58 MCU production is used as main control chip in the circuit design. The W78E58 MCU can meet the following three conditions: the first, it is compatible with MCS - 51 series microcontroller, the second, the internal p

15、rogram memory is 32KB, and it is enough to write into a large program, the third, fast clock frequency can reach the 40MHz level.</p><p>  Figure 1. circuit block diagram of embedded C network system</p&g

16、t;<p>  The 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

17、 via MAX232 interface chip, the Two is finishing read and write operations 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 si

18、gnal come from the network was first Ethernet chip received, and then sent </p><p>  Figure 2. system program flow diagram</p><p>  The two light-emitting diodes are connected to the two serial

19、port data lines to indicate serial data status.</p><p>  3.Embedded Microcontroller Network System Circuit Design</p><p>  Network sensor adopts the American DALLAS company DS1821 1-wire program

20、mable 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 user’s program avoid extending

21、external program memory. In order to adapt embedded microcontroller network system, it receives control commands, data, and transmits the values of temperature and states through serial port. Serial port level</p>

22、<p>  The DS1821 has two operating modes: 1-Wire mode and thermostat mode. The 1-Wire mode is fit as</p><p>  digital thermometer or temperature measuring system; in thermostat mode, user need to progr

23、am to</p><p>  constitute the temperature control system. Two working mode can transform each other. The AT89C51</p><p>  chip converts control commands and data received by serial port into 1-w

24、ire signal for DS1821 , then</p><p>  send to DS1821, thus it accomplished control DS1821. The DS1821 return 1-wire signal of status value or temperature value. The AT89C51 recognise and convert these signal

25、 and send out from the serial port.</p><p>  The W78E58 microcontroller uses 22.1184 MHz crystal oscillator, as figure 3 shows. The power-up reset circuit composed by C1 and R3. The preset switch S1-1 is use

26、d 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.</p><

27、;p>  Figure 3. W78E58 MCU circuit diagram</p><p>  The RAM memory 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~ 0x

28、7FFF. The SDA and SCL pins on external</p><p>  memory AT24C02 connect to MCU P1.7 and P1.6 pins respectively. The W78E58 software simulate the</p><p>  timing of I2C bus on P1.6, P1.7 pins, thu

29、s it accomplished read and write operations of AT24C02. The</p><p>  write protect pin connect to low-level, does not perform the write protect. While connecting A0, A1, A2</p><p>  pins to GND,

30、 read and write address is respectively 0xA1 and 0xA0. The serial interface chip MAX232</p><p>  pins of CPUTXD and CPURXD connect to MCU pins of TXD and , RXD respectively.</p><p>  This system

31、 can use any ISA interface network card which is compatible with NE2000. The new</p><p>  network card can be set with their own set program on computers in order to meet the basic requirements</p>&l

32、t;p>  of the embedded network system. The specific procedures are as follows:</p><p>  (1) Enter into the ms-dos operating systems, run network card set program.</p><p>  (2) According to the

33、 table 1 set the network card.</p><p>  (3) Choose "YES" to exit the setting program and these settings take effect. Pull out this card from the</p><p>  computer, insert it into the s

34、ystem board.</p><p>  4.System Parameters Custom Settings</p><p>  The network system provides custom function of initialization parameters. The user can flexibly and</p><p>  conve

35、niently set all system initialization parameters by using "super system" tool of Windows operating</p><p><b>  system.</b></p><p>  Firstly, connect the system serial port

36、to a computer serial port, here is COM2. From the “start” menu,</p><p>  select "program" -"attachment" -"communication", lauch hyper system, and there is a "connection<

37、/p><p>  describe " dialog box, waiting to input a connection name, enter "setup" and click the "ok". </p><p>  Then a “connect to” window appears, at "connection with

38、" place, choose COM2 which is connection port between system and computer and click "ok". Then set the communication parameters for COM2 in "COM2 attribute" setting window. Click "ok" t

39、o enter the hyper system main interface.</p><p>  In order to get better result in the process of configuration parameters, it is necessary to set “hyper</p><p>  system”more detailedly. Click &

40、quot;properties" button on the toolbar, open “properties” dialog box. Choose</p><p>  "Settings", click "ASCII code set" button in ASCII Settings window. After finishing these settin

41、gs the</p><p>  system return to main interface, "hyper system" in a waiting connection status.</p><p>  Put preset switch S1-1 to "OFF" position, the green light display ser

42、ial port data transmission and the</p><p>  red light display the network data transmission.</p><p>  5 The Program Design Essential and Application Of Network Sense System</p><p> 

43、 MCU accomplish writing and reading data to DS1821 with timing. The timing transmits data bits and</p><p>  command word decided which kind of operation is needed</p><p>  5.1.Write timing</p

44、><p>  The MCU pull I/O pin (1-wire bus) from high level to low level as a start of of writing cycle. Write</p><p>  timing includes two types: write “1” timing and write “0” timing. The time keep

45、at least 60us, there is 1s restore time between two write cycles at least.</p><p>  DS1821 take a sampling in 15s-60s time after the I/O line change into a low level. If I/O line is</p><p>  hig

46、h level that one bit “1” is writed, if I/O line is low level that one bit “0” is writed. Write timing</p><p>  waveform is shown in figure 4.</p><p>  When the MCU begin writing “1” cycle, must

47、pull I/O line to low level and then release, pull into a</p><p>  high level in the 15s time. When the MCU begin writing “0” cycle, should also pull I/O line into low</p><p>  level, and maintai

48、n 60s time.</p><p>  Figure 4. read and write cycle waveform a) write cycle b) read cycle</p><p>  5.2.Read timing</p><p>  When the MCU pull I/O line from high level to low level,

49、the read cycle will begin, and I/O line remain</p><p>  low level time for 1s at least. The DS1821 output data take effect within 15s after read timing falling</p><p>  edge appear. During this

50、time, the MCU should release the I/O line, so that it is in input status to read data.</p><p>  The read timing end after 15s, owe to the external pull-up resistors , the I/O line become high level again<

51、/p><p>  Read a bit data need at least 60 s time, there is at leas 1s restore time between two bit dada.Reading</p><p>  timing waveform is shown in figure 4b.</p><p>  Use the tempera

52、ture control system to measure certain industrial field temperature, then transmit dada</p><p>  to the computer by the network, eventually obtaining temperature curve is shown in figure 5.</p><p&

53、gt;  Figure 5. temperature curve</p><p>  Conclusion</p><p>  Network measure and control technology play an important role in industrial system. Ethernet is a LAN</p><p>  standard

54、 used widely, which is defined by IEEE802.3, can support 10Mbps, 100Mbps and 1000Mbps</p><p>  bandwidth, often use twisted-pair cable or fiber as the transmission medium. Its characteristic is the low</p

55、><p>  price, mature technology and flexible application.</p><p>  Embedded microcontroller network measure and control system based on Ethernet has the</p><p>  characteristic of adva

56、nced performance, flexible application and low cost etc, so that the system can be</p><p>  generalize and apply.</p><p>  嵌入式單片機(jī)網(wǎng)絡(luò)測(cè)控系統(tǒng)的設(shè)計(jì)</p><p><b>  沙占友</b></p>

57、<p>  河北科技大學(xué)信息學(xué)院,河北石家莊 050054</p><p><b>  摘要</b></p><p>  介紹一種基于以太網(wǎng)的嵌入式單片機(jī)網(wǎng)絡(luò)測(cè)控系統(tǒng),它采用具有8052內(nèi)核的高速單片機(jī),通過對(duì)專用以太網(wǎng)芯片的控制,在以太網(wǎng)上實(shí)現(xiàn)了TCP/IP協(xié)議的功能,可作為以太網(wǎng)的一個(gè)獨(dú)立系統(tǒng),網(wǎng)絡(luò)上的任何一臺(tái)計(jì)算機(jī)都可通過標(biāo)準(zhǔn)的TCP/IP協(xié)議對(duì)其進(jìn)

58、行控制,傳輸控制命令或數(shù)據(jù)。將該網(wǎng)絡(luò)測(cè)控系統(tǒng)配上數(shù)字溫度傳感器后實(shí)際測(cè)量工業(yè)現(xiàn)場(chǎng)溫度,然后通過網(wǎng)絡(luò)傳輸給計(jì)算機(jī),可獲得溫度曲線,其測(cè)溫范圍與控溫范圍均為-10℃~+125℃,測(cè)溫精度為℃,分辨率達(dá)0.1℃。該系統(tǒng)具有結(jié)構(gòu)簡(jiǎn)單、通用性強(qiáng)、通過Internet進(jìn)行通信、使用靈活、成本低等優(yōu)點(diǎn),適配多種智能傳感器并具有較強(qiáng)的擴(kuò)展能力,適用于遠(yuǎn)程數(shù)據(jù)采集、遠(yuǎn)程測(cè)控等領(lǐng)域。</p><p>  關(guān)鍵詞:嵌入式單片機(jī)網(wǎng)絡(luò)測(cè)控

59、系統(tǒng);以太網(wǎng);系統(tǒng)參數(shù);設(shè)置;數(shù)字溫度傳感器</p><p><b>  1 引言</b></p><p>  測(cè)控系統(tǒng)的發(fā)展歷史大致經(jīng)歷了以下6個(gè)階段:①以單片機(jī)、PC機(jī)或工控機(jī)為核心而構(gòu)成傳統(tǒng)的測(cè)控系統(tǒng);②由PC機(jī)總線構(gòu)成的測(cè)控系統(tǒng)③由多臺(tái)微處理機(jī)組成的集散控制系統(tǒng)(TDCS)④基于LAN的TDCS系統(tǒng)⑤由兩線制4mA-20mA標(biāo)準(zhǔn)信號(hào)發(fā)展起來的、用在智能化現(xiàn)場(chǎng)設(shè)

60、備與自運(yùn)控制設(shè)備之間的現(xiàn)場(chǎng)總線—HART總線⑥20世紀(jì)90年代以來,隨著因特網(wǎng)的高速發(fā)展,使得更快捷、更方便、更經(jīng)濟(jì)地獲取并交流信息成為可能,測(cè)控系統(tǒng)也因此而變成這種全球化網(wǎng)絡(luò)的客戶端。目前,基于Internet的遠(yuǎn)程測(cè)控系統(tǒng)正推動(dòng)著測(cè)控技術(shù)的發(fā)展,并在核電站監(jiān)控、室友輸送管道的遠(yuǎn)程監(jiān)測(cè)、并網(wǎng)運(yùn)行監(jiān)控和機(jī)器人的遠(yuǎn)程控制等領(lǐng)域得到了應(yīng)用。基于Internet的遠(yuǎn)程測(cè)控系統(tǒng)具有信息傳遞快捷、交互性強(qiáng)、經(jīng)濟(jì)方便等特點(diǎn),能實(shí)現(xiàn)數(shù)據(jù)共享。<

61、/p><p>  現(xiàn)有的網(wǎng)絡(luò)測(cè)控設(shè)備大多采用MODEM芯片,是通過電話網(wǎng)用的PPP協(xié)議撥號(hào)到Internet或?qū)S镁W(wǎng)絡(luò)的。這種方法雖然可以實(shí)現(xiàn)網(wǎng)絡(luò)控制與數(shù)據(jù)傳輸,但它依賴于電話網(wǎng),使其使用成本也顯著提高。另外手電話網(wǎng)的限制,其傳輸速率最高只可能達(dá)到幾百Kbps(通常只有幾十kbps甚至更低),難以滿足大量數(shù)據(jù)傳輸?shù)男枰R虼?,基于以太網(wǎng)的網(wǎng)絡(luò)測(cè)控技術(shù)也為人們所重視。以太網(wǎng)是一種應(yīng)用廣泛的局域網(wǎng)標(biāo)準(zhǔn),它由IEEE-80

62、2.3所定義,可支持10Mbps\100Mbps或1000Mbps帶寬,常以雙絞線或光纖作為傳輸介質(zhì)。其特點(diǎn)是價(jià)格經(jīng)濟(jì),技術(shù)成熟,應(yīng)用靈活。</p><p>  2 嵌入式單片機(jī)網(wǎng)絡(luò)系統(tǒng)的設(shè)計(jì)方案</p><p>  一種基于以太網(wǎng)的嵌入式單片機(jī)網(wǎng)絡(luò)測(cè)控系統(tǒng),采用具有8052內(nèi)核的高速單片機(jī),通過對(duì)專用以太網(wǎng)芯片RTL8019AS的控制,在以太網(wǎng)上實(shí)現(xiàn)了TCP/IP中常用的ARP、IP、I

63、CMP、UDP等協(xié)議的部分功能。它完全可作為以太網(wǎng)的一個(gè)獨(dú)立系統(tǒng),網(wǎng)絡(luò)上的任何一臺(tái)計(jì)算機(jī)都可通過標(biāo)準(zhǔn)的TCP/IP協(xié)議對(duì)其進(jìn)行控制,在它們直徑傳輸命令或數(shù)據(jù)。該系統(tǒng)在功能上有以下特定:①結(jié)構(gòu)簡(jiǎn)單,使用靈活;②成本低,便于大規(guī)模及多通路應(yīng)用;③適配性強(qiáng),可配合多種系統(tǒng)設(shè)備使用;Internet進(jìn)行通信。該系統(tǒng)采用串口作為與數(shù)據(jù)采集部分的接口,適配多種智能傳感器并具有較強(qiáng)的擴(kuò)張能力,可防范用于遠(yuǎn)程數(shù)據(jù)采集、遠(yuǎn)程測(cè)控等領(lǐng)域。</p>

64、;<p>  嵌入式單片機(jī)網(wǎng)絡(luò)系統(tǒng)的電路寬途和系統(tǒng)的程序流程圖分別如圖1、圖2所示。為了在單片機(jī)上實(shí)現(xiàn)標(biāo)準(zhǔn)的TCP/IP協(xié)議,在電路設(shè)計(jì)上采用了華邦公司生產(chǎn)的W78E58單片機(jī)作為主控芯片。W78E58單片機(jī)能滿足以下三個(gè)條件:第一,與MCS-51系列單片機(jī)兼容;第二,內(nèi)部有較大的程序存儲(chǔ)空間(32KB),免去了因程序過大而無法寫入的后顧之憂;第三,運(yùn)行速度快(最高時(shí)鐘頻率可達(dá)40MHz)。以W78E58為核心,沿著數(shù)據(jù)傳

65、遞的方向向向兩側(cè)延伸,可以構(gòu)成兩個(gè)主要的功能模塊:一是從W78E58的P0和P2口,對(duì)以太網(wǎng)接口芯片卡及32KB的外部KAM(62256)。進(jìn)行讀、寫操作或控制。這樣從網(wǎng)絡(luò)上發(fā)送來的傳感器(或控制器)的數(shù)據(jù)或控制型號(hào)首先被以太網(wǎng)芯片接受,再送至W78E58單片機(jī)進(jìn)行處理,然后從串行口輸出到89C51單片機(jī),89C51單片機(jī)將其打包成標(biāo)準(zhǔn)的TCP/IP數(shù)據(jù)包,再發(fā)送到遠(yuǎn)程主機(jī)。為使網(wǎng)絡(luò)系統(tǒng)能與不同的傳感器及網(wǎng)上主機(jī)相匹配,還外接一片2Kb

66、it的閃速存儲(chǔ)器AT24C02,用來存放IP地址、端口、串行口設(shè)置等系統(tǒng)參數(shù)。</p><p>  圖 1 嵌入式單片機(jī)網(wǎng)絡(luò)系統(tǒng)的電路框圖</p><p>  在串口的兩條數(shù)據(jù)線上接上了兩只發(fā)光二級(jí)管,用來指示串口是否有數(shù)據(jù)。</p><p>  圖 2 系統(tǒng)的程序流程圖</p><p>  3 嵌入式單片機(jī)網(wǎng)絡(luò)系統(tǒng)的電路設(shè)計(jì)</p&g

67、t;<p>  網(wǎng)絡(luò)傳感器采用美國DALLAS公司最新推出的DS1821型單線可編程數(shù)字溫度傳感器。單片機(jī)選用單片機(jī)完全兼容,內(nèi)含4KBFlash程序存儲(chǔ)器,可方便地將程序?qū)懭胄酒?,不用外擴(kuò)程序存儲(chǔ)器。為了能和嵌入式單片機(jī)網(wǎng)絡(luò)系統(tǒng)相配合,現(xiàn)通過串行口輸入控制命令、數(shù)據(jù),輸出溫度及狀態(tài)值。串口電平轉(zhuǎn)換芯片選擇MAXIM公司的MAX232.</p><p>  DS1821有兩種工作模式:?jiǎn)尉€模式和自

68、動(dòng)控溫模式。選擇單線模式適合構(gòu)成數(shù)字溫度計(jì)或測(cè)溫系統(tǒng);若選用自控模式,用戶就必須預(yù)先對(duì)芯片進(jìn)行編程后才能構(gòu)成溫控系統(tǒng)。兩種工作模式可互相轉(zhuǎn)換。利用AT89C51單片機(jī)把串行口發(fā)來的控制命令、數(shù)據(jù)轉(zhuǎn)換成DS1821可以識(shí)別的單線信號(hào),再發(fā)送到DS1821,對(duì)其進(jìn)行編程控制,將DS1821以單線訪問的第狀態(tài)值或溫度值進(jìn)行識(shí)別轉(zhuǎn)換,最后從串行口發(fā)送出去。</p><p>  W78E58單片機(jī)采用22.1184MHz的

69、石英晶體振蕩器,電路如圖3所示。上電復(fù)位電路由C1和R3組成。預(yù)置開關(guān)S1-1用于設(shè)定系統(tǒng)上電時(shí)進(jìn)入設(shè)置狀態(tài)還是正常工作狀態(tài)。P1.5接網(wǎng)卡的復(fù)位引腳,用于對(duì)網(wǎng)卡進(jìn)行復(fù)位。</p><p>  圖 3W78E58單片機(jī)的電路圖</p><p>  RAM存儲(chǔ)器62256使用典型的接法與單片機(jī)相連,74HC373用于對(duì)地址的低8位進(jìn)行鎖存。62256的地址為0x0000 ~0x7FFF。外部

70、存儲(chǔ)器AT24C02的SDA、SCL分別與單片機(jī)的P1.7、P1.6口線相連,通過軟件在P1.6、P1.7口線上模擬出Ⅰ2C總線的時(shí)序,對(duì)AT24C02進(jìn)行讀、寫操作,寫保護(hù)端Wb固定接低電平,不對(duì)其進(jìn)行寫保護(hù)。將A0、A1、A2端都接地時(shí),讀、寫地址分別為:0xA1、0xA0。串行接口芯片MAX232的CPUTXD、CPURXD引腳, 分別接單片機(jī)的TXD、RXD引腳。</p><p>  該系統(tǒng)可使用任何一種

71、與NE2000兼容的ISA接口網(wǎng)卡。新網(wǎng)卡可在計(jì)算機(jī)上用其自帶的設(shè)置程序進(jìn)行基本設(shè)置,以滿足嵌入式網(wǎng)絡(luò)系統(tǒng)的要求。具體操作步驟如下:</p><p> ?、龠M(jìn)入MS—DOS操作系統(tǒng), 運(yùn)行網(wǎng)卡設(shè)置程序。</p><p> ?、谶x擇“YES”退出網(wǎng)卡設(shè)置程序, 使所有設(shè)置生效。把該網(wǎng)卡從計(jì)算機(jī)上拔下, 插入系統(tǒng)板即可使用。按照表1對(duì)網(wǎng)卡進(jìn)行設(shè)置。</p><p>  

72、4 系統(tǒng)參數(shù)的自定義設(shè)置</p><p>  網(wǎng)絡(luò)系統(tǒng)提供了初始化參數(shù)的自定義功能,用戶只需使用Windows操作系統(tǒng)自帶的“超級(jí)系統(tǒng)”工具, 即可靈活、方便地對(duì)系統(tǒng)的各項(xiàng)初始化參數(shù)進(jìn)行合理設(shè)置。</p><p>  首先,將系統(tǒng)的串行口連接到計(jì)算機(jī)的一個(gè)串行口,這里選擇COM2。從“開始”菜單起,依次選擇“程療”→“附件”→“通信”,啟動(dòng)超級(jí)系統(tǒng),就會(huì)出現(xiàn)一個(gè)“連接說明”的對(duì)話框, 等待

73、輸入一個(gè)連接名, 這里輸入“setup”并點(diǎn)擊“確定”。</p><p>  在隨后出現(xiàn)的“連接到”窗口的“連接時(shí)使用”欄目上,選擇系統(tǒng)與計(jì)算機(jī)相連的串口COM2并點(diǎn)擊“確定”。然后對(duì)COM2的通信參數(shù)進(jìn)行設(shè)置,在“COM2屬性”設(shè)置窗口中進(jìn)行設(shè)置。點(diǎn)擊“確定”后即可進(jìn)入超級(jí)系統(tǒng)的主界面。</p><p>  5 網(wǎng)絡(luò)傳感系統(tǒng)的程序設(shè)計(jì)要點(diǎn)及應(yīng)用</p><p> 

74、 單片機(jī)通過時(shí)序(亦稱“時(shí)間片”)來寫入或讀出DS1821中的數(shù)據(jù)。時(shí)序用于傳輸數(shù)據(jù)位和指定進(jìn)行何種操作的命令字。</p><p><b>  5.1 寫時(shí)序</b></p><p>  單片機(jī)把I/O線(即單線總線:亦稱數(shù)據(jù)線) 從高電平拉成低電平時(shí), 作為一個(gè)寫周期的開始。寫時(shí)序包括兩種類型:寫1時(shí)序,寫0時(shí)序。寫1或?qū)?時(shí)序時(shí)至少要保持60μs, 在兩個(gè)寫周期之

75、間至少要有1μs的恢復(fù)期。</p><p>  圖 4 讀 /寫時(shí)序波形圖 "寫時(shí)序#讀時(shí)序</p><p>  DS1821在I/O線變?yōu)榈碗娖胶蟮?5μs~60μs的時(shí)間內(nèi)進(jìn)行采樣。若I / O線為高電平,即認(rèn)為寫入了一位1;若I/O線為低電平,即認(rèn)為寫入了一位0。寫時(shí)序的波形如圖4a所示。單片機(jī)在開始寫1周期時(shí),必須將I/O線拉成低電平,然后再釋放,15μs內(nèi)將I/O線拉成

76、高電平。單片機(jī)在開始寫0周期時(shí),也應(yīng)將I/O線拉成低電平,并保持60μs的時(shí)間。</p><p><b>  5.2 讀時(shí)序</b></p><p>  當(dāng)單片機(jī)將I / O線從高電平拉成低電平時(shí), 就作為一個(gè)讀周期的開始, 并且I / O線保持低電平的時(shí)間至少為1μs。DS1821的輸出數(shù)據(jù)在讀時(shí)序下降沿過后的15μs內(nèi)有效。在此期間, 單片機(jī)應(yīng)釋放I /O線, 使

77、之處于輸入狀態(tài)以便讀取數(shù)據(jù)。經(jīng)過15μs后讀時(shí)序結(jié)束, I / O線經(jīng)外部上拉電阻又變成高電平。讀取一位數(shù)據(jù)至少需要60μs時(shí)間, 并且在兩位數(shù)據(jù)之間至少要有1μs的恢復(fù)期。讀時(shí)序的波形如圖4b所示。使用上述溫控系統(tǒng)測(cè)量某工業(yè)現(xiàn)場(chǎng)溫度, 然后通過網(wǎng)絡(luò)傳輸給計(jì)算機(jī), 最終獲得的溫度曲線如圖5所示。該系統(tǒng)的測(cè)溫范圍與控溫范圍均為- 10~+125℃, 測(cè)溫誤差為±1℃, 分辨力為0.1℃。</p><p>

78、<b>  圖5 溫度曲線圖</b></p><p><b>  6 結(jié)束語</b></p><p>  網(wǎng)絡(luò)測(cè)控技術(shù)也為人們所重視。以太網(wǎng)是一種應(yīng)用廣泛的局域網(wǎng)標(biāo)準(zhǔn),它由IEEE—802.3所定義,可支持10Mbps、100Mbps或1000Mbps寬帶,常以雙或光纖作為傳輸介質(zhì)。其特點(diǎn)是價(jià)格經(jīng)濟(jì)、技術(shù)成熟,應(yīng)用靈活?;谝蕴W(wǎng)的嵌入式單片機(jī)網(wǎng)

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論