基于单片机的智能竞赛抢答器设计
2010年6月
摘 要
抢答器作为一种工具,已广泛应用于各种智力和知识竞赛场合。但抢答器的使用频率较低,且有的制作复杂,有的可靠性低。作为一个单位,如果专门购一台抢答器虽然在经济上可以承受,但每年使用的次数极少,往往因长期存放使(电子器件的)抢答器损坏,再购置的麻烦和及时性就会影响活动的开展,因此设计了本抢答器。
本设计是以八路抢答为基本理念,考虑到依需设定限时回答的功能,利用AT89C52单片机及外围接口实现的抢答系统,利用单片机的定时器/计数器原理,将软、硬件有机地结合起来,使得系统能够正确地进行计时,同时驱动数码管正确显示时间。
系统能够实现:主持人按下开始按钮后抢答方有效;抢答限定时间和回答问题时间可在1-99s内任意设定;显示抢答选手号;抢答时间和回答问题时间倒记时显示,满时后主控强制复位。
关键词:AT89C52; LED数码管;抢答器;计时
I
Abstract
As a tool, the Quiz Buzzer 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 complexity, lacking of reliability and reducing interest. Although a unit can afford it, it is rarely used yearly. Meanwhile, because of the long-term 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 time-wasting. This Quiz Buzzer Device is designed to solve these problems.
And this design is based on the principle of eight-way first answer. Considering the requirement and the limited time to answer, while using AT89C52 single-chip and external interface of the Answer System, the use of single-chip timer / counter timing and number of the principles in mind, the software and hardware combination, makes the system time correctly, while the digital control to display time correctly. Switch the keyboard to do with output, speaker prompted occurred.
The system can be realized: In the competitive answering game, only after the answer that will be valid, if at the beginning of pre-answer that will be invalid; Competitive answer to the question and the end of the question can be set in 1-99s; it can show who's effective and whose answer?s invalid, the correct button will prompt after the music; count down to the competitive and finished time, when it?s full time the master will be forced reset.
Key words: AT89C52; LED digital tubes; the Quiz Buzzer Device; Time
II
目 录
1 绪论 ................................................................................................................................... 1 2系统概述 ............................................................................................................................ 2 2.1课题背景 ...................................................................................................................... 2 2.2抢答器的发展概况及市场竞争分析 .......................................................................... 2 2.3课题及任务要求 .......................................................................................................... 3 3 硬件介绍 ........................................................................................................................... 4 3.1 单片机概述 ................................................................................................................. 4 3.1.1 AT89C52系列单片机 ........................................................................................... 5 3.1.2 AT89C52芯片的引脚及特点 ............................................................................... 5 3.1.3 AT89C52的主要性能参数 ................................................................................... 9 3.1.4 AT89C52的新功能 ............................................................................................... 9 3.1.5 单片机的发展 .................................................................................................... 10 3.1.6 单片机的应用 .................................................................................................... 10 3.1.7 AT89C52系列单片机 ......................................................................................... 11 3.1.8 存储器配置 ........................................................................................................ 12 3.2显示电路设计 ............................................................................................................ 12 4 系统设计 ......................................................................................................................... 15 4.1 设计思路 ................................................................................................................... 16 4.2 硬件设计 ................................................................................................................... 17 4.2.1 时钟频率电路的设计 ........................................................................................ 17 4.2.2 复位电路的设计 ................................................................................................ 18 4.2.3 显示电路的设计 ................................................................................................ 19 4.2.4 键盘电路的设计 ................................................................................................ 19 4.2.5 报警电路设计 .................................................................................................... 21 4.3 软件设计 ................................................................................................................... 21 5调试运行 .......................................................................................................................... 24 5.1 系统的调试 ............................................................................................................... 24 5.2 软件调试问题及解决 ............................................................................................... 24 5.3 焊接的问题及解决 ................................................................................................... 26
III