【正文】
硬件模塊選擇硬件總體連接,用一只發(fā)光二極管模擬測(cè)試燈,以 AT89S52 單片機(jī)的 端口控制這只發(fā)光二極管、發(fā)光二極管加限流電阻+5V 電源, 端口輸出低電平時(shí),測(cè)試燈亮,輸出高電平時(shí),測(cè)試燈滅。 硬件電路設(shè)計(jì)LED 數(shù)碼管的顯示電路中采用動(dòng)態(tài)數(shù)碼管顯示,在其中 P0 端口控制段碼,低電平有效,~ 端口控制位碼,高電平有效。把 LED 顯示器段碼表預(yù)先存放在存儲(chǔ)器中,使用時(shí)通過查表就可以得到段碼。LED 顯示器多采用動(dòng)態(tài)顯示方式,全部數(shù)碼管共用一套段碼驅(qū)動(dòng)電路,各位數(shù)碼管的同段引腳短接后再接到對(duì)應(yīng)段碼的驅(qū)動(dòng)線上。二、共陽極接法。每段電流為 5~10mA,一只數(shù)碼管的 7 段 LED全亮需要電流 35~70mA。單片機(jī)引腳圖如圖 所示??臻e模式下,CPU 停止工作,允許 RAM、定時(shí)器/計(jì)數(shù)器、串口、中斷繼續(xù)工作。片上 Flash 允許程序存儲(chǔ)器在系統(tǒng)可編程,亦適于常規(guī)編程器。整體系統(tǒng)框圖如圖 所示。 Digital tube目 錄1 硬件部分設(shè)計(jì) ............................................................1 硬件結(jié)構(gòu)設(shè)計(jì) .........................................................2 硬件電路設(shè)計(jì) .........................................................3 硬件模塊選擇 .....................................................3 硬件模塊設(shè)計(jì) .....................................................3 控制計(jì)算公式 .....................................................52 軟件部分設(shè)計(jì) ............................................................6 開發(fā)環(huán)境 ............................................................7 主體程序設(shè)計(jì) ........................................................7 主程序設(shè)計(jì) .......................................................7 中斷程序設(shè)計(jì) .....................................................73 系統(tǒng)測(cè)試 ................................................................8 軟件測(cè)試 ............................................................8 硬件測(cè)試 ............................................................8結(jié) 論 .....................................................................9參考文獻(xiàn) .................................................................10附錄 A ...................................................................12附錄 B ...................................................................13附錄 C ...................................................................14 沈 陽 工 學(xué) 院 學(xué) 士 報(bào) 告01 硬件部分設(shè)計(jì)本項(xiàng)目以 AT89S52 單片機(jī)為核心,實(shí)現(xiàn)對(duì)人體反應(yīng)速度的測(cè)試,主要控制測(cè)試燈的狀態(tài),通過測(cè)試按鍵的狀態(tài)來間接計(jì)算人體反應(yīng)速度。s test.Keywords: Single chip microputer。關(guān)鍵詞:?jiǎn)纹瑱C(jī);反應(yīng)速度;AT89S52 ;LED; 數(shù)碼管AbstractThis article is based on single chip microputer human reaction speed tests described, through the single chip microputer test response speed. AT89S52 MCU as the core in the design of the human body reaction velocity tester, mainly by controlling the state of the test lamp, in the state of the test button to indirect calculation of human body reaction speed. System normal operation of the main program has been idle waiting state, know the tester after press the button, the LED test lamp light up immediately. AT89S52 single chip microputer in LED to test the lights at the same time began to calculate a random time, at the end of a random time, AT89S52 single chip microputer test the LED lights, and start timing lights and testers release button lag, this timer is used to record the subject39。AT89S52 單片機(jī)在 LED測(cè)試燈亮的同時(shí)開始計(jì)算一個(gè)隨機(jī)時(shí)間,在一段隨機(jī)時(shí)間結(jié)束后,AT89S52 單片機(jī) 把 LED 測(cè)試燈熄滅,并開始計(jì)時(shí)燈滅與測(cè)試者放開按鍵的時(shí)間差,此計(jì)時(shí)時(shí)間用于紀(jì)錄被測(cè)試者的反應(yīng)時(shí)間,并以毫秒為時(shí)間單位在 4 位數(shù)碼管上顯示。沈陽工學(xué)院畢業(yè)設(shè)計(jì)報(bào)告 題 目:基于