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.
單片機軟件濾波的幾種方法:假定從AD中讀取數(shù)據(jù)的子程序為:unsigned int get_ad();1、限幅濾波法(又稱程序判斷濾波法)A、方法:根據(jù)經驗判斷,確定兩次采樣允許的最大偏差值(設為A)。每次檢測到新值時判斷:如果本次值與上次值之差<=A,則本次值有效;如果本次值與上次值之差>A,則本次值無效,放棄本次值,用上次值代替本次值。B、優(yōu)點:能有效克服因偶然因素引起的脈沖干擾C、缺點:無法抑制那種周期性的干擾,平滑度差D、軟件實現(xiàn)://=======================//值A可根據(jù)實際情況調整,value為有效值,new_value為當前采樣值//濾波程序返回有效的實際值
基于LabVIEW和單片機的空調溫度場測量系統(tǒng)的研究:室內溫度是空調系統(tǒng)舒適性的重要指標,對其及時、準確地測量顯得非常重要。介紹單片機AT89C51 和數(shù)字式、單總線型溫度傳感器DS18B20 組成矩形測量網絡采集空調室內40 點溫度,LabVIEW作為開發(fā)平臺,二者之間通過串口實現(xiàn)數(shù)據(jù)通信,利用LabVIEW強大的數(shù)據(jù)處理和顯示功能對采集的空調溫度場數(shù)據(jù)進行實時處理、分析和顯示,詳細介紹了系統(tǒng)的硬件結構和軟件模塊的設計方案。關鍵詞:單片機;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