【正文】
Australia, China, and India between 1895 and 1900。s ball is in (7274 cm) in circumference. The covering of the ball is leather, rubber, position, or synthetic, although leather covers only are dictated by rules for college play, unless the teams agree otherwise. Orange is the regulation color. At all levels of play, the home team provides the ball. Inflation of the ball is based on the height of the ball39。 } else //若按鍵按下,重新開始測試 { mstime=0。 TR1=1。j) //延時一段隨機時間,為 1 馬上的隨機倍數(shù) { delaylms()。 //獲取按鍵情況 P1=0xff。 } //描述:定時器初始化子程序 void INIT_TMR1(void) { TMOD=0x11。 //顯示 xxxx 秒形式 P0=temp。 //10ms disp[0]=ms%10。而 且,通過這次設計,我懂得了學習的重要性,學會了堅持和努力,這將為以后的學習做出了最好的榜樣!同時,該設計也有不足之處,缺少了答題計分等功能。在這次設計中遇到了很多實際性的問題,在實際設計中才發(fā)現(xiàn),書本上理論性的東西與在實際運用中的還是有一定的出入的,所以有些問題不但要深入地理解, 而且要不斷地更正以前的錯誤思維。設計時,首先通過在線編程,然后具體焊接硬件作品、仿真,完全實現(xiàn)了設計功能。具體步驟如下: (1)先排除硬件電路故障,包括設計性錯誤和工藝性故障,一般原則是先靜態(tài)后動態(tài)。 圖 中斷程序流程圖 是 否 否 是 開始 定時器初始化 開啟定時器 按鍵是否按下 按鍵是否松開 停止計時,關閉定時器 返回 沈陽工學院學士報告 10 3 系統(tǒng)測試 按照設計程序的分析, LED 數(shù)碼管的動態(tài)掃描的頻率是 1000HZ,在實際使用時完全沒有閃爍。正常情況下系統(tǒng)運行主程序一直處于空閑等待狀態(tài),知道測試者按下按鍵后, LED 測試燈立即點亮。在測試者按下按鍵后, LED 測試燈立即點亮,在燈亮一個隨機時間后就通過單片機控制燈滅,這時單片機定時器就開始計時,定時器初始值為 Time1;在測試者看到 LED 燈滅時就釋放按鍵,此時定時器的值為 Time2,通過計算燈滅與測試者放開按鍵的時間差,得出測試者的反應速度。數(shù)碼管的內(nèi)部示意圖如圖 所示。 沈陽工學院學士報告 4 各個數(shù)碼管的段碼都是 P0 端口的輸出,即各個數(shù)碼管輸入的段碼都是 一樣的,為了使其分別顯示不同的數(shù)字,可采用動態(tài)掃描的方式,即先只讓最低位顯示 0,經(jīng)過一段延時,再只讓次低位顯示 1,以此類推。動態(tài)顯示雖然在任一時刻只有一位數(shù)碼管被點亮,但是由于人眼具有的視覺殘留效應,看起來與全部數(shù)碼管持續(xù)點亮的效果完全一樣。 在使用中,為了給發(fā)光二極管加驅(qū)動電壓,他們應有一個公共的引腳,公共的引腳有如下兩種鏈接方法:一、共陰極接法。 8 位微控制器 8K 字節(jié)在系統(tǒng)可編程 Flash AT89S52。 AT89S52 是一種低功耗、高性能 CMOS8 位微控制器,具有 8K 在系統(tǒng)可編程 Flash 存儲器。 Digital tube 目 錄 1 硬件部分設計 ........................................................... 1 ........................................ 錯誤 !未定義書簽。 關鍵詞: 單片機;反應速度; AT89S52 ; LED; 數(shù)碼管 Abstract This 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。 沈陽工學院 畢業(yè)設計 題 目: 基于 AT89S52 單片機人體反應速度測試儀 院 系: 信息與控制學院 專 業(yè): 通信工程 班級學號: 學生姓名: 指導教師: 成 績: 2022 年 06 月 25 日 摘 要 本文是基于單片機人體反應速度測試描述,通過單片機測試人的反應速度。s reaction time, and in milliseconds as the unit of time in the four digital tube display. If the LED test before the lights went out early release test button, 9999 as the error message is displayed. Design USES AT89S52 single chip microputer, its to high performance low price advantage to bee one of the world scope the most widely used microcontroller。 ........................................................ 3 .................................................... 4 .................................................... 4 .................................................... 6 2 軟件部分設計 ........................................................... 7 開發(fā)環(huán)境 ............................................................ 8 主體程序設計 ........................................................ 8 ...................................... 錯誤 !未定義書簽。使用 Atmel 公司高密度非易失性存儲器技術制造,與 工業(yè) 80C51 產(chǎn)品指令和引腳完全兼容。 與 MCS51 單片機產(chǎn)品兼容、 8K 字節(jié)在系統(tǒng)可編程 Flash 存儲器、 1000 次擦寫周期、全靜態(tài)操作: 0Hz~ 33Hz 、 三級加密程序存儲器 、 32 個可編程 I/O 口線 、三個 16位定時器 /計數(shù)器八個中斷源、全雙工 UART 串行通道、低功耗空閑和掉電模式、掉電后中斷可喚醒、看門狗定時 器、雙數(shù)據(jù)指針、掉電標識符。把發(fā)光二極管的陰極連接在一起構(gòu)成陰極公共引腳,使用時公共引腳接地,這樣陽極引腳上加高電平的發(fā)光二極管就導通點亮,而加低電平的則不亮。 LED 顯示器的動態(tài)顯示需要為各位提供段碼以及相應的位控制,此即通常所說的段控和位控。由于視覺暫留,只要延時時間足夠短,就能夠使得數(shù)碼的顯示看起來非常穩(wěn)定清楚。 圖 數(shù)碼管的內(nèi)部示意圖 硬件模塊設計 1. 單片機系統(tǒng)電路設計 單片機系統(tǒng)的設計主要包括單片機的電源設計、單片機時鐘電路設計、單片機復位 沈陽工學院學士報告 5 電路設計等。具體計算公式如式( ) V 測試 =Time2Time1 ( ) 式中 V 測試 為反應速度。AT89S52 單片機在 LED 測試燈亮的同時開始計算一個隨機時間,在一段隨機時間結(jié)束后, AT89S52 單片機把 LED 測試燈熄滅,并開始計時燈滅與測試者放開按鍵的時間差,此計 時時間用于紀錄被測試者的反應時間,并以毫秒為時間單位在 4 位數(shù)碼管上顯示。在程序中,定時器 20ms 中斷一次,變量 sec100 自增,中斷 100 次時,秒的顯示自增,用定時器來定時,準確。 (2)利用萬用表或邏 輯測試儀器,檢查電路中的各器件以及引腳是否連接正確,是否有短路故障。本設計中,利用常規(guī)的數(shù)碼管掃描方法,通過硬件電路的具體應用和系統(tǒng)的仿真研究得出,本設計不僅安裝簡單、成本低,更重要的是工作性能穩(wěn)定,是一個實用、創(chuàng)新型的工程設計。對于單片機設計, 其硬件電路是比較簡單的,主要是解決程序設計中的問題。我將會在以后的學習中繼續(xù)學習。 //1ms for(i=0。 } posi*=2。 TH1=0xfc。 //輸入 前先把 P1 口都加高電平 while(1) //主循環(huán)開始 沈陽工學院學士報告 17 { word mstime=0,j。 k=bot()。 TF1=0。 P2=0xff。s bounce. Inside the covering or casing, a rubber bladder holds air. The ball must be inflated to a pressure sufficient to make it rebound to a height (measured to the top of the ball) of 4954 in ( m) when it is dropped on a solid wooden floor from a starting height of 6 ft ( m