【正文】
硬件模塊選擇硬件總體連接,用一只發(fā)光二極管模擬測試燈,以 AT89S52 單片機(jī)的 端口控制這只發(fā)光二極管、發(fā)光二極管加限流電阻+5V 電源, 端口輸出低電平時,測試燈亮,輸出高電平時,測試燈滅。 硬件電路設(shè)計(jì)LED 數(shù)碼管的顯示電路中采用動態(tài)數(shù)碼管顯示,在其中 P0 端口控制段碼,低電平有效,~ 端口控制位碼,高電平有效。把 LED 顯示器段碼表預(yù)先存放在存儲器中,使用時通過查表就可以得到段碼。LED 顯示器多采用動態(tài)顯示方式,全部數(shù)碼管共用一套段碼驅(qū)動電路,各位數(shù)碼管的同段引腳短接后再接到對應(yīng)段碼的驅(qū)動線上。二、共陽極接法。每段電流為 5~10mA,一只數(shù)碼管的 7 段 LED全亮需要電流 35~70mA。單片機(jī)引腳圖如圖 所示??臻e模式下,CPU 停止工作,允許 RAM、定時器/計(jì)數(shù)器、串口、中斷繼續(xù)工作。片上 Flash 允許程序存儲器在系統(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)測試 ................................................................8 軟件測試 ............................................................8 硬件測試 ............................................................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)對人體反應(yīng)速度的測試,主要控制測試燈的狀態(tài),通過測試按鍵的狀態(tài)來間接計(jì)算人體反應(yīng)速度。s test.Keywords: Single chip microputer。關(guān)鍵詞:單片機(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測試燈亮的同時開始計(jì)算一個隨機(jī)時間,在一段隨機(jī)時間結(jié)束后,AT89S52 單片機(jī) 把 LED 測試燈熄滅,并開始計(jì)時燈滅與測試者放開按鍵的時間差,此計(jì)時時間用于紀(jì)錄被測試者的反應(yīng)時間,并以毫秒為時間單位在 4 位數(shù)碼管上顯示。沈陽工學(xué)院畢業(yè)設(shè)計(jì)報(bào)告 題 目:基于