当前位置:首页 > 基于单片机的抢答器设计
摘 要
此次设计提出了用AT89C51单片机为核心控制元件,设计一个简易的抢答器, 本方案以AT89C51单片机作为主控核心,与MAX232、发光二极管、数码管、蜂鸣器等构成四路抢答器,利用了单片机的延时电路、按键复位电路、时钟电路、定时/中断等电路,设计的抢答器具有实时显示抢答选手的号码和抢答时间的特点,还有复位电路,使其再开始新的一轮的答题和比赛,同时还利用C语言编程,使其实现一些基本的功能。
本设计的系统实用性强、判断精确、操作简单、扩展功能强。它的功能实现是比赛开始,主持人读完题之后按下总开关,即计时开始,此时数码管开始进行1s的加计时,直到有一个选手抢答时,对应的会在数码管上显示出该选手的编号和抢答所用的时间,同时该选手对应的发光二极管会发出相应的光,蜂鸣器也会发出声音,以提示有人抢答本题,如果在规定的60s时间内没有做出抢答,则此题作废,即开始重新一轮的抢答。
关键词: STC89C52单片机 动态显示 中断 按键控制
Abstract
This design use AT89C51 as the core control element is presented to design a simple responder, this scheme is AT89C51 single chip microcomputer as control core, and MAX232 led digital tube buzzer buzzer constitute four road, such as using the time delay of the single chip microcomputer circuit button reset circuit clock timing/interrupt circuit, design of vies to answer first instruments have a real-time display vies to answer first contestant's number and the characteristics of vies to answer first time, and reset circuit, to start a new round of the answer and, at the same time also use of C language programming, make it implements some basic functionality
This design the system of practical judgment accurate operation simple extension function of the realization of the function of the stronger it is the match began, and the host to read the topic after press the main switch, the timer starts and the digital tube to 1 s of time, until there is a contestant vies to answer first, the corresponding will be displayed on the digital tube out of the contestant's serial number and vies to answer first the time, the player at the same time the corresponding leds emit light, buzzer will sound, ontology to remind someone vies to answer first, if within the time stipulated in the 60 s made no vies to answer first, then this topic invalid, is beginning to round of vies to answer first
Keywords: Dynamic display of STC89C52 single chip interrupt, button control
目 录
第一章 绪论 ....................................................................................................................... 1
第一节 单片机抢答器的背景 .................................................................................... 1 第二节 单片机抢答器的意义 .................................................................................... 1 第三节 抢答器的应用 ................................................................................................ 2 第二章 整体设计方案 ....................................................................................................... 3
第一节 单片机的选择 ................................................................................................ 3 第二节 单片机的基本结构 ........................................................................................ 6 第三章 硬件设计 ........................................................................................................... 10
第一节 单片机的最小系统 ...................................................................................... 10 第二节 数码管显示电路 .......................................................................................... 11 第三节 按键控制电路 .............................................................................................. 12 第四章 软件设计 ........................................................................................................... 13
第一节 抢答器流程图 .............................................................................................. 13 第二节 主程序 .......................................................................................................... 14 第三节 中断程序 ...................................................................................................... 17 第五章 调试功能说明 ..................................................................................................... 22
第一节 系统的调试 .................................................................................................. 22 第二节 软件调试问题及解决 .................................................................................. 23 第三节 焊接的问题及解决 ...................................................................................... 24 第四节 单片机的通信 .............................................................................................. 25 结论 ................................................................................................................................... 27 致谢 ................................................................................................................................... 28 参考文献 ........................................................................................................................... 29
第一章 绪论
第一节 单片机抢答器的背景
二十世纪跨越了三个“电”的时代,即电气时代、电子时代和现已进入的电脑时代。不过,这种电脑,通常是指个人计算机,简称PC机。它由主机、键盘、显示器等组成。还有一类计算机,大多数人却不怎么熟悉。这种计算机就是把智能赋予各种机械的单片机(亦称微控制器)。顾名思义,这种计算机的最小系统只用了一片集成电路,即可进行简单运算和控制。因为它体积小,通常都藏在被控机械的“肚子”里。它在整个装置中,起着有如人类头脑的作用,它出了毛病,整个装置就瘫痪了。现在,这种单片机的使用领域已十分广泛,如智能仪表、实时工控、通讯设备、导航系统、家用电器等。各种产品一旦用上了单片机,就能起到使产品升级换代的功效,常在产品名称前冠以形容词--“智能型”。
在知识竞赛中,往往会用到抢答器。故此我们就选择利用单片机编程来设计抢答器,即使两组的抢答时间相差几微秒,也能轻松的分辨出哪一组(或哪个选手)先抢答到题。
第二节 单片机抢答器的意义
本系统采用单片机作为整个控制核心。控制系统的四个模块为:显示模块、存储模块、语音模块、抢答开关模块。该系统通过开关电路四个按键输入抢答信号,利用一个数码管来完成显示功能,用按键来让选手进行抢答,在数码管上显示哪一组先答题的,从而实现整个抢答过程。本文主要介绍了单片机抢答器设计及工作原理,以及它的实际用途。系统工作原理本系统采用89C52单片机作为核心。控制系统的四个模块分别为:存储模块、显示模块、语音模块、抢答开关模块。该抢答器系统通过开关电路四个按键输入抢答信号, 利用一个数码管来完成显示功能。工作时,用按键通过开关电路输入各路的抢答信号,经单片机的处理, 输出控制信号,单片机控制的智能抢答器设计。
1
共分享92篇相关文档