【正文】
B0 0 0 0 0 0 0 0 0 0 1↓檢查忙標志或延時40 us RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 0 0 0 0 0 0 0 1 I/D S↓ 初 始 化 結(jié) 束↓檢查忙標志或延時40 圖211 八位接口初始化流程圖三、軟件設(shè)計(一)程序流程圖開 始系統(tǒng)初始化頻率測量量程自動轉(zhuǎn)換有效數(shù)位判別測量數(shù)據(jù)顯示開 始浮點數(shù)到BCD碼中斷服務程序周期測量f=1/T浮點數(shù)格式化圖31 數(shù)字頻率計程序流程圖(二)匯編語言源程序RS BIT ; RW BIT ; E BIT ; ORG 0000H LJMP MAIN ORG 002BH LJMP IT1MAIN:MOV P0,01H 。寫數(shù)據(jù) A2: MOV A, R1 MOV A, A+DPTR CALL WRITE2 INC R1 CJNE A,00H,A2 RET DELY: MOV R7, 255 D1: MOV R6, 255 D2: DJNZ R6, D2 DJNZ R7, D1 RET DATE: DB THE FREQUENCY IS,00H DATA1: DB 30H,31H,32H,33H,34H,35H,36H,37H,38H,39HDANWEI1: DB HZ ,00HDANWEI2: DB KHZ ,00H XIAOSHUDIAN: DB .,00HEND四、總結(jié)本文介紹了使用單片機系統(tǒng)和匯編語言設(shè)計數(shù)字頻率計的方法,并下載到單片機中組成實際電路,這樣可以簡化硬件的開發(fā)和制造過程,而且使硬件體積大大縮小,并提高了系統(tǒng)的可靠性。在此,我忠心感謝王棟老師的指導和支持。LCD顯示。 指令10:寫數(shù)據(jù)。1602液晶模塊內(nèi)帶標準字庫,內(nèi)部的字符發(fā)生存儲器(CGROM)已經(jīng)存儲了192個57點陣字符,32個510點陣字符。此器件可用作移位寄存器,且通過將Q非輸出連接到數(shù)據(jù)輸入,可用作計數(shù)器和觸發(fā)器。為了使單片機能夠有效的傳送外部數(shù)據(jù)存儲器從0000H到FFFH單元的指令,必須同GND相連接。P3口的輸出緩沖能驅(qū)動4個TTL邏輯門電路。在這種模式下,P0口具有內(nèi)部上拉電阻。它以測量周期的方法對正弦波、方波、三角波的頻率進行自動的測量。這種系統(tǒng)成本低廉,結(jié)構(gòu)簡單,常構(gòu)成一些簡單的控制系統(tǒng)。本文闡述了用單片機系統(tǒng)和匯編語言設(shè)計了一個簡單的數(shù)字頻率計的過程。【關(guān)鍵詞】:直接測頻、間接測頻ABSTRACTIn electronics, the frequency is the most basic parameters of electrical parameters, and many of the measurement system, the measurement results are very close relationship, therefore frequency measurement bees even more important. There are many methods of measuring frequency, including electronic counter measure frequency with high precision, use convenient, quick, and easy to realize measure measurement process automation etc, and is one of the important methods of frequency measurements. Electronic counter measure frequency in two ways: one is the direct frequency measurement method, that is, in a certain gate time measuring signal pulse number, Second is the indirect method of frequency measurement method, such as frequency measurement cycle. Direct frequency measurement method for highfrequency signal frequency measurement, indirect measuring frequency act applies to the low frequency signal frequency measurement. This paper using SCM system and assembly language design a simple digital frequency of process.【KEY WORD】:Direct frequency measurement、Indirect measuring frequency 目 錄一、引言 1頁(一)選題依據(jù) 1頁 (二)單片機簡述 1頁(三)數(shù)字頻率計概述 2頁(四)基本設(shè)計原理 2頁二、硬件系統(tǒng)設(shè)計 3頁(一)系統(tǒng)硬件的構(gòu)成 3頁(二)原理圖設(shè)計 3頁(三)AT89C51單片機及其引腳說明 3頁 (四)信號調(diào)理及放大整形模塊 5頁 (五)時基信號產(chǎn)生電路 6頁 (六)顯示模塊 7頁三、軟件設(shè)計 10頁(一)程序流程圖 10頁(二)匯編語言源程序 11頁四、總結(jié) 20頁五、參考文獻 20頁六、致謝 20頁一、 引言(一)選題依據(jù):近30年以來,單片機迅速發(fā)展,速度之快令人驚訝,廣泛應用于儀器儀表、家用電器、醫(yī)用設(shè)備、航空航天、專用設(shè)備的智