【正文】
、INT0擁有高優(yōu)先級SETB PX0LCALL FSMOV TH0,81MOV TL0,38LCALL _COUNTMOV R5,30HMOV R4,31HLCALL DISPLAYENDinclude 。計算include include include define shw DBYTE[0x30]define gw DBYTE[0x31] define uchar unsigned charuchar time。void count(){ time=TH0。 time=time*256+TL0 。//取出定時器0值 time=time*17/10000。 shw=time/10。 gw=time%10。}附錄C 外文資料及翻譯Ultrasonic distance meterDocument Type and Number:United States Patent 5442592 Abstract:An ultrasonic distance meter cancels out the effects of temperature and humidity variations by including a measuring unit and a reference unit. In each of the units, a repetitive series of pulses is generated, each having a repetition rate directly related to the respective distance between an electroacoustic transmitter and an electroacoustic receiver. The pulse trains are provided to respective counters, and the ratio of the counter outputs is utilized to determine the distance being measured.Publication Date:08/15/1995Primary Examiner:Lobo, Ian J.DETAILED DESCRIPTION of ultrasonic distance measurement1, the principle of piezoelectric ultrasonic generatorPiezoelectric ultrasonic generator is the use of piezoelectric crystal resonators to work. Ultrasonic generator has two piezoelectric chip and a resonance plate. When it39。s two plus pulse signal, the frequency equal to the intrinsic piezoelectric oscillation frequency chip, the chip will happen piezoelectric resonance, and promote the development of plate vibration resonance, ultrasound is generated. Conversely, if the two are not interelectrode voltage, when the board received ultrasonic resonance, it will be for vibration suppression of piezoelectric chip, the mechanical energy is converted to electrical signals, then it bees the ultrasonic receiver.2, the principle of ultrasonic distance measurementUltrasonic transmitter in a direction to launch ultrasound, in the moment to launch the beginning of time at the same time, the spread of ultrasound in the air, obstacles on his way to return immediately, the ultrasonic reflected wave received by the receiver immediately stop the clock. Ultrasound in the air as the propagation velocity of 340m / s, according to the timer records the time t, we can calculate the distance between the launch distance barrier (s), that is: s = 340t / 2. Ranging System for the Second Circuit DesignSystem is characterized by singlechip microputer to control the use of ultrasonic transmitter and ultrasonic receiver since the launch from time to time, singlechip selection of 8751, economictouse, and the chip has 4K of ROM, to facilitate programming., the ultrasonic ranging system software designSoftware is divided into two parts, the main program and interrupt service routine. Completion of the work of the main program is initialized, each sequence of ultrasonic transmitting and receiving control.Interrupt service routines from time to time to plete three of the rotation direction of ultrasonic launch, the main external interrupt service subroutine to read the value of pletion time, distance calculation, the results of the output and so on.D. CONCLUSIONSRequired measuring range of 30cm ~ 200cm objects inside the plane to do a number of measurements found that the maximum error is , and good reproducibility. Singlechip design can be seen on the ultrasonic ranging system has a hardware structure is simple, reliable, small features such as measurement error. Therefore, it can be used not only for mobile robot can be used in other detection systems.Thoughts: As for why the receiver do not have the transistor amplifier circuit, because the magnification well, CX20106 integrated amplifier, but also with automatic gain control level, magnification to 76dB, the center frequency is 38k to 40k, is exactly resonant ultrasonic sensors frequency.中文譯文C超聲波測距儀文件類型和數(shù)目:美國專利5442592摘要:提出了一種可以抵消溫度的影響和濕度的變化的新型超聲波測距儀,包括測量單元和參考資料。在每一個單位,重復的一系列脈沖的產生,每有一個重復率,直接關系到各自之間的距離,發(fā)射機和接收機。該脈沖序列提供給各自的計數(shù)器,計數(shù)器的產出的比率,是用來確定被測量的距離。出版日期: 1995年8月15日主審查員:.詳細說明一 超聲波測距原理壓電式超聲波發(fā)生器原理壓電式超聲波發(fā)生器實際上是利用壓電晶體的諧振來工作的。超聲波發(fā)生器內部有兩個壓電晶片和一個共振板。當它的兩極外加脈沖信號,其頻率等于壓電晶片的固有振蕩頻率時,壓電晶片將會發(fā)生共振,并帶動共振板振動,便產生超聲波。反之,如果兩電極間未外加電壓,當共振板接收到超聲波時,將壓迫壓電晶片作振動,將機械能轉換為電信號,這時它就成為超聲波接收器了。超聲波測距原理超聲波發(fā)射器向某一方向發(fā)射超聲波,在發(fā)射時刻的同時開始計時,超聲波在空氣中傳播,途中碰到障礙物就立即返回來,超聲波接收器收到反射波就立即停止計時。超聲波在空氣中的傳播速度為340m/s,根據計時器記錄的時間t,就可以計算出發(fā)射點距障礙物的距離(s),即:s=340t/2。二 超聲波測距系統(tǒng)的電路設計系統(tǒng)的特點是利用單片機控制超聲波的發(fā)射和對超聲波自發(fā)射至接收往返時間的計時,單片機選用8751,經濟易用,且片內有4K的ROM,便于編程。三、超聲波測距系統(tǒng)的軟件設計軟件分為兩部分,主程序和中斷服務程序。主程序完成初始化工作、各路超聲波發(fā)射和接收順序的控制。定時中斷服務子程序完成三方向超聲波的輪流發(fā)射,外部中斷服務子程序主要完成時間值的讀取、距離計算、結果的輸出等工作。四、結論對所要求測量范圍30cm~200cm內的平面物體做了多次測量發(fā)現(xiàn),且重復性好??梢娀趩纹瑱C設計的超聲波測距系統(tǒng)具有硬件結構簡單、工作可靠、測量誤差小等特點。因此,它不僅可用于移動機器人,還可用在其它檢測系統(tǒng)中。思考:至于為什么接收不用晶體管做放大電路呢,因為放大倍數(shù)搞不好,CX20106集成放大電路,還帶自動電平增益控制,放大倍數(shù)為76dB,中心頻率是38k到40k,剛好是超聲波傳感器的諧振頻率。