Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Chen 2009

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2009

2021 Third International Symposium on Intelligent Information Technology Application

Tetris Game system Design Based on AT89S52 Single Chip Microcomputer

Xiao Chen, Chaoran Lin


Department of Electronic Information Engineering
Nanjing University of Information Science and Technology
Nanjing 210044, China
rainofsun@netease.com

Abstract—Tetris game is one of the most popular and performance property and low cost[4-6]. The most obvious
intersting computer game. To reduce the cost and simply the advantage of single chip microcomputer is that can be
circuit, a Tetris game system is developed base on single chip embedded into a variety of instruments, devices. When it is
microcomputer and light-emitting diode dot matrix moudle.
firstly invented, Intel Corporation gave the name of
The hardware and application software of system are
designed and the whole principle of various details in the embedded microcontroller [7]. It can also applies to the
system is described. The system including five parts: single development of single-chip products for consumer
chip microcomputer, address lock module, LED display entertainment. Game design can be seen as a consumer
module, input module and C51 program. The input module is entertainment products for the support and application
composed of five keys through which one plays Tetris game. development. The paper designs the stand-alone Tetris
The address lock module uses 74ls373 chip to realize the game to the lives of people enjoy the art of aesthetic
multiplexing of P0 port. AT89S52 single chip microcomputer pleasure and health supplement. Compared with other
is used as the main contrl circuit for data processing. The procedures, there are two characteristics: First, the well-
software is developed in C language environment. The
designed man-machine interface is not only friendly but
designed system is simulated with PROTEUS software. The
external keys are simualted to control the movement of
also easy to operate. Second, the author used in the game is
different form pieces when playing the game. It is indicated a single board. It has some advantages such as high speed,
that this design can achieve the basic function of the game and low cost and more efficienctly.
realize the intended purpose. The system has many
advantages such as small volume, very low cost, convenient II. SYSTEM
usage and strong function. The system realized all the functions of Tetris game
based on AT89S52 single chip microcomputer and LED. It
Keywords-Teris game;single chip microcomputer; AT89S52; uses five buttons. Four of them are corresponding to the
LED; 74LS373
four directions and another correspinding to rotating
movement. Users can practice and entertainment. The
I. INTRODUCTION system can indate the next piece and when the piece comes
Tetris game is one of the most popular computer game to rest, this line is automatically removed. When piece
in all over world, which was invented by the mathematician reach the top of the game board, the game is over. To
Alexey Pazhitnov in the middle of 1980s. The game can reduce the cost, LED is selected as the display unit. The
play simply and change so much. Tetris game is with the system is shown in Fig.1 as follows.
development of the computer, and attributed to the
evolution of a variety of similar games. It trains a player's
ability to respond. The basic rule is as follows. Firstly a
gameboard is given that is a rectangular grid with all empty
cells. Random tetrominoes is generated. Each large piece
composed of four small square. When it falls the player can
rotate and/or slide it horizontally. It stops falling when it
lands on. If the piece comes to rest, this line is cleared. As
soon as a piece ladns on, the next piece appears at the top
of the gameboard. When the window can no longer
accommodate any more pieces, it declared the end of the
game [1]. Tetris game has been studied from many points
of view [2,3].
Although the development of personal computers, the
single chip microcomputer has been widely used in various Figure 1. The system scheme
industrial and technical fields because of its high

978-0-7695-3859-4/09 $26.00 © 2009


