安徽工贸职业技术学院毕业设计(论文)
Anhui Vocactional & Technical College of Industry & Trade
毕 业 论 文
基于51 的八路抢答器设计与制作
Based on 51 of the eight way Responder design andproduction
所在系院: 电气与信息工程系 专业班级: 机电一体化(2)班 学生学号: 2010350252 学生姓名: 张兵 指导教师: 刘旭
2012年12月15日
安徽工贸职业技术学院毕业设计(论文)
Anhui Vocactional & Technical College of Industry & Trade
毕业设计说明书
基于51 的八路抢答器设计与制作
Based on 51 of the eight way Responder design andproduction
所在系院: 电气与信息工程系 专业班级: 机电一体化(2)班 学生学号: 2010350252 学生姓名: 张兵 指导教师: 刘旭
2012年12月15日
1
安徽工贸职业技术学院毕业设计(论文)
基于51 的八路抢答器设计与制作
摘要
抢答器作为一种工具,已广泛应用于各种智力和知识竞赛场合。但抢答器的使用频
率较低,且有的要么制作复杂,要么可靠性低。作为一个单位,如果专门购一台抢答器虽然在经济上可以承受,但每年使用的次数极少,往往因长期存放使(电子器件的)抢答器损坏,再购置的麻烦和及时性就会影响活动的开展,因此设计了本抢答器。
本设计是以八路抢答为基本理念。考虑到依需设定限时回答的功能,利用AT89C51单片机及外围接口实现的抢答系统,利用单片机的定时器/计数器定时和记数的原理,将软、硬件有机地结合起来,使得系统能够正确地进行计时,同时使数码管能够正确地显示时间。用开关做键盘输出,扬声器发生提示。同时系统能够实现:在抢答中,只有开始后抢答才有效,如果在开始抢答前抢答为无效;抢答限定时间和回答问题的时间可在1-99s设定;可以显示是哪位选手有效抢答和无效抢答,正确按键后有音乐提示;抢答时间和回答问题时间倒记时显示,满时后系统计时自动复位及主控强制复位;按键锁定,在有效状态下,按键无效非法。
关键词:AT89C51 LED数码管 抢答器 计时
安徽工贸职业技术学院毕业设计(论文)
Take to
Responder as a tool, has been widely used in various occasions intelligence and knowledge competitions. But Qiangda is used for lower frequency, and some production complex, or low reliability. As a unit, if specifically to buy a responder although the economy can bear, each year the number is extremely small, often because of the long-term storage ( electronic devices) responder damage, to the purchase of the trouble and the timeliness of activities will be affected, so the design of the responder.
This design is eight way contest as the basic concept. Considering the time-limited answer according to need to set the function, using AT89C51 MCU and peripheral interface of the answering system, the use of single-chip timer / counter timing and counting principle, the soft and hardware combination, so that the system can
correctly time, while the digital tube able to correctly display the time. Switching with the keyboard output, speakers in tips. At the same time the system can realize: the answer, only after the start of the answer is effective, if at the beginning of answer answer answer before the time limit is invalid; question and answer time in 1-99s set; can display which is effective and ineffective players answer answer keys, right after the music cue; answer time and answer questions for inverted timing display, full system timing automatic reset and host a forced reset; key lock, in effective state key invalid, illegal.
Key words: AT89C51 digital tube LED responder
2
安徽工贸职业技术学院毕业设计(论文)
1 绪 论 ................................................................................................................................... 1
1.1 选题的目的和意义 ...................................................................................................................... 1 1.2 课题研究的内容 ........................................................................................................................... 1
2 抢答器的系统概述 ......................................................................................................... 2
2.1 系统的主要功能 ........................................................................................................................... 2 2.2 系统需求分析 ............................................................................................................................... 4 2.3 抢答器的工作流程 ...................................................................................................................... 4 2.4 抢答器的工作过程 ...................................................................................................................... 5
3 系统总体方案的设计 .................................................................................................... 6
3.1 硬件电路的设计 ........................................................................................................................... 6 3.2 总体原理图 ................................................................................................................................... 7 3.3 时钟频率电路的设计 .................................................................................................................. 8 3.4 复位电路的设计 ........................................................................................................................... 9 3.5 显示电路的设计 ........................................................................................................................... 9 3.6 键盘扫描电路的设计 ................................................................................................................ 11 3.7 发声电路 ...................................................................................................................................... 14 3.8 系统复位 ...................................................................................................................................... 15
4 软件设计 .......................................................................................................................... 16
4.1主程序系统结构图 ...................................................................................................................... 16 4.2 程序流程图 ................................................................................................................................. 17 4.3 主要程序分析 ............................................................................................................................. 18
5 PROTEUS仿真系列组图 ............................................................................................... 30
5.1 复位图 .......................................................................................................................................... 30 5.2 设置计时时间 ............................................................................................................................. 30 5.3 非法抢答并显示座号 ................................................................................................................ 31 5.4 抢答成功并显示倒计时 ............................................................................................................ 31
6 总结 ................................................................................................................................... 32 7 致谢 ................................................................................................................................... 33