基于单片机的俄罗斯方块游戏设计
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
摘要
俄罗斯方块是一款风靡全球的电视游戏机和掌上游戏机游戏,它由俄罗斯人阿列克谢•帕基特诺夫发明,故得此名。俄罗斯方块的基本规则是移动、旋转和摆放游戏自动输出的各种方块,使之排列成完整的一行或多行并且消除得分。由于上手简单、老少皆宜,从而家喻户晓,风靡世界。
这次设计将使用52单片机和JM12864J液晶显示器组合,来实现比较简单的俄罗斯方块设计。详细介绍用单片机STC89C52控制JM12864J液晶显示器工作的硬件和软件实现过程,介绍了单片机STC89C52内部结构和性能。STC89C52是STC公司生产的一种低功耗、高性能CMOS8位微控制器,具有 8K 在系统可编程Flash存储器。STC89C52使用经典的MCS-51内核,但做了很多的改进使得芯片具有传统51单片机不具备的功能。在单芯片上,拥有灵巧的8 位CPU 和在系统可编程Flash,使得STC89C52为众多嵌入式控制应用系统提供高灵活、超有效的解决方案。具有以下标准功能: 8k字节Flash,512字节RAM, 32 位I/O 口线,看门狗定时器,内置4KB EEPROM,MAX810复位电路,3个16 位定时器/计数器,4个外部中断,一个7向量4级中断结构(兼容传统51的5向量2级中断结构),全双工串行口。另外 STC89C52 可降至0Hz 静态逻辑操作,支持2种软件可选择节电模式。空闲模式下,CPU 停止工作,允许RAM、定时器/计数器、串口、中断继续工作。掉电保护方式下,RAM内容被保存,振荡器被冻结,单片机一切工作停止,直到下一个中断或硬件复位为止。最高运作频率35MHz,6T/12T可选。
此次设计初期是在keil和proteus联合仿真中进行,编程语言为51汇编,后期是进行实物焊接。论文描述了俄罗斯方块的主要功能函数的实现。
关键词:俄罗斯方块; STC89C52单片机
Abstract
Tetris is a popular global TV game and PSP games, it consists of the Russian alexei palmer jeter's invention, therefore the name.Tetris is the basic rules of movement, rotation, and put the game automatically output various diamonds, make it into a complete one or more lines and eliminate scores.Because it is simple, for young and old, to household names, popular in the world.
This design will use 52 microcontroller and JM12864J LCD monitor, to achieve simple tetris design.Detail STC89C52 MCU control JM12864J LCDS work of hardware and software implementation process, and introduces the microcontroller STC89C52 internal structure and performance.STC89C52 on STC company is the production of a low power consumption, high performance CMOS8 microcontroller, with 8 k in system programmable Flash memory.STC89C52 to use classical MCS - 51 kernel, but did a lot of improvements made with traditional does not have the function of the 51 single-chip microcomputer chip.On a single chip, has the nimble 8-bit CPU and in system programmable Flash, make STC89C52 for many embedded control applications with high flexible and effective solution.Has the following functions: standard 8 k byte Flash, 512 bytes of RAM, 32 I/O port line, the watchdog timer, the built-in block 4 KB EEPROM, MAX810 reset circuit, three 16-bit timer/counter, 4 external interrupt, a vector 7 grade 4 interrupt structure (5 vector compatible with traditional 51 level 2 interrupt structure), full duplex serial port.In addition STC89C52 static logic operation can be reduced to 0 hz, support two kinds of software can choose power saving mode.Idle mode, the CPU to stop working, allowing the RAM, timer/counter, a serial port, continue to work.Power-fail protection way, the content of RAM are saved, the oscillator is frozen, the single chip microcomputer to stop all work, until the next interrupt or hardware reset.The highest 35 MHZ operating frequency, 6T / 12T is optional.
The early stage of design is done in keil and proteus simulation, programming of 51 assembly language, the late is real welding.Paper describes the main functions of the tetris function implementation.
Keywords:Tetris;STC89C52 single-chip microcomputer