【正文】
當(dāng)它的兩極外加脈沖信號(hào),其頻率等于壓電晶片的固有振蕩頻率時(shí),壓電晶片將會(huì)發(fā)生共振,并帶動(dòng)共振板振動(dòng),便產(chǎn)生超 聲波。 超聲波測(cè)距原理 壓電式超聲波發(fā)生器原理 壓電式超聲波發(fā)生器實(shí)際上是利用壓電晶體的諧振來工作的??刂葡到y(tǒng)核心部分就是超聲波測(cè)距儀的研制。城市污水給人們帶來了困擾,因此箱涵的排污疏通對(duì)大城市給排水系統(tǒng) 污水處理,人們生活舒適顯得非常重要。但是,由于歷史原因合成時(shí)間住的許多不可預(yù)見因素,城市給排水系統(tǒng),特別是排水系統(tǒng)往往落后于城市建設(shè)。為了進(jìn)一步提高測(cè)距的精確度,滿足工程人員對(duì)測(cè)量精度、測(cè)距量程和測(cè)距儀使用的要求,本文研制了一套基于單片機(jī)的便攜式超聲測(cè)距系統(tǒng)。編程供應(yīng)商 21 超聲測(cè)距系統(tǒng)設(shè)計(jì) 原文出處 :傳感器文摘 布拉福德 :1993年 超聲測(cè)距技術(shù)在工業(yè)現(xiàn)場(chǎng)、車輛導(dǎo)航、水聲工程等領(lǐng)域都具有廣泛的應(yīng)用價(jià)值,目前已應(yīng)用于物位測(cè)量、機(jī)器人自動(dòng)導(dǎo)航以及空氣中與水下的目標(biāo)探測(cè)、識(shí)別、定位等場(chǎng)合。寫操作周期是自定時(shí)的,一旦 172。 TION和持有 10 毫秒代碼陣列 P3 2 低是全“ 1”,在的書面芯片擦除操作之前,必須執(zhí)行任何非空存儲(chǔ)字節(jié)可重新編程讀標(biāo)識(shí)字節(jié)的簽名字節(jié)是由一個(gè)地點(diǎn) 000H, 001H 和002H 正常核查的程序相同,只是讀 5 P3 和 P3 7,必須拉至低的值返回的邏輯如下 。 fication 數(shù)據(jù)線 。美食一個(gè)寫周期期間寫周期結(jié)束時(shí),企圖形 最后寫入的字節(jié)讀將在 7 P1 上寫入數(shù)據(jù)的補(bǔ)充結(jié)果一旦寫周期已經(jīng)完成,真正的數(shù)據(jù)是對(duì)所有輸出有效,下一個(gè)周期可能開始數(shù)據(jù)輪詢可能會(huì) 開始后的任何時(shí)間寫周期已啟動(dòng)就緒 /忙字節(jié)編程的進(jìn)展,也可以由 RDY / BSY 輸出信號(hào)引腳 P3 P3 后拉 1 2 低監(jiān)控云在編程過程中,以指示 BUSY P3 1 被拉高時(shí)再進(jìn)行編程,以指示READY 高程序驗(yàn)證如果鎖定位 LB1 和 LB2 沒有親 172。 重復(fù)步驟 5 到 8,更改數(shù)據(jù),并推動(dòng)整個(gè) 2 千字節(jié)數(shù)組的地址計(jì)數(shù)器或直至達(dá)到最終目標(biāo)文件 。 要核實(shí)編程的數(shù)據(jù),降低 RST 從 12V到邏輯“ H”級(jí),并設(shè)置 3 至 P3 P3 引腳7 到適當(dāng)?shù)乃捷?出的數(shù)據(jù)可以讀取的 P1 口引腳 。 應(yīng)用在位置 000H 到 P1 P1 7 5 0 字節(jié)數(shù)據(jù)的代碼 RST 提高到 12V,使編程 6 脈沖 P3 2 一次計(jì)劃在 PEROM 陣列或鎖定位字節(jié)的字節(jié)寫周期是自定時(shí)的典型 172。 申請(qǐng)的“ H”或“ L”適當(dāng)?shù)慕M合邏輯電平的引腳 3 P3, P3 4, 5 P3, P3 7 選擇親 one 172。 電序列 , 應(yīng)用在 VCC 和 GND 引腳發(fā)電機(jī)組 RST 和 XTAL1 和 GND 與所有其他引腳浮動(dòng),等 待大于 10 毫秒 。 AT89C2051 包含一個(gè) 172。也可以使用外部上拉 。 cuted 片上 RAM 和特殊功能寄存器的值保持不變,直到掉電模式終止從電源唯一的出口下一個(gè)硬件復(fù)位復(fù)位重新定義了 SFR, 但不改變片上 RAM 的復(fù)位不應(yīng)該被啟動(dòng)才能 VCC 恢復(fù)到正常工作的水平,必須持有足夠長(zhǎng)的活躍,使振蕩器重新啟動(dòng)并穩(wěn)定 P1 0 和 P1 1 應(yīng)設(shè)置為 0,如果沒有外部上拉電阻的使用,或設(shè)置為 39。 十、 掉電模式 在掉電模式,振蕩器停止,并在 172。如果使用外部上拉 , 應(yīng)該指出的是,空閑時(shí)被硬件復(fù)位終止,恢復(fù)設(shè)備正常程序執(zhí)行,從那里離開的,最多兩個(gè)機(jī)器周期之前,內(nèi)部復(fù)位算法需要控制片上硬件抑制這種訪問內(nèi)部 RAM 事件,但訪問端口引腳是不禁止為了消除意想不到的可能性,寫一個(gè)端口引腳空閑時(shí)被復(fù)位終止,指令 FOL 172。 P1 0 和 P1 1 應(yīng)設(shè)置為 0,如果沒有外部上拉電阻的使用,或設(shè)置為 39。 八、 程序存儲(chǔ)器鎖定位 在芯片上有兩個(gè)鎖,可以不編程( U),也可以編程( P)位獲得該表中列出以下的附加功能 。 18 2 MOVX 相關(guān)指令,數(shù)據(jù)存儲(chǔ)器 該 AT89C2051 包含 128 字節(jié)的內(nèi)部數(shù)據(jù)存儲(chǔ)器因此,在 AT89C2051 的堆棧深度限制為 128 字節(jié),可用 RAM 外部數(shù)據(jù)存儲(chǔ)器訪問量是不支持這個(gè)設(shè)備,也不是外部程序存儲(chǔ)器執(zhí)行,因此,沒有 MOVX [ ]說明應(yīng)包括在該計(jì)劃 。 對(duì)于涉及中斷應(yīng)用的正常中斷 SERV 172。層數(shù)相同的規(guī)則同樣,侵犯邊界的內(nèi)存可能會(huì)導(dǎo)致二 172。已知程序的行為 。 TION分支 。 LCALL, LJMP, ACALL, AJMP, SJMP, JMP A + DPTR 這些無條件分支指令將執(zhí)行 心病 172。 這應(yīng)該是軟的責(zé)任 172。 MCS 51 指令集然而,也有少數(shù)的審議 172。 七、 某些指令的限制 該 AT89C2051 是一種經(jīng)濟(jì)和成本效益的紀(jì)念品 , Atmel 的越來越多的微控制器系列 。由二翻轉(zhuǎn)翻牌,但最小和最大電壓高和低時(shí)間規(guī)范必須遵守 。 端口引腳的第二功能 P3 0 RXD(串行輸入口) P3 1 TXD(串行輸出端口) P3 2 INT0(外部中斷 0) P3 3 INT1(外部中斷 1) P3 4 T0(定時(shí)器 0 外部輸入) 17 端口 3 也可以用下面列出的 AT89C2051 各種特殊功能, 五、 振蕩器特性 XTAL1 和 XTAL2 分別是輸入和輸出,分別為一個(gè)反相放大器,可用于作為一個(gè)片上振蕩器使用配置,如圖 1 無論是石英晶體或陶瓷諧振器可用于驅(qū)動(dòng)外 部顯示設(shè)備時(shí)鐘源, XTAL2 應(yīng)懸空而 XTAL1 驅(qū)動(dòng),如圖 2 所示有沒有重新 172。 端口 3 P3 口 P3 0 至 5 P3, P37 頃帶有內(nèi)部上拉 P3 6 seven 雙向 I / O 引腳是作為對(duì)片上比較器輸出輸入硬連接,而不是作為一個(gè)通用訪問 172。的 Flash 可編程,可擦除只讀存儲(chǔ)器( PEROM)設(shè)備是制造 172。 storage results MOV A, R7 13 SUBB A, 3CH MOV 30H, A SETB EX0。 read the time value MOV R6, TL0 CLR C MOV A, R6 SUBB A, 0BBH。 left Ranging entrance circuit interrupt service routine Ajmp Return The calculation of ultrasonic propagation time When you start firing at the same time start the singlechip circuitry within the timer T0, the use of timer counting function records the time and the launch of ultrasonic reflected wave received time. When you receive the ultrasonic reflected wave, the receiver circuit outputs a negative jump in the end of INT0 or INT1 interrup t request generates a signal, singlechip microputer in response to external interrupt request, the implementation of the external interrupt service subroutine, read the time difference, calculating the distance . Some of its source code is as follows: RECEIVE0: PUSH PSW PUSH ACC CLR EX0。 open external interrupt 1 pop acc pop psw reti right: ...。 pin to 0, ranging from right to interrupt service routine circuit jnb , left。 output 40kHz square wave Ranging in front of singlechip termination circuit input port, single chip implementation of the above procedure, the port in a 40kHz pulse output signal, after amplification transistor T, the drive to launch the first ultrasonic UCM40T, issued 40kHz ultrasonic pulse, and the continued launch of 200ms. Ranging the right and the left side of the circuit, respectively, then input port and , the working principle and circuit in front of the same location. Reception and processing of ultrasonic Used to receive the first launch of the first pair UCM40R, the ultrasonic pulse modulation signal into an alternating voltage, the opamp amplification IC1A and after polarization IC1B to IC2. IC2 is locked loop with audio decoder chip LM567, internal voltagecontrolled oscillator center frequency of f0 = 1/, capacitor C4 determine their target bandwidth. R8conditioning in the launch of the carrier frequency on the LM567 input signal is greater than 25mV, the output from the high jump 8 feet into a lowlevel, as interrupt request signals to the singlechip processing. Ranging in front of singlechip termination circuit output port INT0 interrupt the highest priority, right or left location of the output circuit with output gate IC3A access INT1 port singlechip, while singlechip and P1. 4 received input IC3A, interrupted by the process to identify the source of inquiry to deal with, interrupt priority level for the first left right after. Part of the source code is as follows: receive1: push psw push acc clr ex1。s starting point to the moment when it surpasses the threshold changes with the intensity of the echo. As a consequence, a considerable error may occur Even two echoes with different intensities arriving exactly at the sa