The PCA9542A is a 1-of-2 bidirectional translating multiplexer, controlled via the I2C-bus.The SCL/SDA upstream pair fans out to two SCx/SDx downstream pairs, or channels.Only one SCx/SDx channel is selected at a time, determined by the contents of theprogrammable control register. Two Interrupt inputs, Int0 and Int1, one for each of theSCx/SDx downstream pairs, are provided. One Interrupt output, Int, which acts as anAND of the two Interrupt inputs, is provided.
單片機(jī)軟件濾波的幾種方法:假定從AD中讀取數(shù)據(jù)的子程序?yàn)椋簎nsigned Int get_ad();1、限幅濾波法(又稱程序判斷濾波法)A、方法:根據(jù)經(jīng)驗(yàn)判斷,確定兩次采樣允許的最大偏差值(設(shè)為A)。每次檢測到新值時(shí)判斷:如果本次值與上次值之差<=A,則本次值有效;如果本次值與上次值之差>A,則本次值無效,放棄本次值,用上次值代替本次值。B、優(yōu)點(diǎn):能有效克服因偶然因素引起的脈沖干擾C、缺點(diǎn):無法抑制那種周期性的干擾,平滑度差D、軟件實(shí)現(xiàn)://=======================//值A(chǔ)可根據(jù)實(shí)際情況調(diào)整,value為有效值,new_value為當(dāng)前采樣值//濾波程序返回有效的實(shí)際值
基于LabVIEW和單片機(jī)的空調(diào)溫度場測量系統(tǒng)的研究:室內(nèi)溫度是空調(diào)系統(tǒng)舒適性的重要指標(biāo),對其及時(shí)、準(zhǔn)確地測量顯得非常重要。介紹單片機(jī)AT89C51 和數(shù)字式、單總線型溫度傳感器DS18B20 組成矩形測量網(wǎng)絡(luò)采集空調(diào)室內(nèi)40 點(diǎn)溫度,LabVIEW作為開發(fā)平臺,二者之間通過串口實(shí)現(xiàn)數(shù)據(jù)通信,利用LabVIEW強(qiáng)大的數(shù)據(jù)處理和顯示功能對采集的空調(diào)溫度場數(shù)據(jù)進(jìn)行實(shí)時(shí)處理、分析和顯示,詳細(xì)介紹了系統(tǒng)的硬件結(jié)構(gòu)和軟件模塊的設(shè)計(jì)方案。關(guān)鍵詞:單片機(jī);DS18B20 ;LabVIEW;串行通信
Abstract : Temperature is a very important criterion of air condition system′s comfort , so it is very significant to measure it accurately and real timely. This paper Int roduces a data acquisition system of measuring 40 poInt s temperature for air condition room based on single wire digital sensor DS18B20 and microcont roller AT89C51 which are composed of rectangle measuring meshwork. The data communication between LabVIEW and microcont roller is executed via serial port ,and the temperature field data of air condition room are processed analyzed and displayed on LabVIEW. The hardware and software modules are also given in detail.Keywords : single chip ;DS18B20 ;LabVIEW; serial communication