2021 IEEE
IEEE 256
DOI 10.1109/IITA.2021.239
10.1109/IITA.2009.239
III. HARDWARE
The principle function of the single chip microcomputer
control circuit is the data processing. We select AT89S52
single chip microcomputer to control the circuit. It is an
8bits CMOS single chip microcomputer with low power
consumption and high performance. This chip contains
8KB ISP Flash EPROM which can be wrote more than
1000 times and 256B RAM. The apparatus is made of
adopting the nonvolatile storage technology with high
density of ATMEL Company. It has many functions such
as special applied 16bits timing/counter, and it is
compatible with standard 80C51 instruction system and
80C51 pin structure, and the chip integrates 8bits central
processor and ISP Flash location and it can offer solution
with high cost performance for many embedded control
application systems [8].
Clock circuit is the heart of the computer, which
controls the rhythm of the work of the computer. The clock
signal 8052 single chip microcomputer can be generated in
two ways: one is the internal way, using the chip's internal
oscillator circuit to produce the clock signal; another way
for the external clock signal introduced from the outside.
This design approach is the internal clock circuit. 12MHz
crystal oscillator is used for the crystal oscillator.
Lock circuit is to achieve a major role in the low 8-bit
system address. Because P0 port uses both as lines for the
address and data lines as the use of a dual function, it needs
a multiplexing of address and data separation. Structural
geology in the bus for this purpose should be to increase an
8-bit latch. First of all, by the lock system to provide
Figure 2. LED dot matrix
temporary and low 8-bit address, then P0 port uses as data
lines. modularization program design idea for the transfer, so the
In this system the lock circuit uses chip 74LS373. Its hierarchy and structure of the software will be clearer for
output o0-o7 can be linked directly with the computer bus. the debugging and modification of the software.
When the tri-state control terminal OE to allow time for the Te software has some functions as follows. When the
low, o0-o7 normal logic state, can be used to load or bus device boot, the welcome message is shown in the
driver. When OE is high time, o0-o7 showed high gameboard. If the roationg key is pressed, game starts. The
resistance state, that is, do not drive the bus, nor for the bus microcompute then scan the keys on the keyboard and get
load, but the logic of the internal latch operation is not the key value. The software controls the human-computer
affected. When the latch to allow for high-end LE when, O interaction. At the condition of game running, the piece
and D change with the data. When LE is low, when, O has moves left if the “left” key is pressed; the piece moves right
established the existence of locked-level data. if the “right” key is pressed; the piece moves down faster if
The keyboard has five keys. Four of them are the “down” key is pressed. Game interface LED dot matrix
corresponding to the four directions and another unit in the right display will appear the next piece, the left
correspinding to rotating movement. The keyboard single side of LED displays the normal execution of game
inputs single chip microcomputer directly. interface. The whereabouts of the piece will, when one was
LED dot matrix display module circuit is the game filled, the layer will automatically eliminate.
interface. In our Tetris game lattice formed by the four
LED circuit. The internal structure of lattice model is
shown in Fig.2. V. RESULT
The designed Tetris game cricuit structure is shown in
According to the previous design, We used PROTEUS
Fig. 3.
software to simulate the system circuit. Proteus is a
IV. SOFTWARE comprehensive function electronic design automation
software, which can be used not only for analog and digital
The software design adopts C computer language and
circuit simulation analysis, but also be applied to single-
respectively programs different functional modules by the

257
Figure3. The system hardware

chip microcomputer and its peripheral circuit simulation. advantages such as small volume, very low cost,
This softare supported by the microprocessor chip convenient usage and strong function. The system is
including 8051 series, AVR series, PIC series and so on. convenient to be extended in the market.
The simulation results shows this design can achieve the
basic function of the game and realize the intended purpose
as displayed in Fig.4-6.

VI. CONCLUSION
Tetris game has been played for a long history in all
over the world. As the most popular game on the earth,
Tetris game has many versions and can play at different
terminals such as personal computer, mobile phone, on the
internet. In this paper, a Tetris game system is developed
base on single chip microcomputer and light-emitting diode
dot matrix moudle. The hardware and application software
of system are designed and the whole principle of various Figure 4. Game starting
details in the system is described. The system has many

258
257
The work is supported by the Basic Research Program
(Natural Science Foundation) of Jiangsu Province of China
(Granted No. BK2007601) and "Qing Lan Gong Cheng"
program of Jiangsu Province of China.

REFERENCES
[1] Davide Baccherini, Donatella Merlini, Combinatorial analysis of
Tetris-like games, Discrete Mathematics, Volume 308, Issue 18, 28
September 2008, Pages 4165-4176.
Figure 5. Game running [2] H. Burgiel, How to lose at Tetris, Math. Gaz. 81 (1997) 194-200.
[3] H.J. Hoogeboom, W.A. Kosters, Tetris and decidability, Inform.
Process. Lett. 89 (6) (2004) 267-272.
[4] X M Pan, Y F Wang, Practical single-chip microcomputer system
design. Beijing: Posts & Telecom Press, 1992.7
[5] M Q Cai, MCS-51 series single-chip microcomputer system and its
application. Beijing: Higher Education Press, 1992.8.
[6] Fan Yongxian, The Design of Game System Based on
STC89C54RC/RD+MCU, Journal of Hunan University of
Technology, 21(5), 2007: 66-69.
[7] Intel corporation, 1981, MCS-51(tm) family of single chip
microcomputers: Users manual. Santa Clara: Intel Corporation.
[8] YC SUN, The new ATMEL's AT89S52 and its applications, 2004 -
Figure 6. Game over Beijing: Tsinghua University Press.

ACKNOWLEDGMENT

259
257

You might also like