【正文】
xx 大學(xué)學(xué)士學(xué)位論文 I 基于單片機(jī)的智能傳感器設(shè)計(jì) 摘要 隨著自動(dòng)化技術(shù)的發(fā)展和 微電子技術(shù)的進(jìn)步,以及現(xiàn)場總線技術(shù)的日益成熟,數(shù)控技術(shù)在生產(chǎn)過程中的應(yīng)用越來越廣泛,對現(xiàn)場信號的采集、傳輸和數(shù)據(jù)處理提出更高的要求。 本 論文闡述了現(xiàn)場信號通信的發(fā)展概況和智能變送器的現(xiàn)狀,分析了智能變送器的作用和工作原理,針對應(yīng)用中使用的不同的傳感器輸出不同幅值的弱直流電信號的要求,設(shè)計(jì)了智能變送器系統(tǒng)。它實(shí)現(xiàn)了弱直流電信號放大,并能根據(jù)信號的幅值大小來自動(dòng)改變放大系數(shù),提高測量靈敏度,對采樣數(shù)據(jù)處理后,既能輸出 4~ 20mA DC 標(biāo)準(zhǔn)電流信號,又能通過 RS— 485 總線與其他上位機(jī)或同位機(jī)進(jìn)行數(shù)字通信。系統(tǒng)根 據(jù)傳感器輸出的信號范圍通過編程設(shè)定由集成測量放大器 AD623 和非易失性數(shù)控電位器 X9241 組成的放大環(huán)節(jié)的增益,將弱信號放大到 0~ 5V DC,通過多通道 12 位串行 A/D 轉(zhuǎn)換器 TLC2543 進(jìn)行A/D 轉(zhuǎn)換,將采集到的數(shù)據(jù)送給單片機(jī) 80C52,由單片機(jī)進(jìn)行濾波、標(biāo)度變換等數(shù)據(jù)處理后,通過 8 位并行 D/A 轉(zhuǎn)換器 DAC0832 將數(shù)據(jù)轉(zhuǎn)換成 4~ 20mA DC信號輸出,或通過隔離后的 RS— 485 總線將數(shù)據(jù)傳送給上位機(jī)。系統(tǒng)設(shè)計(jì)有獨(dú)立的看門狗電路和 EEPROM 存儲(chǔ)器電路,提高了系統(tǒng)可靠性。系統(tǒng)軟件采用MCS— 51 單片機(jī)匯編 語言,模塊化程序設(shè)計(jì)方法,設(shè)計(jì)了儀表監(jiān)控主程序、放大器增益設(shè)定程序、 ADC 轉(zhuǎn)換和處理子程序、 DAC 轉(zhuǎn)換等子模塊,并設(shè)計(jì)了相應(yīng)的通信協(xié)議。 關(guān)鍵詞 智能變送器 ; 通信;單片機(jī);現(xiàn)場總線;測量信號 xx 大學(xué)學(xué)士學(xué)位論文 II Intelligent sensor based on singlechip design Abstract With the development of Automation and the progress of the micro electronics technology, and the mature of Field Bus, digital control technology is widely used in production process, so collection, transition and treatment of signal should meet higher requirements. This thesis is about general development of field signal munication and status of intelligent transducer, analyzes function and operation principle of intelligent transducer. The transducer is designed chiefly for different weak output signal of nonstandard sensors. It can amplify the weak signal, alter the amplification factor according to the size of the weak signal and improve system sensitivity. After sample data processed, it not only can output 4~ 20mA standard direct current, but also can municate with other puters and single chip by mean of RS—485 bus. According to the output signal range of the sensor, the system sets the gain of amplification link which is posed of AD623 and X9241 by way of program, amplifies the weak signal to DC 0~ 5V, then makes A/D transition through, multi—passages and 12bit TLC2543, brings the sampled data to single chip 89C52, filtering the data, and transferring surveyor etc ,then transits the data to 4~ 20mA DC signal by DAC0832,or sends the data to other puters through isolated RS—485 bus. The design of the system has its own separate watchdog and EEPROM memory circuit。 Therefore it can improve system reliability. Software of the system designs main program, amplifier gain setting program, ADC transition program, DAC transition program and processing subprogram by adopting assemble language of MCS—51 single chip and modularization program design method, and also designs corresponding munication protocol. Keywords Intelligent; Transducer; Communication; Singlechip; Fieldbus。 Measuring signal xx 大學(xué)學(xué)士學(xué)位論文 III 目錄 摘要 …… ..........................................................................................................................I Abstract .......................................................................................................................... II 第 1 章 緒論 ................................................................................................................... 1 課題背景 .............................................................................................................. 1 智能變送器的現(xiàn)狀 .............................................................................................. 2 現(xiàn)場信號通信的發(fā)展概況 .................................................................................. 4 本論文的主要工作 .............................................................................................. 6 第 2 章 硬件電路設(shè)計(jì) ................................................................................................... 8 單片機(jī)選擇 .......................................................................................................... 9 輸入信號增益自調(diào)節(jié)電路設(shè)計(jì) .......................................................................... 9 模 —數(shù)轉(zhuǎn)換器選擇及接口電路設(shè)計(jì) ................................................................ 11 TLC2543C 簡介 ........................................................................................... 11 TLC2543C 的主要性能 ............................................................................... 12 TLC2543C 的轉(zhuǎn)換過程 ............................................................................... 13 數(shù) —模轉(zhuǎn)換器接口電路設(shè)計(jì) ............................................................................ 15 V/I 變換電路設(shè)計(jì) ............................................................................................... 15 復(fù)位及運(yùn)行監(jiān)視電路設(shè)計(jì) ................................................................................ 16 RS—485 總線接口電路設(shè)計(jì) ............................................................................. 18 顯示器接口電路設(shè)計(jì) ........................................................................................ 19 鍵盤接口電路設(shè)計(jì) ............................................................................................ 19 電源 .................................................................................................................. 20 本章小結(jié) .......................................................................................................... 20 第 3 章 應(yīng)用軟件設(shè)計(jì) ................................................................................................. 21 監(jiān)控程序模塊 .................................................................................................... 21 輸入信號增益自調(diào)節(jié)模塊 ................................................................................ 22 數(shù)據(jù)采集和處理模塊 ........................................................................................ 22 通信模塊設(shè)計(jì) ......................................................................