專利名稱:三防電子水表的制作方法
技術(shù)領(lǐng)域:
技術(shù)領(lǐng)域:
三防電子水表主要應(yīng)用于供水計(jì)量,屬電子液體計(jì)量儀表。因用水收費(fèi),需抄表工人到每戶居民家中抄表,給企業(yè)居民帶來諸多不便,為減輕企業(yè)負(fù)擔(dān),降低對居民生活的干擾而設(shè)計(jì)的這種電子計(jì)量裝置,能在不同的工作場地使用,比如不準(zhǔn)外人進(jìn)入的場所及高樓層等有關(guān)用水單位的用水計(jì)量。
背景技術(shù):
現(xiàn)有的用水計(jì)量儀表雖有很多種,但居民用戶還是以機(jī)械式儀表計(jì)量為主,在某種特定的場合,不僅要求計(jì)量準(zhǔn)確,還要求儀表應(yīng)具有防竊水功能,維修成本低,停電后不影響計(jì)量,有些儀表雖有以上功能,但科技含量低,不便升級,擴(kuò)大功能,給企業(yè)和居民帶來一些的不便。這就要求一種方便實(shí)用,便于升級換代,能和微機(jī)聯(lián)網(wǎng)的新型用水計(jì)量儀表來完成。
發(fā)明內(nèi)容本實(shí)用新型的目的就是一種能完成上述功能的用水計(jì)量裝置。該裝置的防竊回路采用了數(shù)字電路及單片機(jī)程序完成,數(shù)字計(jì)量顯示也采用了單片機(jī)程序完成,為此具有成本低、計(jì)量準(zhǔn)確、性能可靠、自動化程度高,便于升級換代,安裝方便等特點(diǎn)。
本實(shí)用新型用水計(jì)量裝置為完成上述過程,采用了如下電路結(jié)構(gòu)由信號輪,霍爾集成塊及阻,容元件構(gòu)成的流量脈沖發(fā)生器,總稱流量頭。三防竊回路,單片機(jī);選通振蕩I,選通振II,脈沖整形放大程序及十進(jìn)制動態(tài)掃描加法計(jì)數(shù)程序。與數(shù)碼管顯示回路等系統(tǒng)構(gòu)成。整機(jī)工作電源由可充電池和硅光電池組成。
圖1為本實(shí)用新型的電路原理圖圖2為本實(shí)用新型的原理框圖圖3為本實(shí)用新型的流量頭結(jié)構(gòu)圖。圖3中1為絲堵,2為橡膠密封墊,3為流量頭上蓋,4為線路板固定軸絲,5為流量頭線路板,6為霍爾集成塊,7為流量頭下盤,8為信號磁塊,9為流量頭信號輪,10水表機(jī)芯密封墊,11水表機(jī)芯體,12信號長軸齒輪。
具體實(shí)施方式
由供水管道中的磁信號輪旋轉(zhuǎn)時使霍爾產(chǎn)生感應(yīng)信號,此信號經(jīng)霍爾集塊(H)內(nèi)部的整形放大后,經(jīng)速熔保險(xiǎn)管BX2與室外儀表內(nèi)速熔保險(xiǎn)管BX4電連接后,由電阻R27限流送入單片機(jī)IC2CP端第1腳,單片機(jī)IC2按程序整形放大后,經(jīng)第2腳通過二極管D12送入單片機(jī)IC1CP端第7腳,由單片機(jī)IC1按程序完成動態(tài)掃描十進(jìn)制加法計(jì)數(shù)。壓敏電阻R5與穩(wěn)壓二極管D1并接在流量頭內(nèi)的正電位與信號輸出線上,壓敏電阻R6穩(wěn)壓二極管D2并接在信號線與負(fù)電位上。當(dāng)信號線人為超過±12V電壓時,由壓敏電阻R5、R6穩(wěn)壓二極管D1、D2將超電壓泄放,速熔保險(xiǎn)管BX1、BX2熔斷,壓敏電阻R7、R8、R9穩(wěn)壓二極管D3、D4、D5分別并接在儀表內(nèi)正、負(fù)電位與信號端,超電壓時由壓敏電阻R7、R8、R9穩(wěn)壓二極管D3、D4、D5迅速將超電壓泄放,速熔保險(xiǎn)管BX3、BX4熔斷。由于速熔保險(xiǎn)管的熔斷,使正電源和信號線呈開路狀態(tài),這時電壓比較器LM324I、III比較器檢測電位發(fā)生變化,分別高于分壓點(diǎn)電位,電壓比較器I、III輸出端8腳、1腳分別輸出高電位,經(jīng)限流電阻R24、R19分別送入單片機(jī)IC2的6腳和8腳,單片機(jī)IC2按程序選通振蕩I工作產(chǎn)生處罰脈沖,經(jīng)IC2第2腳通過二極管D12送入單片機(jī)IC1的CP端7腳,使其按程序完成動態(tài)掃描十進(jìn)制加法處罰計(jì)數(shù)。同時單片機(jī)IC2按程序向第17腳輸出報(bào)警脈沖,經(jīng)二極管D8使紅色發(fā)光二極管D11閃爍告警,從而有效地保護(hù)了儀表的安全。
由電阻R13與電阻R14串聯(lián)后分別接正、負(fù)電位上,電壓比較器LM324的I電壓比較器2腳接電阻R13、R14的分壓點(diǎn),線路正常時因分壓點(diǎn)電位高于I電壓比較器第3腳經(jīng)限流電阻R11接在速熔保險(xiǎn)管BX3與二極管D6之間的電位,電壓比較器I第1腳輸出低電位,單片機(jī)IC2按程序選通振蕩I不工作。電阻R0、R22串聯(lián)后分別接正、負(fù)電位上,電壓比較器III的第9腳接電阻R0、R22分壓點(diǎn),線路正常時因III電壓比較器第10腳從限流電阻R17到速熔保險(xiǎn)管BX4、BX2經(jīng)電阻R4下拉,使檢測點(diǎn)III電壓比較器第10腳電位低于III電壓比較器的分壓點(diǎn)第9腳電位III電壓比較器第8腳輸出低電位,單片機(jī)IC2按程序選通振蕩I不工作。當(dāng)流量脈沖信號及供給信號源的正、負(fù)電源被人為剪斷時,速熔保險(xiǎn)管BX3上的電位因無負(fù)載而上升。電壓比較器I的檢測點(diǎn)電壓第3腳經(jīng)電阻R11被整流二極管D6與速熔保險(xiǎn)管BX3之間的電位上拉,這時電壓比較器I的第3腳電位高于I電壓比較器第2腳電位,I電壓比較器第1腳輸出高電位經(jīng)限電阻R19送入單片機(jī)IC2第8腳單片機(jī)IC2按程序選通振蕩I工作。信號線被剪斷時因III電壓比較器的檢測點(diǎn)第10腳限流電阻R17經(jīng)速熔保險(xiǎn)管BX4無法與速熔保險(xiǎn)管BX2及下拉電阻R4接通。因而被壓敏電阻R7上拉,這時III電壓比較器的檢測點(diǎn)第10腳電位高于接在電阻R0、R22分壓點(diǎn)上第9腳電位,III電壓比較器第8腳輸出高電位,經(jīng)限流電阻R24送入單片機(jī)IC2第6腳,IC2按程序選通振蕩I工作。單片機(jī)IC2按程序選通振蕩I工作時從第2腳經(jīng)二極管D12向單片機(jī)IC1的CP第7腳送處罰脈沖,IC1按程序進(jìn)行動態(tài)掃描加法處罰計(jì)數(shù),同時單片機(jī)IC2的第17腳通過二極管D8向紅色發(fā)光二極管D11送報(bào)警脈沖,紅色發(fā)光二極管D11閃爍告警。
由電阻R15、R16串聯(lián)后并接在正、負(fù)電位上,電壓比較器II的第5腳接電阻R15、R16的分壓點(diǎn)電壓比較器II的第6腳經(jīng)限流電阻R12接在速熔保險(xiǎn)管BX3與二極管D6之間,這時因檢測點(diǎn)第6腳的電位高于分壓點(diǎn)第5腳的電位,電壓比較器II輸出低電位,單片機(jī)IC2程序選通振蕩II不工作。電阻R21、R23串聯(lián)后并接在正、負(fù)電位上,電壓比較器IV的第12腳接電阻R21、R23的分壓點(diǎn),電壓比較器IV的第13腳從限流電阻R18、速熔保險(xiǎn)管BX4、BX2,經(jīng)電阻R1上拉,這時由于檢測點(diǎn)第13腳電位高于第12腳的分壓電位,電壓比較器IV的第14腳輸出低電位,單片機(jī)IC2程序選通振蕩II不工作。
當(dāng)供給流量頭電路的正、負(fù)電源及信號線人為短路時電壓比較器II的檢測點(diǎn)第6腳電位因正、負(fù)電位短路而變低時分壓點(diǎn)第5腳電位將高于第6腳電位,這時電壓比較器II第7腳輸出高電位經(jīng)限流電阻R20送入單片機(jī)IC2的第9腳單片機(jī)IC2按程序選通振蕩II開始工作。短路時電壓比較器IV的檢測點(diǎn)第13腳電位因信號線與負(fù)電位短路而變低時,分壓點(diǎn)第12腳電位將高于第6腳電位,這時電壓比較器IV第14腳輸出高電位經(jīng)限流電阻R25送入單片機(jī)IC2的第7腳,單片機(jī)IC2按程序選通振蕩II開始工作。單片機(jī)IC2的程序振蕩II工作時從單片機(jī)IC2第2腳經(jīng)二極管D12送入單片機(jī)IC1的CP第7腳單片機(jī)IC1按程序進(jìn)行動態(tài)掃描加法處罰計(jì)數(shù)。同時單片機(jī)IC2的第18腳輸出報(bào)警脈沖經(jīng)二極管D9送入紅色發(fā)光二極管D10,發(fā)光二極管閃爍告警。
正常工作時按一下S1清零按鈕,管道中的水流動時帶動磁信號輪XL,信號輪每旋轉(zhuǎn)1周,霍爾集成塊第3腳輸出1個脈沖,經(jīng)電阻R2、速熔保險(xiǎn)管BX2、BX4、電阻R27送入單片機(jī)IC2的CP端1腳。單片機(jī)IC2按程序整形放大后,從第2腳經(jīng)二極管D12送入單片機(jī)IC1的CP端7腳,單片機(jī)IC1按程序進(jìn)行動態(tài)掃描十進(jìn)制加法計(jì)數(shù)。單片機(jī)IC1的18腳為×0.001m3的陰極控制端,17腳為×0.01m3的陰極控制端,16腳為×0.1m3的陰極控制端,15腳為×1m3的陰極控制端,14腳為×10m3的陰極控制端,13腳為×100m3的陰極控制端,12腳為×1000m3的陰極控制端,11腳為×10000m3的陰極控制端。最高計(jì)量為10000m3。21腳為LED數(shù)碼管的a端,22腳為b端,23腳為c端,24腳為d端,25腳為e端,26腳為f端,27腳為g端。八位LED數(shù)碼管除陰極外所有同名端并聯(lián)。單片機(jī)IC1程序具有無效零不顯示,掉電記憶功能。S1為清零按鈕,S2為啟動按鈕,S3為顯示按鈕,更換電池后按啟動按鈕,啟動程序,校表和抄表時按顯示按鈕,儀表使用前按一下清零按鈕。工作時只計(jì)數(shù)不顯示數(shù)碼,電源由可充鎘鎳電池和硅光電池組成,二極管VD19為防止鎘鎳電池向硅光電池放電,保證了在停電和陰雨天氣儀表工作。
流量頭中,為防止快速脈沖丟失,將電容C1和電阻R2并聯(lián)后串接在霍爾集成塊第3腳和速熔保險(xiǎn)管BX2之間,電阻R1與R2串聯(lián)后向霍爾集成塊第3腳供電,電阻R3為霍爾集成塊的輸出下拉電阻,在供電回路二極管D6、D7與電阻R10串聯(lián)是為了降低供給流量頭的電壓,電阻R10是防止正、負(fù)電位短路時限流。電阻R28為單片機(jī)IC2的第3腳上拉電阻。為穩(wěn)定單片機(jī)IC1的工作程序,通過電阻R31將單片機(jī)IC1的第2腳上拉,通過電阻R32將單片機(jī)IC1的第1腳上拉,通過電阻R30將單片機(jī)IC1的第7腳下拉,電容C7為掉電記憶燒錄時供電用,二極管D14為防止燒錄時電容C7回流放電。穩(wěn)壓二極管D13為穩(wěn)定供給單片機(jī)IC1第3腳掉電檢測電壓,電阻R29為檢測電壓的限流電阻,電容C5、C6為晶振OSC1的諧振電容,電容C3、C4為晶振OSC2的諧振電容,整流二極管D15-D18為降低穩(wěn)壓塊7805的功耗用。
以下為單片機(jī)IC1、IC2程序及說明
1.processor 16F873A38.MOVLW 0x212.#include<P16F873A.INC> 39.CALL LADR_0x00123._idlocs 0x1234 40.CLRF STATUS4.LRAM_0x20 equ 0x20 41.GOTO LADR_0x04E35.LRAM_0x21 equ 0x21 42.LADR_0x000F6.LRAM_0x22 equ 0x22 43.XORWF FSR,W7.LRAM_0x23 equ 0x23 44.CLRF INDF8.LRAM_0x24 equ 0x24 45.INCF FSR,F(xiàn)9.LRAM_0x25 equ 0x25 46.LADR_0x001210.LRAM_0x26 equ 0x26 47.XORWF FSR,W11.LRAM_0x27 equ 0x27 48.BTFSS STATUS,Z12.LRAM_0x28 equ 0x28 49.GOTO LADR_0x000F13.LRAM_0x29 equ 0x29 50.RETLW 0x0014.LRAM_0x2A equ 0x2A 51.LADR_0x001615.LRAM_0x2B equ 0x2B 52.ADDWF PCL,F(xiàn)16.LRAM_0x2C equ 0x2C 53.RETLW 0x3F17.LRAM_0x2D equ 0x2D 54.RETLW 0x0618.LRAM_0x2E equ 0x2E 55.RETLW 0x5B19.LRAM_0x2F equ 0x2F 56.RETLW 0x4F20.LRAM_0x30 equ 0x30 57.RETLW 0x6621.LRAM_0x31 equ 0x31 58.RETLW 0x6D22.LRAM_0x32 equ 0x32 59.RETLW 0x7D23.LRAM_0x33 equ 0x33 60.RETLW 0x0724.LRAM_0x34 equ 0x34 61.RETLW 0x7F25.Org 0x0000 62.RETLW 0x6F26.CLRF STATUS 63.RETLW 0x0027.MOVLW 0x00 64.Org 0x04D828.MOVWF PCLATH65.LADR_0x04D829.GOTO LADR_0x000566.CLRF STATUS30.RETFIE 67.MOVWF LRAM_0x3331.LADR_0x0005 68.BSF STATUS,RP132.MOVLW 0x21 69.MOVWF PIR233.MOVWF FSR 70.BSF STATUS,RP034.MOVLW 0x35 71.BCF PIR1,735.CALL LADR_0x001272.BSF PIR1,036.MOVLW 0x20 73.BCF STATUS,RP037.MOVWF FSR 74.MOVF PIR1,W
75.BCF STATUS,RP1 112.BCF STATUS,RP076.RETURN 113.BCF STATUS,RP177.LADR_0x04E3 114.BTFSC LRAM_0x20,078.CALL LADR_0x075A115.GOTO LADR_0x050179.GOTO LADR_0x04ED116.GOTO LADR_0x050280.LADR_0x04E5 117.LADR_0x050181.CLRWDT 118.GOTO LADR_0x050382.CALL LADR_0x057B119.LADR_0x050283.CALL LADR_0x0526120.BSF LRAM_0x20,084.CALL LADR_0x05E2121.LADR_0x050385.CALL LADR_0x057B122.BCF STATUS,RP186.CALL LADR_0x04EF123.BCF STATUS,RP087.CALL LADR_0x064B124.RETURN88.CALL LADR_0x06D0125.LADR_0x050689.LADR_0x04ED 126.CLRF STATUS90.GOTO LADR_0x04E5127.MOVWF LRAM_0x3491.GOTO LADR_0x0005128.BSF STATUS,RP092.LADR_0x04EF 129.BSF STATUS,RP193.BCF STATUS,RP0 130.LADR_0x050A94.BCF STATUS,RP1 131.BTFSC PIR1,195.BTFSC PORTA,5 132.GOTO LADR_0x050A96.GOTO LADR_0x04F4133.BCF STATUS,RP097.GOTO LADR_0x04F5134.BCF STATUS,RP198.LADR_0x04F4 135.MOVF LRAM_0x34,W99.GOTO LADR_0x04FC136.BSF STATUS,RP1100.LADR_0x04F5137.MOVWF PIR2101.BTFSS LRAM_0x20,0 138.BCF STATUS,RP1102.GOTO LADR_0x04F8 139.MOVF LRAM_0x33,W103.GOTO LADR_0x04F9 140.BSF STATUS,RP1104.LADR_0x04F8141.MOVWF PIR1105.GOTO LADR_0x04FB 142.BSF STATUS,RP0106.LADR_0x04F9143.BCF PIR1,7107.BSF LRAM_0x20,1 144.BCF STATUS,C108.BCF LRAM_0x20,0 145.BTFSC INTCON,GIE109.LADR_0x04FB146.BSF STATUS,C110.GOTO LADR_0x0503 147.BCF INTCON,GIE111.LADR_0x04FC148.BSF PIR1,2
149.MOVLW 0x55 186.MOVWF LRAM_0x2A150.MOVWF PIR2 187.MOVF LRAM_0x29,F(xiàn)151.MOVLW 0xAA 188.BTFSS STATUS,Z152.MOVWF PIR2 189.GOTO LADR_0x0543153.BSF PIR1,1190.GOTO LADR_0x0544154.BCF PIR1,2191.LADR_0x0543155.BTFSC STATUS,C192.GOTO LADR_0x054D156.BSF INTCON,GIE193.LADR_0x0544157.CLRF STATUS194.MOVLW 0x0A158.RETURN 195.MOVWF LRAM_0x29159.LADR_0x0526196.MOVF LRAM_0x28,F(xiàn)160.BCF STATUS,RP0197.BTFSS STATUS,Z161.BCF STATUS,RP1198.GOTO LADR_0x054A162.MOVF LRAM_0x32,W 199.GOTO LADR_0x054B163.MOVWF LRAM_0x2A200.LADR_0x054A164.MOVF LRAM_0x31,W 201.GOTO LADR_0x054D165.MOVWF LRAM_0x29202.LADR_0x054B166.MOVF LRAM_0x30,W 203.MOVLW 0x0A167.MOVWF LRAM_0x28204.MOVWF LRAM_0x28168.MOVF LRAM_0x2F,W 205.LADR_0x054D169.MOVWF LRAM_0x27206.BCF STATUS,RP0170.MOVF LRAM_0x2E,W 207.BCF STATUS,RP1171.MOVWF LRAM_0x26208.MOVF LRAM_0x23,F(xiàn)172.MOVF LRAM_0x2D,W 209.BTFSS STATUS,Z173.MOVWF LRAM_0x25210.GOTO LADR_0x0553174.MOVF LRAM_0x2C,W 211.GOTO LADR_0x0554175.MOVWF LRAM_0x24212.LADR_0x0553176.MOVF LRAM_0x2B,W 213.GOTO LADR_0x0578177.MOVWF LRAM_0x23214.LADR_0x0554178.MOVF LRAM_0x2A,F(xiàn) 215.MOVLW 0x0A179.BTFSS STATUS,Z216.MOVWF LRAM_0x23180.GOTO LADR_0x053C 217.MOVF LRAM_0x24,F(xiàn)181.GOTO LADR_0x053D 218.BTFSS STATUS,Z182.LADR_0x053C219.GOTO LADR_0x055A183.GOTO LADR_0x054D 220.GOTO LADR_0x055B184.LADR_0x053D221.LADR_0x055A185.MOVLW 0x0A 222.GOTO LADR_0x0578
223.LADR_0x055B260.MOVWF LRAM_0x27224.MOVLW 0x0A 261.LADR_0x0578225.MOVWF LRAM_0x24262.BCF STATUS,RP1226.MOVF LRAM_0x25,F(xiàn) 263.BCF STATUS,RP0227.BTFSS STATUS,Z264.RETURN228.GOTO LADR_0x0561 265.LADR_0x057B229.GOTO LADR_0x0562 266.BCF STATUS,RP0230.LADR_0x0561267.BCF STATUS,RP1231.GOTO LADR_0x0578 268.MOVF LRAM_0x22,W232.LADR_0x0562269.XORLW 0x08233.MOVLW 0x0A 270.BTFSS STATUS,Z234.MOVWF LRAM_0x25271.GOTO LADR_0x0582235.MOVF LRAM_0x26,F(xiàn) 272.GOTO LADR_0x0583236.BTFSS STATUS,Z273.LADR_0x0582237.GOTO LADR_0x0568 274.GOTO LADR_0x0584238.GOTO LADR_0x0569 275.LADR_0x0583239.LADR_0x0568276.CLRF LRAM_0x22240.GOTO LADR_0x0578 277.LADR_0x0584241.LADR_0x0569278.BCF STATUS,RP0242.MOVLW 0x0A 279.BCF STATUS,RP1243.MOVWF LRAM_0x26280.CLRF PORTC244.MOVF LRAM_0x27,F(xiàn) 281.MOVLW 0x00245.BTFSS STATUS,Z282.MOVWF PCLATH246.GOTO LADR_0x056F 283.MOVF LRAM_0x22,W247.GOTO LADR_0x0570 284.ADDLW 0x23248.LADR_0x056F285.MOVWF FSR249.GOTO LADR_0x0578 286.BCF STATUS,IRP250.LADR_0x0570287.MOVF INDF,W251.MOVF LRAM_0x28,W 288.CALL LADR_0x0016252.XORLW 0x0A 289.MOVWF PORTB253.BTFSS STATUS,Z290.MOVF LRAM_0x22,W254.GOTO LADR_0x0575 291.XORLW 0x07255.GOTO LADR_0x0576 292.BTFSS STATUS,Z256.LADR_0x0575293.GOTO LADR_0x0595257.GOTO LADR_0x0578 294.GOTO LADR_0x0596258.LADR_0x0576295.LADR_0x0595259.MOVLW 0x0A 296.GOTO LADR_0x0598
297.LADR_0x0596334.LADR_0x05B3298.MOVLW 0x7F 335.GOTO LADR_0x05B6299.MOVWF PORTC336.LADR_0x05B4300.LADR_0x0598337.MOVLW 0xEF301.BCF STATUS,RP0338.MOVWF PORTC302.BCF STATUS,RP1339.LADR_0x05B6303.MOVF LRAM_0x22,W 340.BCF STATUS,RP0304.XORLW 0x06 341.BCF STATUS,RP1305.BTFSS STATUS,Z342.MOVF LRAM_0x22,W306.GOTO LADR_0x059F 343.XORLW 0x03307.GOTO LADR_0x05A0 344.BTFSS STATUS,Z308.LADR_0x059F345.GOTO LADR_0x05BD309.GOTO LADR_0x05A2 346.GOTO LADR_0x05BE310.LADR_0x05A0347.LADR_0x05BD311.MOVLW 0xBF 348.GOTO LADR_0x05C0312.MOVWF PORTC349.LADR_0x05BE313.LADR_0x05A2350.MOVLW 0xF7314.BCF STATUS,RP0351.MOVWF PORTC315.BCF STATUS,RP1352.LADR_0x05C0316.MOVF LRAM_0x22,W 353.BCF STATUS,RP0317.XORLW 0x05 354.BCF STATUS,RP1318.BTFSS STATUS,Z355.MOVF LRAM_0x22,W319.GOTO LADR_0x05A9 356.XORLW 0x02320.GOTO LADR_0x05AA 357.BTFSS STATUS,Z321.LADR_0x05A9358.GOTO LADR_0x05C7322.GOTO LADR_0x05AC 359.GOTO LADR_0x05C8323.LADR_0x05AA360.LADR_0x05C7324.MOVLW 0xDF 361.GOTO LADR_0x05CA325.MOVWF PORTC362.LADR_0x05C8326.LADR_0x05AC363.MOVLW 0xFB327.BCF STATUS,RP0364.MOVWF PORTC328.BCF STATUS,RP1365.LADR_0x05CA329.MOVF LRAM_0x22,W 366.BCF STATUS,RP0330.XORLW 0x04 367.BCF STATUS,RP1331.BTFSS STATUS,Z368.DECF LRAM_0x22,W332.GOTO LADR_0x05B3 369.BTFSS STATUS,Z333.GOTO LADR_0x05B4 370.GOTO LADR_0x05D0
371.GOTO LADR_0x05D1 408.MOVWF LRAM_0x32372.LADR_0x05D0409.MOVLW 0x06373.GOTO LADR_0x05D3 410.CALL LADR_0x04D8374.LADR_0x05D1411.MOVWF LRAM_0x31375.MOVLW 0xFD 412.MOVLW 0x05376.MOVWF PORTC413.CALL LADR_0x04D8377.LADR_0x05D3414.MOVWF LRAM_0x30378.BCF STATUS,RP0415.MOVLW 0x04379.BCF STATUS,RP1416.CALL LADR_0x04D8380.MOVF LRAM_0x22,F(xiàn) 417.MOVWF LRAM_0x2F381.BTFSS STATUS,Z418.MOVLW 0x03382.GOTO LADR_0x05D9 419.CALL LADR_0x04D8383.GOTO LADR_0x05DA 420.MOVWF LRAM_0x2E384.LADR_0x05D9421.MOVLW 0x02385.GOTO LADR_0x05DC 422.CALL LADR_0x04D8386.LADR_0x05DA423.MOVWF LRAM_0x2D387.MOVLW 0xFE 424.MOVLW 0x01388.MOVWF PORTC425.CALL LADR_0x04D8389.LADR_0x05DC426.MOVWF LRAM_0x2C390.BCF STATUS,RP0427.MOVLW0x00391.BCF STATUS,RP1428.CALL LADR_0x04D8392.INCF LRAM_0x22,F(xiàn) 429.MOVWF LRAM_0x2B393.BCF STATUS,RP1430.LADR_0x0601394.BCF STATUS,RP0431.BCF STATUS,RP0395.RETURN 432.BCF STATUS,RP1396.LADR_0x05E2433.BTFSS LRAM_0x20,1397.BCF STATUS,RP0434.GOTO LADR_0x0606398.BCF STATUS,RP1435.GOTO LADR_0x0607399.BTFSS LRAM_0x20,2 436.LADR_0x0606400.GOTO LADR_0x05E7 437.GOTO LADR_0x0648401.GOTO LADR_0x05E8 438.LADR_0x0607402.LADR_0x05E7439.BCF LRAM_0x20,1403.GOTO LADR_0x0601 440.INCF LRAM_0x32,F(xiàn)404.LADR_0x05E8441.MOVF LRAM_0x32,W405.BCF LRAM_0x20,2 442.XORLW 0x0A406.MOVLW_0x07 443.BTFSS STATUS,Z407.CALL LADR_0x04D8 444.GOTO LADR_0x060E
445.GOTO LADR_0x060F 482.XORLW 0x0A446.LADR_0x060E483.BTFSS STATUS,Z447.GOTO LADR_0x0648 484.GOTO LADR_0x062E448.LADR_0x060F485.GOTO LADR_0x062F449.CLRF LRAM_0x32 486.LADR_0x062E450.INCF LRAM_0x31,F(xiàn) 487.GOTO LADR_0x0648451.MOVF LRAM_0x31,W 488.LADR_0x062F452.XORLW 0x0A 489.CLRF LRAM_0x2E453.BTFSS STATUS,Z490.INCF LRAM_0x2D,F(xiàn)454.GOTO LADR_0x0616 491.MOVF LRAM_0x2D,W455.GOTO LADR_0x0617 492.XORLW 0x0A456.LADR_0x0616493.BTFSS STATUS,Z457.GOTO LADR_0x0648 494.GOTO LADR_0x0636458.LADR_0x0617495.GOTO LADR_0x0637459.CLRF LRAM_0x31 496.LADR_0x0636460.INCF LRAM_0x30,F(xiàn) 497.GOTO LADR_0x0648461.MOVF LRAM_0x30,W 498.LADR_0x0637462.XORLW 0x0A 499.CLRF LRAM_0x2D463.BTFSS STATUS,Z500.INCF LRAM_0x2C,F(xiàn)464.GOTO LADR_0x061E 501.MOVF LRAM_0x2C,W465.GOTO LADR_0x061F 502.XORLW 0x0A466.LADR_0x061E503.BTFSS STATUS,Z467.GOTO LADR_0x0648 504.GOTO LADR_0x063E468.LADR_0x061F505.GOTO LADR_0x063F469.CLRF LRAM_0x30 506.LADR_0x063E470.INCF LRAM_0x2F,F(xiàn) 507.GOTO LADR_0x0648471.MOVF LRAM_0x2F,W 508.LADR_0x063F472.XORLW 0x0A 509.CLRF LRAM_0x2C473.BTFSS STATUS,Z510.INCF LRAM_0x2B,F(xiàn)474.GOTO LADR_0x0626 511.MOVF LRAM_0x2B,W475.GOTO LADR_0x0627 512.XORLW 0x0A476.LADR_0x0626513.BTFSS STATUS,Z477.GOTO LADR_0x0648 514.GOTO LADR_0x0646478.LADR_0x0627515.GOTO LADR_0x0647479.CLRF LRAM_0x2F 516.LADR_0x0646480.INCF LRAM_0x2E,F(xiàn) 517.GOTO LADR_0x0648481.MOVF LRAM_0x2E,W 518.LADR_0x0647
519.CLRF LRAM_0x2B 556.LADR_0x0665520.LADR_0x0648557.BCF STATUS,RP0521.BCF STATUS,RP1558.BCF STATUS,RP1522.BCF STATUS,RP0559.CLRF LRAM_0x33523.RETURN 560.MOVLW 0x07524.LADR_0x064B561.CALL LADR_0x0506525.BCF STATUS,RP0562.GOTO LADR_0x066C526.BCF STATUS,RP1563.LADR_0x066B527.BTFSC PORTA,0 564.CLRWDT528.GOTO LADR_0x0650 565.LADR_0x066C529.GOTO LADR_0x0651 566.BSF STATUS,RP0530.LADR_0x0650567.BSF STATUS,RP1531.GOTO LADR_0x06CD 568.BTFSC PIR1,1532.LADR_0x0651569.GOTO LADR_0x0671533.CLRF LRAM_0x32 570.GOTO LADR_0x0672534.CLRF LRAM_0x31 571.LADR_0x0671535.CLRF LRAM_0x30 572.GOTO LADR_0x066B536.CLRF LRAM_0x2F 573.LADR_0x0672537.CLRF LRAM_0x2E 574.BCF STATUS,RP0538.CLRF LRAM_0x2D 575.BCF STATUS,RP1539.CLRF LRAM_0x2C 576.CLRF LRAM_0x33540.CLRF LRAM_0x2B 577.MOVLW 0x06541.MOVLW 0xAA 578.CALL LADR_0x0506542.MOVWF LRAM_0x33579.GOTO LADR_0x0679543.MOVLW 0x08 580.LADR_0x0678544.CALL LADR_0x0506 581.CLRWDT545.GOTO LADR_0x065F 582.LADR_0x0679546.LADR_0x065E583.BSF STATUS,RP0547.CLRWDT 584.BSF STATUS,RP1548.LADR_0x065F585.BTFSC PIR1,1549.BSF STATUS,RP0586.GOTO LADR_0x067E550.BSF STATUS,RP1587.GOTO LADR_0x067F551.BTFSC PIR1,1 588.LADR_0x067E552.GOTO LADR_0x0664 589.GOTO LADR_0x0678553.GOTO LADR_0x0665 590.LADR_0x067F554.LADR_0x0664591.BCF STATUS,RP0555.GOTO LADR_0x065E 592.BCF STATUS,RP1
593.CLRF LRAM_0x33 630.GOTO LADR_0x06A0594.MOVLW 0x05 631.LADR_0x069F595.CALL LADR_0x0506 632.CLRWDT596.GOTO LADR_0x0686 633.LADR_0x06A0597.LADR_0x0685634.BSF STATUS,RP0598.CLRWDT 635.BSF STATUS,RP1599.LADR_0x0686636.BTFSC PIR1,1600.BSF STATUS,RP0637.GOTO LADR_0x06A5601.BSF STATUS,RP1638.GOTO LADR_0x06A6602.BTFSC PIR1,1 639.LADR_0x06A5603.GOTO LADR_0x068B 640.GOTO LADR_0x069F604.GOTO LADR_0x068C 641.LADR_0x06A6605.LADR_0x068B642.BCF STATUS,RP0606.GOTO LADR_0x0685 643.BCF STATUS,RRP1607.LADR_0x068C644.CLRF LRAM_0x33608.BCF STATUS,RP0645.MOVLW 0x02609.BCF STATUS,RP1646.CALL LADR_0x0506610.CLRF LRAM_0x33 647.GOTO LADR_0x06AD611.MOVLW 0x04 648.LADR_0x06AC612.CALL LADR_0x0506 649.CLRWDT613.GOTO LADR_0x0693 650.LADR_0x06AD614.LADR_0x0692651.BSF STATUS,RP0615.CLRWDT 652.BSF STATUS,RP1616.LADR_0x0693653.BTFSC PIR1,1617.BSF STATUS,RP0654.GOTO LADR_0x06B2618.BSF STATUS,RP1655.GOTO LADR_0x06B3619.BTFSC PIR1,1 656.LADR_0x06B2620.GOTO LADR_0x0698 657.GOTO LADR_0x06AC621.GOTO LADR_0x0699 658.LADR_0x06B3622.LADR_0x0698659.BCF STATUS,RP0623.GOTO LADR_0x0692 660.BCF STATUS,RP1624.LADR_0x0699661.CLRF LRAM_0x33625.BCF STATUS,RP0662.MOVLW 0x01626.BCF STATUS,RP1663.CALL LADR_0x0506627.CLRF LRAM_0x33 664.GOTO LADR_0x06BA628.MOVLW 0x03 665.LADR_0x06B9629.CALL LADR_0x0506 666.CLRWDT
667.LADR_0x06BA704.LADR_0x06D6668.BSF STATUS,RP0705.MOVF LRAM_0x32,W669.BSF STATUS,RP1706.MOVWF LRAM_0x21670.BTFSC PIR1,1 707.MOVF LRAM_0x21,W671.GOTO LADR_0x06BF 708.MOVWF LRAM_0x33672.GOTO LADR_0x06C0 709.MOVLW 0x07673.LADR_0x06BF710.CALL LADR_0x0506674.GOTO LADR_0x06B9 711.GOTO LADR_0x06DE675.LADR_0x06C0712.LADR_0x06DD676.BCF STATUS,RP0713.CLRWDT677.BCF STATUS,RP1714.LADR_0x06DE678.CLRF LRAM_0x33 715.BSF STATUS,RP0679.MOVLW 0x00 716.BSF STATUS,RP1680.CALL LADR_0x0506 717.BTFSC PIR1,1681.GOTO LADR_0x06C7 718.GOTO LADR_0x06E3682.LADR_0x06C6719.GOTO LADR_0x06E4683.CLRWDT 720.LADR_0x06E3684.LADR_0x06C7721.GOTO LADR_0x06DD685.BSF STATUS,RP0722.LADR_0x06E4686.BSF STATUS,RP1723.BCF STATUS,RP0687.BTFSC PIR1,1 724.BCF STATUS,RP1688.GOTO LADR_0x06CC 725.MOVF LRAM_0x31,W689.GOTO LADR_0x06CD 726.MOVWF LRAM_0x21690.LADR_0x06CC727.MOVF LRAM_0x21,W691.GOTO LADR_0x06C6 728.MOVWF LRAM_0x33692.LADR_0x06CD729.MOVLW 0x06693.BCF STATUS,RP1730.CALL LADR_0x0506694.BCF STATUS,RP0731.GOTO LADR_0x06EE695.RETURN 732.LADR_0x06ED696.LADR_0x06D0733.CLRWDT697.BCF STATUS,RP0734.LADR_0x06EE698.BCF STATUS,RP1735.BSF STATUS,RP0699.BTFSC PORTA,1 736.BSF STATUS,RP1700.GOTO LADR_0x06D5 737.BTFSC PIR1,1701.GOTO LADR_0x06D6 738.GOTO LADR_0x06F3702.LADR_0x06D5739.GOTO LADR_0x06F4703.GOTO LADR_0x0757 740.LADR_0x06F3
741.GOTO LADR_0x06ED 778.GOTO LADR_0x0713742.LADR_0x06F4779.GOTO LADR_0x0714743.BCF STATUS,RP0780.LADR_0x0713744.BCF STATUS,RP1781.GOTO LADR_0x070D745.MOVF LRAM_0x30,W 782.LADR_0x0714746.MOVWF LRAM_0x21783.BCF STATUS,RP0747.MOVF LRAM_0x21,W 784.BCF STATUS,RP1748.MOVWF LRAM_0x33785.MOVF LRAM_0x2E,W749.MOVLW 0x05 786.MOVWF LRAM_0x21750.CALL LADR_0x0506 787.MOVF LRAM_0x21,W751.GOTO LADR_0x06FE 788.MOVWF LRAM_0x33752.LADR_0x06FD789.MOVLW 0x03753.CLRWDT 790.CALL LADR_0x0506754.LADR_0x06FE791.GOTO LADR_0x071E755.BSF STATUS,RP0792.LADR_0x071D756.BSF STATUS,RP1793.CLRWDT757.BTFSC PIR1,1 794.LADR_0x071E758.GOTO LADR_0x0703 795.BSF STATUS,RP0759.GOTO LADR_0x0704 796.BSF STATUS,RP1760.LADR_0x0703797.BTFSC PIR1,1761.GOTO LADR_0x06FD 798.GOTO LADR_0x0723762.LADR_0x0704799.GOTO LADR_0x0724763.BCF STATUS,RP0800.LADR_0x0723764.BCF STATUS,RP1801.GOTO LADR_0x071D765.MOVF LRAM_0x2F,W 802.LADR_0x0724766.MOVWF LRAM_0x21803.BCF STATUS,RP0767.MOVF LRAM_0x21,W 804.BCF STATUS,RP1768.MOVWF LRAM_0x33805.MOVF LRAM_0x2D,W769.MOVLW 0x04 806.MOVWF LRAM_0x21770.CALL LADR_0x0506 807.MOVF LRAM_0x21,W771.GOTO LADR_0x070E 808.MOVWF LRAM_0x33772.LADR_0x070D809.MOVLW 0x02773.CLRWDT 810.CALL LADR_0x0506774.LADR_0x070E811.GOTO LADR_0x072E775.BSF STATUS,RP0812.LADR_0x072D776.BSF STATUS,RP1813.CLRWDT777.BTFSC PIR1,1 814.LADR_0x072E
815.BSF STATUS,RP0852.LADR_0x074D816.BSF STATUS,RP1853.CLRWDT817.BTFSC PIR1,1 854.LADR_0x074E818.GOTO LADR_0x0733 855.BSF STATUS,RP0819.GOTO LADR_0x0734 856.BSF STATUS,RP1820.LADR_0x0733857.BTFSC PIR1,1821.GOTO LADR_0x072D 858.GOTO LADR_0x0753822.LADR_0x0734859.GOTO LADR_0x0754823.BCF STATUS,RP0860.LADR_0x0753824.BCF STATUS,RP1861.GOTO LADR_0x074D825.MOVF LRAM_0x2C,W 862.LADR_0x0754826.MOVWF LRAM_0x21863.BCF STATUS,RP0827.MOVF LRAM_0x21,W 864.BCF STATUS,RP1828.MOVWF LRAM_0x33865.BSF LRAM_0x20,2829.MOVLW 0x01 866.LADR_0x0757830.CALL LADR_0x0506 867.BCF STATUS,RP1831.GOTO LADR_0x073E 868.BCF STATUS,RP0832.LADR_0x073D869.RETURN833.CLRWDT 870.LADR_0x075A834.LADR_0x073E871.MOVLW 0xFF835.BSF STATUS,RP0872.BSF STATUS,RP0836.BSF STATUS,RP1873.BCF STATUS,RP1837.BTFSC PIR1,1 874.MOVWF PORTA838.GOTO LADR_0x0743 875.CLRF PORTB839.GOTO LADR_0x0744 876.CLRF PORTC840.LADR_0x0743877.MOVLW 0x06841.GOTO LADR_0x073D 878.MOVWF ADCON0842.LADR_0x0744879.BCF STATUS,RP0843.BCF STATUS,RP0880.BCF LRAM_0x20,2844.BCF STATUS,RP1881.BSF STATUS,RP0845.MOVF LRAM_0x2B,W 882.BSF TMR0,2846.MOVWF LRAM_0x21883.BSF TMR0,1847.MOVF LRAM_0x21,W 884.BSF TMR0,0848.MOVWF LRAM_0x33885.MOVLW 0x08849.MOVLW 0x00 886.CALL LADR_0x04D8850.CALL LADR_0x0506 887.MOVWF LRAM_0x21851.GOTO LADR_0x074E 888.MOVF LRAM_0x21,W
889.XORLW 0xAA 926.LADR_0x0789890.BTFSC STATUS,Z927.GOTO LADR_0x0783891.GOTO LADR_0x0770 928.LADR_0x078A892.GOTO LADR_0x0771 929.BCF STATUS,RP0893.LADR_0x0770930.BCF STATUS,RP1894.GOTO LADR_0x07E5 931.CLRF LRAM_0x33895.LADR_0x0771932.MOVLW 0x06896.MOVLW 0xAA 933.CALL LADR_0x0506897.MOVWF LRAM_0x33934.GOTO LADR_0x0791898.MOVLW 0x08 935.LADR_0x0790899.CALL LADR_0x0506 936.CLRWDT900.GOTO LADR_0x0777 937.LADR_0x0791901.LADR_0x0776938.BSF STATUS,RP0902.CLRWDT 939.BSF STATUS,RP1903.LADR_0x0777940.BTFSC PIR1,1904.BSF STATUS,RP0941.GOTO LADR_0x0796905.BSF STATUS,RP1942.GOTO LADR_0x0797906.BTFSC PIR1,1 943.LADR_0x0796907.GOTO LADR_0x077C 944.GOTO LADR_0x0790908.GOTO LADR_0x077D 945.LADR_0x0797909.LADR_0x077C946.BCF STATUS,RP0910.GOTO LADR_0x0776 947.BCF STATUS,RP1911.LADR_0x077D948.CLRF LRAM_0x33912.BCF STATUS,RP0949.MOVLW 0x05913.BCF STATUS,RP1950.CALL LADR_0x0506914.CLRF LRAM_0x33 951.GOTO LADR_0x079E915.MOVLW 0x07 952.LADR_0x079D916.CALL LADR_0x0506 953.CLRWDT917.GOTO LADR_0x0784 954.LADR_0x079E918.LADR_0x0783955.BSF STATUS,RP0919.CLRWDT 956.BSF STATUS,RP1920.LADR_0x0784957.BTFSC PIR1,1921.BSF STATUS,RP0958.GOTO LADR_0x07A3922.BSF STATUS,RP1959.GOTO LADR_0x07A4923.BTFSC PIR1,1 960.LADR_0x07A3924.GOTO LADR_0x0789 961.GOTO LADR_0x079D925.GOTO LADR_0x078A 962.LADR_0x07A4
963.BCF STATUS,RP01000.MOVLW 0x02964.BCF STATUS,RP11001.CALL LADR_0x0506965.CLRF LRAM_0x33 1002.GOTO LADR_0x07C5966.MOVLW 0x04 1003.LADR_0x07C4967.CALL LADR_0x0506 1004.CLRWDT968.GOTO LADR_0x07AB 1005.LADR_0x07C5969.LADR_0x07AA1006.BSF STATUS,RP0970.CLRWDT 1007.BSF STATUS,RP1971.LADR_0x07AB1008.BTFSC PIR1,1972.BSF STATUS,RP01009.GOTO LADR_0x07CA973.BSF STATUS,RP11010.GOTO LADR_0x07CB974.BTFSC PIR1,1 1011.LADR_0x07CA975.GOTO LADR_0x07B0 1012.GOTO LADR_0x07C4976.GOTO LADR_0x07B1 1013.LADR_0x07CB977.LADR_0x07B01014.BCF STATUS,RP0978.GOTO LADR_0x07AA 1015.BCF STATUS,RP1979.LADR_0x07B11016.CLRF LRAM_0x33980.BCF STATUS,RP01017.MOVLW 0x01981.BCF STATUS,RP11018.CALL LADR_0x0506982.CLRF LRAM_0x33 1019.GOTO LADR_0x07D2983.MOVLW 0x03 1020.LADR_0x07D1984.CALL LADR_0x0506 1021.CLRWDT985.GOTO LADR_0x07B8 1022.LADR_0x07D2986.LADR_0x07B71023.BSF STATUS,RP0987.CLRWDT 1024.BSF STATUS,RP1988.LADR_0x07B81025.BTFSC PIR1,1989.BSF STATUS,RP01026.GOTO LADR_0x07D7990.BSF STATUS,RP11027.GOTO LADR_0x07D8991.BTFSC PIR1,1 1028.LADR_0x07D7992.GOTO LADR_0x07BD 1029.GOTO LADR_0x07D1993.GOTO LADR_0x07BE 1030.LADR_0x07D8994.LADR_0x07BD1031.BCF STATUS,RP0995.GOTO LADR_0x07B7 1032.BCF STATUS,RP1996.LADR_0x07BE1033.CLRF LRAM_0x33997.BCF STATUS,RP01034.MOVLW 0x00998.B CF STATUS,RP1 1035.CALL LADR_0x0506999.CLRF LRAM_0x33 1036.GOTO LADR_0x07DF
1037.LADR_0x07DE 1074.RETURN1038.CLRWDT1075.End1039.LADR_0x07DF 程序說明1040.BSF STATUS,RP0 1-24微控制器型號定義1041.BSF STATUS,RP1 25復(fù)位矢量在0000h1042.BTFSC PIR1,1 26-63中斷矢量為0004h1043.GOTO LADR_0x07E4 64-135 MPLAB提供的定義1044.GOTO LADR_0x07E5 136_161入口地址ACCB-ACCA,出口地址1045.LADR_0x07E4 ACCB1046.GOTO LADR_0x07DE 162-190跳指令和一些必要的現(xiàn)場保護(hù)程序1047.LADR_0x07E5 191-280加法子程序求和1048.MOVLW 0x07281-376段產(chǎn)生和校驗(yàn)的子程序1049.CALL LADR_0x04D8 377-391保護(hù)W寄存器1050.MOVWF LRAM_0x32 392-431保護(hù)STATUS寄存器1051.MOVLW 0x06432-490判斷DATA1 3與DATA1 1不等01052.CALL LADR_0x04D8 491-535采樣次數(shù)計(jì)數(shù)1053.MOVWF LRAM_0x31 536-569 ACCa~ACCd運(yùn)算寄存器1054.MOVLW 0x05570-597暫存W寄存器值1055.CALL LADR_0x04D8 598-613暫存STATUS寄存器值1056.MOVWF LRAM_0x30 614-661 TMR1預(yù)分頻為1,關(guān)閉振蕩器,1057.MOVLW 0x04工作于定時工作方式1058.CALL LADR_0x04D8 662-679初始化采樣周期寄存器1059.MOVWF LRAM_0x2F 680-701調(diào)用電壓保護(hù)子程序1060.MOVLW 0x03702-719清相應(yīng)的標(biāo)志位1061.CALL LADR_0x04D8 720-733采樣送寄存器暫存1062.MOVWF LRAM_0x2E 734-765顯示地址存儲寄存器1063.MOVLW 0x02766-788顯示第1次讀第1幀數(shù)據(jù)存儲寄存器1064.CALL LADR_0x04D8 789-812顯示第2次讀第1幀數(shù)據(jù)存儲寄存器1065.MOVWF LRAM_0x2D 813-836顯示第3次讀第1幀數(shù)據(jù)存儲寄存器1066.MOVLW 0x01837-860顯示第4次讀第1幀數(shù)據(jù)存儲寄存器1067.CALL LADR_0x04D8 861-865顯示第5次讀第1幀數(shù)據(jù)存儲寄存器1068.MOVWF LRAM_0x2C 866-889顯示第6次讀第1幀數(shù)據(jù)存儲寄存器1069.MOVLW 0x00890-916顯示第7次讀第2幀數(shù)據(jù)存儲寄存器1070.CALL LADR_0x04D8 917-940顯示第8次讀第1幀數(shù)據(jù)存儲寄存器1071.MOVWF LRAM_0x2B 941-965讀數(shù)據(jù)標(biāo)志寄存器1072.BCF STATUS,RP1 966-987延時程序計(jì)數(shù)寄存器1073.BCF STATUS,RP0 988-991 16位二進(jìn)制數(shù)高8位
890-916顯示第7次讀第2幀數(shù)據(jù)存儲寄存器917-940顯示第8次讀第1幀數(shù)據(jù)存儲寄存器941-965讀數(shù)據(jù)標(biāo)志寄存器966-987延時程序計(jì)數(shù)寄存器988-991 16位二進(jìn)制數(shù)高8位992-999 16位二進(jìn)制數(shù)低8位1000-1012 BCD碼存儲寄存器(高位)1013-1026 BCD碼存儲寄存器1027-1039 BCD碼存儲寄存器(低位)1040-1047讀到的5次數(shù)據(jù)有4次相等標(biāo)志寄存器1048-1073調(diào)整后BCD碼存儲寄存器,BCD碼調(diào)整臨時存數(shù)寄存器1074程序返回重新開始1075程序結(jié)束
1.processor 16HV54038.TRIS 52.#include<P16HV540.INC> 39.MOVLW 0x0F3.LRAM_0x09 equ 0x09 40.TRIS 64.LRAM_0x0A equ 0x0A 41.LADR_0x001D5.LRAM_0x0B equ 0x0B 42.CLRWDT6.LRAM_0x0C equ 0x0C 43.CALL LADR_0x006A7.LRAM_0x0D equ 0x0D 44.BTFSC PORTB,08.LRAM_0x0E equ 0x0E 45.GOTO LADR_0x002B9.LRAM_0x1F equ 0x1F 46.CALL LADR_0x006010.Org 0x0000 47.BTFSC PORTB,011.NOP 48.GOTO LADR_0x002B12.NOP 49.BTFSC PORTB,113.NOP 50.GOTO LADR_0x002B14.NOP 51.CALL LADR_0x006015.NOP 52.BTFSC PORTB,116.MOVLW 0x18 53.GOTO LADR_0x002B17.MOVWF STATUS54.BCF LRAM_0x0E,418.MOVLW 0x16 55.GOTO LADR_0x002D19.MOVWF LRAM_0x1F 56.LADR_0x002B20.MOVLW 0x08 57.BSF LRAM_0x0E,421.MOVWF FSR 58.GOTO LADR_0x002D22.LADR_0x000B 59.LADR_0x002D23.CLRF INDF 60.BTFSC PORTB,224.INCF FSR,F(xiàn) 61.GOTO LADR_0x003925.DECFSZ LRAM_0x1F,F(xiàn) 62.CALL LADR_0x006026.GOTO LADR_0x000B63.BTFSC PORTB,227.MOVLW 0x05 64.GOTO LADR_0x003928.MOVWF LRAM_0x0A 65.BTFSC PORTB,329.MOVLW 0xC3 66.GOTO LADR_0x003930.MOVWF LRAM_0x0C 67.CALL LADR_0x006031.MOVLW 0x0A 68.BTFSC PORTB,332.MOVWF LRAM_0x0B 69.GOTO LADR_0x003933.MOVLW 0x06 70.BCF LRAM_0x0E,534.OPTION 71.GOTO LADR_0x003B35.MOVLW 0x1F 72.LADR_0x003936.TRIS 7 73.BSF LRAM_0x0E,537.MOVLW 0x04 74.GOTO LADR_0x003B
75.LADR_0x003B 112.GOTO LADR_0x001D76.CALL LADR_0x006A113.LADR_0x005B77.BTFSC LRAM_0x0E,4 114.BSF LRAM_0x0E,078.GOTO LADR_0x0048115.BCF PORTA,079.BTFSC LRAM_0x0E,5 116.BCF PORTA,180.GOTO LADR_0x0048117.BCF PORTA,381.BCF PORTA,0118.GOTO LADR_0x001D82.BCF PORTA,1119.LADR_0x006083.BTFSS PORTA,2 120.MOVLW 0x2884.GOTO LADR_0x0046121.MOVWF LRAM_0x1F85.BCF PORTA,3122.LADR_0x006286.GOTO LADR_0x001D123.NOP87.LADR_0x0046 124.NOP88.BSF PORTA,3125.NOP89.GOTO LADR_0x001D126.NOP90.LADR_0x0048 127.CALL LADR_0x006A91.CALL LADR_0x006A128.DECFSZ LRAM_0x1F,F(xiàn)92.BTFSS LRAM_0x09,4 129.GOTO LADR_0x006293.GOTO LADR_0x001D130.RETLW 0x0094.BCF LRAM_0x09,4131.LADR_0x006A95.BTFSS LRAM_0x0E,0 132.CLRWDT96.GOTO LADR_0x005B133.MOVF LRAM_0x0D,W97.BCF LRAM_0x0E,0134.SUBWF TMR0,W98.BSF PORTA,3135.BTFSS STATUS,C99.BTFSS LRAM_0x0E,4 136.GOTO LADR_0x0072100.GOTO LADR_0x0054 137.MOVF TMR0,W101.BSF PORTA,0 138.MOVWF LRAM_0x0D102.GOTO LADR_0x0055 139.RETLW 0x00103.LADR_0x0054140.LADR_0x0072104.BCF PORTA,0 141.MOVF TMR0,W105.LADR_0x0055142.MOVWF LRAM_0x0D106.BTFSS LRAM_0x0E,5 143.DECFSZ LRAM_0x0A,F(xiàn)107.GOTO LADR_0x0059 144.GOTO LADR_0x0079108.BSF PORTA,1 145.BSF LRAM_0x09,4109.GOTO LADR_0x001D 146.MOVLW 0x05110.LADR_0x0059147.MOVWF LRAM_0x0A111.BCF PORTA,1 148.LADR_0x0079
149.RETLW 0x00150.End程序說明1-9微控制器型號10-15復(fù)位矢量在0000h16中斷矢量為0004h17-21初始化STATUS22-35定時器0置初值36-51預(yù)分頻器分配給TMR0分頻12852-68 OPTION2變化69-76溢出打開77-108每128*256=32768us中斷1次109-135溢出位TB_0固定初值TIME0_VAL=7136-148 STATUS_RAM狀態(tài)控制寄存器149程序返回重新開始150程序結(jié)束
權(quán)利要求1.一種三防電子水表,由安裝在室內(nèi)管路中的霍爾集成塊、磁信號輪及阻、容元件構(gòu)成了流量脈沖發(fā)生器—流量頭 ,通過信號線電連接室外儀表內(nèi),儀表內(nèi)由信號過電壓保護(hù)回路,開路檢測回路,短路檢測回路,單片機(jī)IC2中選通振蕩I、II,整形放大程序,單片機(jī)IC1中動態(tài)掃描十進(jìn)制計(jì)數(shù)程序,并和數(shù)碼管電連結(jié)構(gòu)成;其特征是由串聯(lián)在信號線和正電位上的速熔保險(xiǎn)管及并接在信號線正、負(fù)電位上的穩(wěn)壓二極管及壓敏電阻,電連接構(gòu)成信號線過電壓保護(hù)回路,由電壓比較器(LM324)的各電壓取樣點(diǎn)接在由電阻串聯(lián)組成的分壓點(diǎn)上,電壓比較器(LM324)的各比較電壓點(diǎn)經(jīng)限流電阻分別對信號線的正、負(fù)及信號線取樣比較,由此構(gòu)成對信號線短路、開路檢測,信號線呈非正常狀態(tài)時,電壓比較器(LM324)的各輸出端向單片機(jī)IC2輸入高電位,使單片機(jī)IC2中選通振蕩I、II程序工作,產(chǎn)生流量處罰脈沖并送入單片機(jī)IC1的信號輸入端使其按程序進(jìn)行處罰計(jì)數(shù),同時接在IC2單片機(jī)的17、18腳向紅色發(fā)光二極管輸出告警脈沖。
2.根據(jù)權(quán)利要求1所述的三防電子水表,其特征是由速熔保險(xiǎn)管BX1、BX2、BX3、BX4,穩(wěn)壓二極管D1、D2、D3、D4、D5,壓敏電阻R5、R6、R7、R8、R9電連接構(gòu)成信號線過電壓保護(hù)回路。
3.根據(jù)權(quán)利要求1所述的三防電子水表,其特征是由電壓比較器(LM324)中的I、III,電阻R12、R15、R16、R18、R21、R23、R20、R25及單片機(jī)IC2中的選通振蕩I程序電連接構(gòu)成信號線開路模擬流量處罰回路。
4.根據(jù)權(quán)利要求1所述的三防電子水表,其特征是由電壓比較器(LM324)中的II、IV,電阻R11、R13、R14、R19、R17、R0、R22、R24,及單片機(jī)IC2中的選通振蕩II程序電連接構(gòu)成信號線短路模擬流量處罰回路。
專利摘要一種能戶外集中安裝,對信號線具有非正常檢測,并具有防竊水功能,不受停電和天氣影響,能和微機(jī)聯(lián)網(wǎng)方便抄表的三防電子水表。它由安裝在戶內(nèi)管道中的感應(yīng)流量脈沖發(fā)生器,經(jīng)信號線到儀表中過電壓保護(hù)、開路、短路檢測無誤后,送入整形、放大程序,經(jīng)動態(tài)掃描十進(jìn)制計(jì)數(shù)程序計(jì)數(shù),并由數(shù)碼管顯示。如信號線呈非正常狀態(tài)時,由程序選通振蕩I,選通振蕩II經(jīng)整形放大,向動態(tài)掃描十進(jìn)制計(jì)數(shù)程序送流量處罰脈沖。整機(jī)由可充電池和硅光電池供電。
文檔編號G01F1/56GK2729650SQ20042008740
公開日2005年9月28日 申請日期2004年7月30日 優(yōu)先權(quán)日2004年7月30日
發(fā)明者靳太平 申請人:靳太平