【正文】
,經(jīng)過一段時(shí)間后,單片機(jī)的 9 腳處于穩(wěn)定的低電平狀態(tài),此時(shí)單片機(jī)上電復(fù)位完畢,單片機(jī)開始正常工作。其大小是時(shí)鐘信號(hào)頻率的倒數(shù),常用 fosc 表示。 時(shí)鐘電路由一個(gè)晶體振蕩器 12MHZ 和兩個(gè) 30pF 的瓷片電容組成。隨著軟件設(shè)計(jì)水平的提高,往往只要改變或增加軟件中的數(shù)據(jù)處理算法,就可以使系統(tǒng)功6能提高很多,而系統(tǒng)的硬件不必做任何更換就使系統(tǒng)升級(jí)換代。圖 八路搶答器的硬件電路本設(shè)計(jì)分為硬件設(shè)計(jì)和軟件設(shè)計(jì),這兩者相互結(jié)合,不可分離;從時(shí)間上看,硬件設(shè)計(jì)的絕大部分工作量是在最初階段,到后期往往還要做一些修改。選手在定時(shí)時(shí)間內(nèi)搶答時(shí),搶答器完成:優(yōu)先判斷、編號(hào)鎖存、編號(hào)顯示、揚(yáng)聲器提示。由于用了單片機(jī),使其技術(shù)比較成熟,應(yīng)用起來方便、簡(jiǎn)單并且單片機(jī)周圍的輔助電路也比較少,便于控制和實(shí)現(xiàn)。主持人可以控制搶答的開始,暫停和復(fù)位。 alarm。除此之外,搶答器還具有定時(shí)搶答的功能,且一次搶答的時(shí)間可以由主持人設(shè)定。本次設(shè)計(jì)的電路可以分成搶答電路、可預(yù)置時(shí)間的定時(shí)電路、時(shí)鐘產(chǎn)生和時(shí)序控制電路、報(bào)警控制電路、電源電路等幾個(gè)模塊。s entertainment life has bee increasingly rich, the petitions are increasing, the responder requirements are also getting higher and higher, fair responder is particularly important. In order to meet the needs of various kinds of contests, the design of a 8 bit contest Responder, the responder can simultaneously for 8 players or 8 teams. The circuit design can be divided into answer circuit, can be preset time timing circuit, clock and timing control circuit, the alarm control circuit, power supply circuit modules. Concrete realization process: 3 control switch is set to host, respectively is start, pause and reset. The responder has a data latch and display functions, namely the answer after the start, if a player to answer in the button pressed, number immediately latched, and displays the number of players in the digital tube, at the same time, the buzzer gives voice prompts, and blockade of circuit, the prohibition of other players strong strong, priority number of players has remained to host the system is clear. In addition, responder has the timing responder function, and one answer in the time can be set by the host. When the host starts the start button, the timer to reduce the time requirements, and display。 基本功能 采用4 位數(shù)碼管設(shè)計(jì)。如果有緊急情況需要停止的話,主持人按“暫?!辨I就可以暫停搶答。第三章 硬件電路設(shè)計(jì)(劉玉珠 黎亞 王悅 完成) 八路搶答器的電路框圖如圖 所示為電路框圖。圖所示電路的工作過程是:接通電源后,主持人將控制開關(guān)置于“清除”處,此時(shí)搶答器處于禁止?fàn)顟B(tài),選手不能進(jìn)行搶答,定時(shí)顯示器顯示設(shè)定的時(shí)間,當(dāng)主持人將控制開關(guān)置于“開始”時(shí),揚(yáng)聲器發(fā)出聲響,搶答器處于工作狀態(tài),同時(shí)定時(shí)器開始倒計(jì)時(shí)。(3) 程序空間,選用片內(nèi)程序空間足夠大的單片機(jī),本設(shè)計(jì)采用 AT89S51單片機(jī)。系統(tǒng)硬件電路圖如圖 : 圖 硬件電路圖 時(shí)鐘電路時(shí)鐘電路是搶答器設(shè)計(jì)的關(guān)鍵,它要完成以下三項(xiàng)功能:① 主持人將控制開關(guān)撥到“開始”位置時(shí),搶答電路和定時(shí)電路進(jìn)入正常搶答工作狀態(tài)。電路中兩個(gè)電容 C1,C2 的作用有兩個(gè):一是幫助振蕩器起振;二是對(duì)振蕩器的頻率進(jìn)行微調(diào)。這種復(fù)位電路為高電平復(fù)位。(4)用戶應(yīng)用程序空間為 8K 字節(jié)。(11)外部中斷 4 路,下降沿中斷或低電平觸發(fā)電路,Power Down 模式可由外部中斷低電平觸發(fā)中斷方式喚醒。段接 ,因?yàn)槭枪碴帢O的所以不需要加驅(qū)動(dòng)模塊,四位共陰極數(shù)碼管顯示。數(shù)字搶答器設(shè)計(jì)中采用了獨(dú)立鍵盤的方式,本設(shè)計(jì)中有 8 個(gè)搶答按鍵輸入,一個(gè)開始按鍵、一個(gè)暫停鍵、一個(gè)服務(wù)按鍵。一般電子裝置中都設(shè)計(jì)有按鍵輸入,用以控制程序執(zhí)行時(shí)數(shù)據(jù)的輸入或是特殊功能的設(shè)置及操作。能建立一個(gè)完備的電子設(shè)計(jì)開發(fā)環(huán)境。他那誨人不倦、寬厚樸實(shí)的作風(fēng)給我們留下了不可磨滅的影響,是我學(xué)習(xí)的榜樣,使我終生受益無窮。 //定義停止按鍵sbit keyqc=P3^2。 //定義 7 號(hào)搶答選手sbit key8=P1^7。i)。//EX1=1。 //產(chǎn)生 1s 的倒計(jì)時(shí)//led1=~led1。 //顯示十位數(shù)字P0=table[b2]。 //第一位數(shù)碼管顯示P0=0x40。 //第四位數(shù)碼管顯示}void djsxs1() {P0=table[1]。 //第一位數(shù)碼管顯示 2}void djsxs3() {21P0=table[3]。 //第一位數(shù)碼管顯示 4}void djsxs5() {P0=table[5]。 //第一位數(shù)碼管顯示 6}void djsxs7() {P0=table[7]。 //第一位數(shù)碼管顯示 8}void main(){int djs1=60。 djs=60。 //去除抖動(dòng) if(key3==0) { while(!key3)。 //去除按鍵抖動(dòng) if(keyks==0) { while(!keyks)。 delayms(3)。 if(key1==0) { while(!key1)。 }} }}}if((key2==0)amp。djsxs()。 if(key3==0) { while(!key3)。}} }}}if((key4==0)amp。djsxs()。 if(key5==0) { while(!key5)。}} }}}if((key6==0)amp。djsxs()。 if(key7==0) { while(!key7)。}} }}}if((key8==0)amp。djsxs()。 goto LOOP1。 if(keyqc==0) { while(!keyqc)。(TR0==1)){ spk=0。 while(1) { TR0=0。 if(keyqc==0) { while(!keyqc)。(TR0==1)){ spk=0。 while(1) { TR0=0。 if(keyqc==0) { while(!keyqc)。(TR0==1)){ spk=0。 while