【正文】
s, the application of embedded technology in full swing, has bee the munications and consumer technology products, the main platform. In the field of automatic control, not only can be used in ATM machines, vending machines, industrial control and other special equipment and mobile munications equipment, GPS, a bination of entertainment, embedded systems play a huge role in the same.The development of embedded technology makes it easy to develop embedded systems, reducing development costs, generic products increased to replacement. Combination of the traditional embedded systems are small, energyless, antiinterference ability, stable characteristics, the development of embedded data acquisition system products, whether as a standalone product, or a function of a system of modules, all It is very meaningful.Data Acquisition System is a puter, munications and electronic technology, industrial control for an integrated detection system. This paper introduces embedded Linuxbased data acquisition system hardware architecture and software design. To enhance the system to respond to the realtime performance and multitask processing capability of hardware used in the ARM9 microprocessor technology, at the same time Linux operating system migration, system reliability and scalability can be improved. Designed to make full use of the characteristics of embedded Linux. System software modules have a data acquisition module, data processing module, data modules and data munications diagnostic module. Embedded Linux operating system will introduce a data acquisition system design and accelerate the development of the system to facilitate the functions of the future expansion of the observational data to improve the timeliness and accuracy of observation to achieve the automation.Embedded system is applicationcentric, based on puter technology, software, hardware can be tailored to meet the application system functions, reliability, cost, size, power consumption, there are strict requirements of a dedicated puter systems, operating systems and features will integrated software systems in puter hardware, in a nutshell is the system software and hardware integration, the work is similar to the way BIOS with software code in small, highly automated, fast response and so on. Particularly suited to the requirements of realtime and multitasking system. Embedded systems are advanced puter technology, semiconductor technology, electronic technology and the practical application of the various sectors of the product of the bination. Embed The structure of systems posed by two modules: the hardware platform and software platform.Acquisition Data Acquisition System at the scene to plete the task. Acquisition system designed for distributed control systems, PC systems and onsite testing of the munication between digital serial based. Normal runtime, onsite detection of the controller to plete the nextbit data acquisition, data processing, data storage, data distribution and other tasks. System has a certain degree of selfdetection, selftuning capabilities, to unusual circumstances to the PC, in order to maintain. In order to adapt to a variety of different circumstances automatic detection of weld requirements, the entire detection system is modular design, different modules can be bined into different applications.Microputer39。在選題時,x老師就根據(jù)我的實際情況給我提出了寶貴的意見,我才得以確定題目。系統(tǒng)擴展了RS232接口和RS422接口,采集系統(tǒng)可通過RS232接口實現(xiàn)與上位機的通信,有效距離小于15m,而系統(tǒng)通過RS422接口則可實現(xiàn)與上位機的遠距離通信,有效距離最大可達1200m。在軟件設計過程中加入了抗干擾子程序段。指令9:讀忙信號和光標地址BF為忙標志位,高電平表示忙,此時模塊不能接收命令或者數(shù)據(jù),如果為低電平表示忙。指令3:光標和顯示模式設置。消除鍵盤抖動可以使用硬件去抖或軟件去抖方法。延時程序 RS422接口擴展軟件設計對于單片機的通信程序來說,RS422通信與RS232通信沒有本質(zhì)區(qū)別。T1時間常數(shù)SETB TR1 。接收數(shù)據(jù)時,先查狀態(tài)寄存器LSR的D1位(OE位),接受數(shù)據(jù)準備好(OE=1),即說明已接收到一個數(shù)據(jù),這時可以從接受緩沖器讀入數(shù)據(jù)。串口通訊過程的順利完成,通訊雙方不但要在硬件接口標準上共同遵守某種約定,而且還必須對數(shù)據(jù)格式、同步方式、傳送速度、傳送步驟、糾錯方式以及控制字符定義等問題作出統(tǒng)一的規(guī)定,即通訊協(xié)議,而這些工作是通過軟件編程實現(xiàn)。需要注意的是,℃,工作頻率不能大于15%(如:12位精確度時每秒最多進行3次測量),即對SHT75的操作不能過于頻繁,如果傳感器本身溫度升高,將會使測量結(jié)果產(chǎn)生較大誤差。圖313 1602與單片機連接電路圖 本章小結(jié)本章詳細介紹了數(shù)據(jù)采集系統(tǒng)各硬件模塊的設計思路及過程,包括單片機最小系統(tǒng)設計,其中電源電路采用LM7805CK穩(wěn)壓芯片,時鐘電路采用內(nèi)部時鐘,復位電路采用手動復位方式;數(shù)據(jù)采集模塊,其中溫濕度傳感器采用SHT75芯片,壓力傳感器采用26PCB壓力傳感器;系統(tǒng)輸入輸出模塊及系統(tǒng)與PC機通信模塊等相關模塊的各芯片電路連接。背光燈有黃綠色、白色等。這里所說的按鍵采用金屬接觸方式,開關的原理是觸電導通或斷開,通常采用銅片彈簧作為彈性材料。派若斯(Paroscientific)公司的740和760系列數(shù)字式石英壓力計,由于其精度、穩(wěn)定性、可靠性等性能突出,在國際上被用作壓力傳遞標準。該傳感器將COMS芯片技術與傳感器技術結(jié)合起來,發(fā)揮出強大的優(yōu)勢互補作用。具有結(jié)構(gòu)緊湊、存儲容量大等優(yōu)點。在CPU與被控IC之間、IC與IC之間進行雙向傳輸,最高傳輸速率100Kbit/s。RS422與RS232電平轉(zhuǎn)換接口使用MAX232和MAX485實現(xiàn)?,F(xiàn)在采用MAX232芯片中兩路發(fā)送接收中任選一路作為接口。由于通信設備廠商都生產(chǎn)與RS232C制式兼容的通信設備,因此,它作為一種標準,目前已在微機通信接口中廣泛采用。圖34 LM7805引腳圖常見的LM7805CK的引腳定義如表31表31 LM7805CK引腳定義引腳符號功能1Input輸入電壓2GND地3Output輸出電壓 標準RS232接口擴展大多數(shù)控制系統(tǒng)都是把PC機作為上位機,單片機系統(tǒng)作為下位機。 系統(tǒng)時鐘電路AVR單片機的時鐘信號通常有兩種產(chǎn)生方式:一是內(nèi)部時鐘方式;二是外部時鐘方式,本課題采用內(nèi)部時鐘方式,如圖32。:反向震蕩放大器及片內(nèi)時鐘操作電路的輸入。(PG4~PG0):端口G為5位雙向I/O端口,并具有可編程的內(nèi)部上拉電阻。(PF7~PF0):端口F為ADC的模擬輸入引腳。:0~16MHz。? 片內(nèi)/片外中斷源。? 8路10位ADC:8個單端通道;7個差分通道;2個具有可編程增益(1倍、10倍、200倍)的差分通道。? 支持擴展的片內(nèi)調(diào)試。;? 64KB的系統(tǒng)內(nèi)可編程Flash存儲器,壽命為10000次寫/擦出周期。通過將8位RISC與系統(tǒng)內(nèi)可編程的Flash存儲器集成在一個芯片內(nèi),Atmega64單片機為許多嵌入式控制應用提供了靈活且低成本的方案。所有的寄存器都直接與邏輯單元(ALU)相連接,使得一條指令可以在一個時鐘周期內(nèi)同時訪問兩個獨立的寄存器。 系統(tǒng)主程序設計采集系統(tǒng)軟件設計采用模塊化結(jié)構(gòu),用C語言編寫,總體設計流程圖如圖22所示:系統(tǒng)上電后首先進行自檢,檢查各功能模塊電子器件是否正常工作,檢查完畢后進行各功能模塊初始化,掃描鍵盤,當有“按鍵1”按下時,系統(tǒng)可讀到PB0口為低電平,此時系統(tǒng)開始執(zhí)行測量數(shù)據(jù)的工作,將采集到的溫濕度及壓力數(shù)據(jù)儲存到特定寄存器,當有“按鍵2”按下時,系統(tǒng)將儲存在寄存器中的溫濕度及壓力數(shù)據(jù)組送LCD顯示,同時將該組數(shù)據(jù)通過I2C總線傳送至片外E2PROM,當“按鍵3”按下時,系統(tǒng)檢查是否與上位機已經(jīng)建立連接,若連接成功則通過RS232接口進行數(shù)據(jù)傳送同時清空E2PROM內(nèi)數(shù)據(jù)。 課題設計內(nèi)容課題主要對土壤內(nèi)部溫度、濕度、壓力數(shù)據(jù)采集系統(tǒng)的進行設計。該階段數(shù)據(jù)采集系統(tǒng)采用更先進的模塊式結(jié)構(gòu),根據(jù)不同的應用要求,通過簡單的增加和更改模塊,并結(jié)合系統(tǒng)編程,就可擴展或修改系統(tǒng)迅速地組成一個新的系統(tǒng)。這種接口系統(tǒng)采用積木式結(jié)構(gòu),把相應的接口卡裝在專用的機箱內(nèi),然后由一臺計算機控制。由于這種數(shù)據(jù)采集系統(tǒng)的性能優(yōu)良,超過了傳統(tǒng)的自動檢測儀表和專用數(shù)據(jù)采集系統(tǒng),因此獲得了驚人的發(fā)展。近年來隨著微電子技術的迅速發(fā)展和大規(guī)模集成電路的出現(xiàn),特別是高性能單片機的出現(xiàn),正引起數(shù)據(jù)采集系統(tǒng)領域內(nèi)的一場新的技術革命。關鍵詞 嵌入式;數(shù)據(jù)采集;Atmega64;傳感器Design of Data Acquisition System Based on AVR SCMAbstractIn recent years, with the rapid development in embedded microprocessor,the SCM(Single Chip Micyoco)has been widely applied in many fields such as the medical treatment,the aviation,the transportation,the m