- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
基于单片机的俄罗斯方块设计与实现
摘 要
随着单片机在手持娱乐设备上应用的发展,越来越多的应用在电子领域中,如:电子宠物,俄罗斯方块,智能IC卡等。俄罗斯方块是一款风靡全球的电视游戏机和掌上游戏机游戏,它由俄罗斯人阿列克谢·帕基特诺夫发明,故得此名。
本文选用STC89C52RC单片机作为系统的芯片,实现人机交互、娱乐等功能。选用LCD12864实现俄罗斯方块游戏界面、图形显示;选用独立按键实现游戏控制。本设计实现的基本功能是:用按键控制目标方块的变换与移动;消除一行并计分,方块堆满时结束游戏等俄罗斯方块的基本功能。
此次设计初期是在keil和proteus联合仿真中进行,编程语言为c语言,后期是进行实物焊接。
关键词:俄罗斯方块;单片机;控制;仿真
Abstract
With the development of the single chip microcomputer application on handheld entertainment equipment, more and more application in the field of electronics.Such as: electronic pet, tetris, smart IC card, etc.Tetris is a popular global TV game and PSP games, it consists of the Russian alexei palmer jeters invention, therefore the name.
This article chooses STC89C52RC single-chip microcomputer as the system of chip, realize human-machine interaction, entertainment, etc.Selection of tetris game interface, graphical display LCD12864 implementation;Choose independent control game buttons.This design is to realize the basic function of: key control target square transformation and movement;Remove a row and scoring, square pile end game tetris, such as the basic functions.
The early stage of design is done in keil and proteus simulation, programming language is the c language, is late for real welding.
Keywords: Russian square;Microprocessor;Control;Simulation 目 录
1绪 论 1
1.1课题背景 1
1.2课题的研究现状及意义 1
1.3课题任务及要求 2
2整体方案设计 3
2.1设计方案 3
2.2系统的核心部分单片机 3
2.3程序整体思路 4
2.4图形显示 5
2.5消层算法 5
2.6系统总体结构框图 6
2.7系统的工作过程 6
3俄罗斯方块的硬件设计 7
3.1单片机电路 7
3.1.1 STC89C52RC单片机介绍 7
3.1.2 STC89C52RC单片机的标准功能 8
3.1.3 晶振特性 10
3.1.4单片机的复位电路 11
3.2 LCD12864液晶屏 11
3.2.1液晶显示模块概述 11
3.2.2 模块引脚说明 12
3.2.3指令描述 12
3.2.4汉字字模提取 23
3.3 LCD的驱动方法 24
3.4按键控制电路 25
3.5 硬件总体设计 25
4俄罗斯方块的软件设计 26
4.1开发工具介绍 26
4.2程序流程图 27
4.2.1主程序流程图 27
4.2.2游戏外观显示流程图 29
4.2.3俄罗斯方块向左/右移动工作流程图 30
4.2.4俄罗斯方块中按下键的流程图 31
4.3本章小节 31
5 系统仿真 32
5.1 Proteus仿真软件介绍 32
5.2显示屏系统仿真的效果 33
5.2.
文档评论(0)