【正文】
摘 要 此次設(shè)計(jì)提出了用 AT89C51 單片機(jī)為核心控制元件 ,設(shè)計(jì)一個(gè)簡(jiǎn)易的搶答器, 本方案以 AT89C51 單片機(jī)作為主控核心,與 MAX23發(fā)光二極管、數(shù)碼管、蜂鳴器等構(gòu)成四路搶答器,利用了單片機(jī)的延時(shí)電路、按鍵復(fù)位電路、時(shí)鐘電路、定時(shí) /中斷等電路,設(shè)計(jì)的搶答器具有實(shí)時(shí)顯示搶答選手的號(hào)碼和搶答時(shí)間的特點(diǎn),還有復(fù)位電路,使其再開始新的一輪的答題和比賽,同時(shí)還利用 C語言編程,使其實(shí)現(xiàn)一些基本的功能。 本設(shè)計(jì)的系統(tǒng)實(shí)用性強(qiáng)、判斷精確、操作簡(jiǎn)單、擴(kuò)展功能強(qiáng)。它的功能實(shí)現(xiàn)是比賽開始,主持人讀完題之后按下總開關(guān),即 計(jì)時(shí)開始,此時(shí)數(shù)碼管開始進(jìn)行 1s 的加計(jì)時(shí),直到有一個(gè)選手搶答時(shí),對(duì)應(yīng)的會(huì)在數(shù)碼管上顯示出該選手的編號(hào)和搶答所用的時(shí)間,同時(shí)該選手對(duì)應(yīng)的發(fā)光二極管會(huì)發(fā)出相應(yīng)的光,蜂鳴器也會(huì)發(fā)出聲音,以提示有人搶答本題,如果在規(guī)定的 60s 時(shí)間內(nèi)沒有做出搶答,則此題作廢,即開始重新一輪的搶答。 關(guān)鍵詞: STC89C52 單片機(jī) 動(dòng)態(tài)顯示 中斷 按鍵控制 Abstract This design use AT89C51 as the core control element is presented to design a simple responder, this scheme is AT89C51 single chip microputer as control core, and MAX232 led digital tube buzzer buzzer constitute four road, such as using the time delay of the single chip microputer circuit button reset circuit clock timing/interrupt circuit, design of vies to answer first instruments have a realtime display vies to answer first contestant39。s number and the characteristics of vies to answer first time, and reset circuit, to start a new round of the answer and, at the same time also use of C language programming, make it implements some basic functionality This design the system of practical judgment accurate operation simple extension function of the realization of the function of the stronger it is the match began, and the host to read the topic after press the main switch, the timer starts and the digital tube to 1 s of time, until there is a contestant vies to answer first, the corresponding will be displayed on the digital tube out of the contestant39。s serial number and vies to answer first the time, the player at the same time the corresponding leds emit light, buzzer will sound, ontology to remind someone vies to answer first, if within the time stipulated in the 60 s made no vies to answer first, then this topic invalid, is beginning to round of vies to answer first Keywords: Dynamic display of STC89C52 single chip interrupt, button control 目 錄 第一章 緒論 ....................................................................................................................... 1 第一節(jié) 單片機(jī)搶答器的背景 .................................................................................... 1 第二節(jié) 單片機(jī)搶答器的意義 .................................................................................... 1 第三節(jié) 搶答器的應(yīng)用 ................................................................................................ 2 第二章 整體設(shè)計(jì)方案 ....................................................................................................... 3 第一節(jié) 單片機(jī)的選擇 ................................................................................................ 3 第二節(jié) 單片機(jī)的基本結(jié)構(gòu) ........................................................................................ 6 第三章 硬件設(shè)計(jì) ........................................................................................................... 10 第一節(jié) 單片機(jī)的最小系統(tǒng) ...................................................................................... 10 第二節(jié) 數(shù)碼管顯示電路 .......................................................................................... 11 第三節(jié) 按鍵控制電路 .............................................................................................. 12 第四章 軟 件設(shè)計(jì) ........................................................................................................... 13 第一節(jié) 搶答器流程圖 .............................................................................................. 13 第二節(jié) 主程序 .......................................................................................................... 14 第三節(jié) 中斷程序 ...................................................................................................... 17 第五章 調(diào)試功能說明 ..................................................................................................... 22 第一節(jié) 系統(tǒng)的調(diào)試 .................................................................................................. 22 第二節(jié) 軟 件調(diào)試問題及解決 .................................................................................. 23 第三節(jié) 焊接的問題及解決 ...................................................................................... 24 第四節(jié) 單片機(jī)的通信 .............................................................................................. 25 結(jié)論 ................................................................................................................................... 27 致謝 .....................................