2013年6位抢答器单片机实训报告 - 图文

更新时间:2023-10-26 20:26:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

电气工程及自动化学院 单片机原理及应用实训报告

题 目 : 六位抢答器 学 院 : 电气工程及自动化 班 级 : XXXXXXXXX 姓 名 : XXXX 学 号 : XXXXXX 专 业 : 电气工程及其自动化 指导老师 : XXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX

日 期 : 2013年12月20日

摘 要

随着科学技术的发展和普及,单片机的应用越来越广泛,其中抢答器的作用也越来越重要。本组设计出以单片机为核心的六路抢答器,采用了液晶与数码管结合显示,声光报警,并手动复位的设计思想。当主持人按下按键,允许抢答,此时定时器10秒倒计时,一旦有选手按键抢答,它能根据不同的抢答输入信号,经过单片机的控制处理并产生与输入信号相对应的输出信号,通过LCD1602液晶显示相应的路数,然后蜂鸣器报警、点亮对应LED灯并等待主持人发出答题信号,其他抢答者即使按下按键也将无效,主持人再次按键允许答题后,该抢答者将有10秒时间答题,此时单片机倒计时,直至倒计时结束,整个抢答、答题环节结束,充分利用了单片机系统结构简单、功能强大、可靠性好、实用性强的特点。

本设计是以抢答为出发点。考虑到依需设定限时回答的功能,利用51单片机及外围接口实现的抢答系统,利用单片机的定时器/计数器定时的原理,将软、硬件有机地结合起来,使得系统能够正确地进行计时,同时使数码管能够正确地显示倒计时间。用开关做键盘输出,蜂鸣器发生提示。同时系统能够实现:在抢答中,只有按下开始键后抢答才有效,如果在开始抢答前抢答为无效;满时后系统计时自动复位及主控强制复位。

关键词:六路 定时 显示 报警

- 1 -

Abstract

With the development of science and technology and popularization, all kinds of competitions, including contest is more and more the role of more and more important. This paper designed STC89C52 as the core, with digital display direct instructions, automatic latch showed results, and automatic reset design ideas, it can according to different contest input signal by MCU control, handle and produce different with the input signal corresponding output signal, finally LED digital pipe display by the corresponding points, even if the two groups of vies differs a few microseconds, also time can distinguish which group of priority press buttons, fully utilize the single-chip microcomputer system structure is simple, powerful, good reliability and practicability strong characteristic. This design is for the starting point. Responder Considering the set limit to answer in 89C52 single-chip microcomputer and function, use of peripheral interfaces, scare-answering system of the micro controller timer/counter timing and numeration principle, software and hardware organically, and makes the system can correctly to the time, at the same time making digital tube can properly show time. With a switch do keyboard output, the speaker happens hints. And the system can realize: in the contest, only after beginning vies to effective, if at the start of the contest for the invalid; former contest Full automatic reset and clock after the system master mandatory reset; Key lock, in effective condition, buttons invalid illegal.

Keywords:6-wire timing counting alarming

- 2 -

目录

第1章 绪论 ……………………………………………………………… 4

1.1 设计目的与意义…………………………………………………………………...4 1.2 课题要求 ……………………………………………..…………………………… 4 1.3 主要问题………………………………………..………………………..………4 1.4 设计所达到的要求………………………..………………………..………4 第2章 设计方案……………………………………………..………………….. 5

2.1 总体方案介绍 …………………………………..………………………….…5 2.2 方案分析比较………… ……………………………..………………………….…7 第3章 详细设计……………………………………………………..……………….. 8 3.1硬件电路的设计………………………………………..………………………….…8 3.1.1总电路原理…………………………………………..………………………….…8

3.1.2 时钟频率电路的设计………………………………..………………………….…8 3.1.3 LCD显示电路的设计………………………………..………………………….…9 3.1.4数码管显示电路………………………………………..…………………………. 8 3.1.5 报警模块的设计 …………………………………………..………………….…10 3.1.6 电源电路设计……………………………………………..………………10

3.2软件设计…………………………………………………..………………….…10 3.2.1软件任务分析…………………………………..………………………….11 3.2.2系统程序设计………………………………………..……………………….…13第4章 设计结果及分析………………………………………..…….……………….. 13

4.1 设计结果 …………………………………….………………………………..….13 4.2 设计分析 ….…………………………………………..………………………….14 第5章 总 结 ……..……………………………………………..………………………….14 致谢……………………………………………………..………………………15 参考文献……………………………………………..………………………15 附录1 电路总图………...………………… …..…..…………………………….……… ..16

- 3 -

第1章 绪论

通过这次设计,掌握MCU-51单片机的原理,简单了解多功能抢答器组成原理,初

1.1 设计目的与意义

步掌握多功能抢答器的调整及测试方法。同时通过本课题设计与装配、调试,提高自己的动手能力,巩固已学的理论知识,建立单片机理论和实践的结合,了解多功能抢答器各单元电路之间的关系及相互影响,从而能正确设计、计算定时计数的各个单元电路。初步掌握多功能抢答器的调整及测试方法,提高动手能力和排除故障的能力。

1.2 课题要求

1. 每名选手有一个抢答按钮,按钮的编号与选手的编号对应; 2. 设置一个系统清除和抢答控制开关S,该开关由主持人控制; 3. 抢答器具有锁存与显示功能;

4. 抢答器具有定时抢答功能,且一次抢答的时间由主持人设定(如10秒); 5. 参赛选手在设定的时间内进行抢答,抢答有效,定时器停止工作,显示器上显示 ,选手的编号和抢答的时间,并保持到主持人将系统清除为止。 6.如果无人抢答,抢答器倒计时结束后报警。

1.3主要问题

1. 硬件电路及参数的选择 2. 程序的简洁性

3. 定时及按钮扫描的精确性 4. 人机交互的完善程度 5. 程序执行的可靠性 6. 系统抗干扰性

- 4 -

本文来源:https://www.bwwdw.com/article/xpk2.html

Top