文档介绍:基于单片机的篮球计时计分器设计
摘要:本设计是基于AT89C51单片机的篮球计时计分器,利用7段共阴LED作为显示器件。在此设计中共接入了1个四位一体7段共阴LED显示器,2个三位一体7段共阴LED显示器,前者用来记录赛程时间,其中2位用于显示分钟,2位用于显示秒钟,后者用于记录甲乙队的分数,每队2个LED显示器显示范围可达到0~999分。赛程计时采用倒计时方式,比赛开始时启动计时,直至计时到0为止。
为了配合计时器和计分器校正调整时间和比分,我们特定在本设计中设立了7个按键,用于设置,调整时间,启动,调整分数和暂停等功能。采用单片机控制是这个系统按键操作使用简洁,LED显示,安装方便。
关键词:单片机; 计时; 计分; 显示器; 接口
Design of Basketball timing Scoring Device Based on SCM
Abstract:The design is based on AT89C51 microcontroller timing basketball scoring device, the use of 7 as mon cathode LED this design, the CPC has an access to one of four 7-mon cathode LED display, 2 Trinity mon cathode LED displays, the former is used to record the race of time, of which 2 used to display the minutes, 2 seconds to displayminutes, which is used to record scores and B teams, each team two LED display shows the range of 0 to 999 points can be time with the countdown mode, the game starts the beginning of time until the timer to 0 so far.
To cope with calibration timer and scoring device to adjust the time and score, we design a specific set in the 7 buttons, for setting, adjusting the time, start, adjust the score and pause system uses single chip control is to use simple button operation, LED display, easy to install.
Key words:microcontroller ; timer ; score; display ; interface
目录
1绪论 1
2系统方案说明 3
方案选择 3
篮球赛计时计分器设计的现状 3
3
3统硬件电路设计 8
8
8
主要器件选择及介绍 8
17
18
18
复位电路模块 19
20
4 软件编程及调试 21
软件总体设计方案 21
软件设计具体过程 22
23
显示时间,分数子程序模块设计 23
按键控制子程序设计模块 27
中断程序设计模块 35
主函数设计模块 37
总结 41
致谢 43
参考文献 45
1绪论
随着单片机在各个领域的广泛应用,许多用单片机做控制的球赛计时计分系统也应运而生,如用单片机控制LCD液晶显示器计时计分器,用单片机控制LED七段显示器计时计分器等。
根据此次课题要求,结合本人自身学习情况,这里介绍一种篮球赛计时计分器的设计方法,即单片机直接驱动数码管工作的电路。采用这种方法可以大幅度的节约成本,电路采用单片机作为核心元件,利用1个四位7段共阴极LED数码管和2个三位7段共阴极LED数码管作为显示器件。2个三位7段共阴极LED数码管用于记录甲、乙两队的分数,显示分数范围可达0~999分,足够赛程计