【正文】
Time II I 數(shù)碼顯示模塊 調(diào)整回答時間模塊 調(diào)整搶答時間 正確搶答模塊 非法搶答模塊 按鍵模塊 系統(tǒng)初始化模塊 復(fù)位電路 時鐘 AT89C51 單片機(jī) 4 位七段數(shù)碼管顯示 聲音電路 8 路搶答 按鍵輸入 根據(jù)選手表現(xiàn),規(guī) 則由主持人減分 答題完畢 若超過答題 時間,則數(shù) 碼管顯示 FFF 違規(guī)流程 正常流程 顯示選手號碼,倒計(jì) 時時間 ,語音報警,答 題 ,答題時間倒計(jì)時 顯示 FFF 有選手 搶按 倒計(jì)時結(jié) 束,超時 顯示違例選手號碼并伴有語音報警 開始前有選手搶按 開始數(shù)碼管顯 示 FFF 開始搶 按時間倒計(jì)時 開始 運(yùn) 行 行 加載程序 開始運(yùn)轉(zhuǎn) 建立上電標(biāo)志 熱啟動恢復(fù)被破壞的信息部分初始化 冷啟自檢 全面初始化 上電標(biāo)志 關(guān)中斷,設(shè)定堆棧 復(fù)位 初始化 Y Y Y 顯示搶答 號并倒計(jì)時 RAM 并行 I/O 口 串行 I/O 口 定時 /計(jì)數(shù)器 CPU ROM 系統(tǒng)時鐘 電源 中斷 復(fù)位 外部定 時元件 正常 搶答 顯示 犯規(guī) 非法搶 答處理 去抖動 調(diào)整搶 答時間 回答 時間 減一鍵 加一鍵 開始鍵 顯示 FFF 加一、減一 按鍵輸入 開始、結(jié)束 按鍵輸入 。 LED digital tubes。 count down to the petitive and finished time, when it’s full time the system will be automatic reset and the master will also be forced reset 。 it can show who39。 Eightway first answer device based on AT89C51 Lincheng Deng College of Computer Science and Engineering, Zhongkai University of Agriculture and Engineering, Guangzhou 510225,ChinaAbstract: As a tool, the first answer device has been widely used in all kinds of intelligence and knowledge contests occasions. However, it is not used so frequently due to its production plexity, lacking of reliability and reducing interest. Although a unit can afford it, it is rarely used yearly. Meanwhile, because of the longterm storage, its electronic devices are easy to be damaged. Some activities are likely to be affected because it is quiet trouble to repurchase these spare parts and timewasting. This First Answer Device is designed to solve these problems. And this design is based on the principle of eightway first answer. Considering the requirement and the limited time to answer, while using AT89C51 singlechip and external interface of the Answer System, the use of singlechip timer / counter timing and number of the principles in mind, the software and hardware bination, makes the system time correctly, while the digital control to display time correctly. Switch the keyboard to do with output, speaker prompted occurred. At the same time, the system can be realized: In the petitive answering game, only after the answer that will be valid, if at the beginning of preanswer that will be invalid。擴(kuò)展功能: 可以設(shè)計(jì)聲控裝置,在主持人說開始時,系統(tǒng)自動完成清零并開始計(jì)時的功能。并且由原先的被動的接受知識轉(zhuǎn)換為主動的尋求知識,這可以說是學(xué)習(xí)方法上的一個很大的突破。從仿真圖上可以進(jìn)一步得出結(jié)論:利用單片機(jī)設(shè)計(jì)的搶答器工作性能穩(wěn)定,延遲時間小,電路結(jié)構(gòu)簡單,是一個實(shí)用、創(chuàng)新性的電路設(shè)計(jì)。 搶答成功并顯示倒計(jì)時 圖 18 六號選手搶答 圖中顯示的是若 6 號選手搶答成功的時候, 4 位數(shù)碼管的第一顯示是“ 6”號選手搶答成功,最后兩位顯示選手答題倒計(jì)時時間還有 25 秒。 設(shè)置計(jì)時時間 圖 16 計(jì)時時間為 17 秒 該圖顯示通過加一按鍵操作后在 4 位數(shù)碼管上顯示的計(jì)時時間為 17 秒。將程序下載到硬件電路中,實(shí)現(xiàn)搶答功能。 CPL 。第一個為零 ,其他與上相同 ,因?yàn)槭蝗绻麨榱泔@示熄滅 加減時間延時 起到不會按下就加 N 個數(shù) : DELAY1: MOV 35H,08H LOOP0: ACALL DISPLAY DJNZ 35H,LOOP0 RET 延時 顯示和去抖動用到 : DELAY: MOV 32H,12H LOOP: MOV 33H,0AFH LOOP1: DJNZ 33H,LOOP1 DJNZ 32H,LOOP RET 發(fā)聲程序: BARK: SETB RING ACALL DELAY1 ACALL DELAY1 CLR RING 。查表顯示程序,利用 P0 口做段選碼口輸出 /P2 低三位做位選碼輸出 MOV A,R3 MOVC A,A+DPTR MOV P2,0feH MOV P0,A ACALL DELAY MOV DPTR,DAT2 MOV A,R5 MOVC A,A+DPTR MOV P2,0fdH MOV P0,A ACALL DELAY MOV A,R4 MOVC A,A+DPTR MOV P2,0fbH MOV P0,A ACALL DELAY RET DAT1:DB 00h,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,00H,71H 。取回號數(shù) MOV R5,0BH MOV R4,0BH 。三燈全滅 AJMP CHECK1 FLASH: CJNE A,0CH,CHECK1 。犯規(guī)號數(shù)暫存與 34H HERE: MOV A,R0 CJNE A,06H,FLASH 。搶答時間 R2 送 R6 MOV R3,01H CLR OK 。如果是搶答倒計(jì)時,如是則查詢搶答,否者跳過查詢繼續(xù)倒數(shù) 這里起到鎖搶答作用 AJMP RECOUNT ACCOUT:MOV A,DATA0 JNB ,TRUE1 JNB ,TRUE2 JNB ,TRUE3 JNB ,TRUE4 JNB ,TRUE5 JNB ,TRUE6 JNB ,TZ7 JNB ,TZ8 AJMP RECOUNT TZ7: AJMP TRUE7 TZ8: AJMP TRUE8 QUIT: CLR OK 。只在回答倒計(jì)時才有效 AJMP NEXTT CHECKK:JNB ,REPEAT 。計(jì)時一秒 R6 自動減 1 MOV R0,00H CHECK: JNB ,QUIT 。一秒標(biāo)志減 1 AJMP CHECK LARGER: MOV A,R0 CJNE A,14H,CHECK 。下面是 1s 的情況,響并顯示號數(shù)并清 R0,重新計(jì) SETB RING MOV A,R6 JZ QUIT 。大于 5s 跳到 LARGER,小于等于 5s會提醒 MOV A,R0 CJNE A,0AH,FULL 。取十位