This paper mainly introduces: basketball game timer. Firstly, this paper introduces the related knowledge of single chip microcomputer, and makes corresponding research on single chip microcomputer, which is used in conjunction with 74HC595 serial display circuit. The main core of this circuit is AT89S5 1. By combining software and hardware, the segment counter is automatically set as the first segment, the segment timer is 12 minutes and 00 seconds, and the violation within 24 seconds is 24 seconds. The number of basketball games at that time, the time of each game and the 24-second countdown were displayed by numbers, and the serial display was carried out by single chip microcomputer. Finally, this paper will describe the installation and debugging of the circuit in detail, and briefly explain the problems in the debugging process.
AT89S52 single chip microcomputer; Single chip microcomputer; 74HC595XXX
abstract
This paper mainly introduces the basketball game timer. Firstly, this paper introduces the related knowledge of single chip microcomputer, makes corresponding research on single chip microcomputer, and uses it with 74HC595 series display circuit. The main core of the circuit is AT89S5 1, which is set on the holiday counter for the first time by combining software and hardware. The holiday timer is automatically 12 minutes and 00 seconds, and the violation in 24 seconds is 24 seconds. Digital display of the number of basketball courts at that time, each time and 24 seconds countdown, using single chip microcomputer serial display. Finally, this paper will describe the installation and debugging of the circuit in detail, and give a brief explanation of the problems that will occur in the debugging process.
Keywords 89S52 single chip microcomputer; 74HC595XXX
Project background
With the rapid development of electronic technology today, the humanization and intelligence of electronic products are very mature, and its development prospect is still immeasurable. What people need now is an electronic product that can bring convenience to themselves. Of course, it is best to be humanized and intelligent. How can we be smart? The introduction of single chip microcomputer is a good example. Single chip microcomputer, also known as single chip microcomputer and microcontroller, is an important branch of microcomputer. Single chip microcomputer is a large-scale integrated circuit chip developed in the mid-1970s, which integrates CPU, RAM, ROM, I/O interface and interrupt system on the same silicon chip. The birth of single chip microcomputer marks the formal formation of two branches of computer: penetrating computer system and embedded computer system. At present, single-chip microcomputer has penetrated into every field of our lives, and it is almost difficult to find out which field has no trace of single-chip microcomputer. Around us, there are automatic washing machines, high-grade electric fans, electronic kitchen utensils, variable frequency air conditioners, remote control color TVs, video recorders, VCD/DVD players, stereos, electronic keyboards and so on. Single-chip microcomputer has shown incisively and vividly in the broad field of computer application, and shines brilliantly. From household consumer appliances to office automation products, such as copiers, printers, scanners and fax machines; From intelligent instruments and industrial measurement and control devices to medical equipment such as CT, MRI and gamma knife; From digital cameras and video cameras to aerospace technology, navigation equipment and modern military equipment; From telephone cards, water and electricity cards and other electronic money to ID cards, access cards, file management cards and related card readers. Single chip microcomputer plays an important role. Therefore, single-chip microcomputer has become one of the professional technologies that electronic workers must master. Single-chip microcomputer is a kind of miniature central processing unit, which can accomplish a lot of intelligent work through programming, so its appearance has greatly promoted the intelligence and miniaturization of electronic technology. With the improvement of people's living standards and the development of social economy, people began to consider the enjoyment of spiritual life and pay attention to the improvement of physical quality. Start holding some small basketball games. This requires the referee to have a fair penalty to ensure the smooth progress of the game. This requires a special timing tool. So I designed a basketball game timer. Simple design, low cost and easy manufacture. It can be used in street basketball games and campus basketball games. You can buy a practical basketball game timer with little money.
This design pays attention to the understanding of the working principle of single chip microcomputer and the principle of keyboard control and display, laying a foundation for my future study and development in the field of single chip microcomputer, improving my hands-on ability and design ability, cultivating my innovation ability, enriching my theoretical knowledge and integrating theory with practice. The significance of this design also lies in a deeper understanding of the internal structure and working state of the single chip microcomputer, as well as the interface technology, interrupt technology, storage mode and control mode of the single chip microcomputer. This design further understands the design process of the basic circuit, improves my design concept, enriches my theoretical knowledge, consolidates what I have learned, further improves my hands-on and brain skills, and lays a good foundation for my future study and work, as well as professional skills.
Brief introduction of design
In addition to the countdown of the total time, in order to speed up the pace of the game, the new rules also require the attacker to shoot once within 24 seconds, otherwise it will be considered illegal. According to the requirements, the timing controller of basketball match is designed with AT89S52 single chip microcomputer as the core. Basketball matches are controlled four times in the first and second half, with each session 12 minutes. It is required to pause at any time, continue counting after the start, and reset after the session. According to the rules of basketball game, the attacker has 24 seconds as an example. "Minute" and "second" display of LED digital tube. Use the switch to control the start/pause of the timer. The design of the basketball game timer can count the total time of the game and the holding time of both sides. The timer is operated by keys and displayed by LED, which is very practical. This timer can also be used as a timer for other ball games with a slight modification of program parameters.
The main control chip is AT89S52, 12MHz crystal oscillator, and P0.0-P0.7 is used as keyboard input. A 1 Yes 12 minute pause key; A2 is the key to start the 12 minute timer, which starts in 24 seconds; A3 is the 24S reset key (press this key when shooting or exchanging possession); A4 is the 24-second timer stop key (no violation); A5 is the key to start the total time and the 24-second timer at the same time; A6 is the simultaneous stop key for total time and 24-second timer.
The circuit adopts static display, which lights the digital tubes together and displays different characters at the same time. Light up the latch output of each digital tube. The first digit of the display screen shows the number of counting periods, the third to sixth digits show the number of minutes, and the last two digits show 24 seconds. Use T0 timer to interrupt for 24 seconds, and use T 1 timer to interrupt 12 minutes. At the same time, the circuit scans through the keyboard and turns to the corresponding key according to the key value.
System circuit design scheme
The proposal of system design scheme
This design is based on the keyboard control and display circuit design of 89S52 single chip microcomputer. Judging from the design function of the system, the system can be divided into two parts, namely the keyboard input control part and the display part. Each part has a different design scheme. At first, I drew up the following two plans:
The first scheme:
The keyboard is controlled by a matrix scanning keyboard, and can be composed of ordinary keys. It is directly connected to the P0 port of the 89S52 single chip microcomputer, with the upper four bits as rows and the lower four bits as columns. The scanning and positioning of the keyboard are completed by software. The display part adopts dynamic display. The shift register 74LS 164 and the decoder 74LS 138 are used to drive the seven-segment nixie tube to display. The cost of this scheme is low, the price of two peripheral chips used is very low, and the I/O port of single chip microcomputer takes up less, which can save the interface resources of single chip microcomputer.
The second plan:
The keyboard is controlled by a separate keyboard. The "zero terminal" of each key is grounded, and the "test terminal" of each key is connected with an input line. By detecting the level state of the input line, it is easy to judge which key was pressed. This method has fast operation speed and simple software structure. This method is more suitable for occasions with fewer keys or higher operation speed. The display part adopts static display mode. The so-called static display means that each display should occupy a separate interface with latch function for the stroke segment code. In this way, as long as the microcontroller sends the font code to be displayed to the interface circuit, it doesn't matter until the new data is displayed, and then the new font code is sent. Therefore, using this method, the CPU overhead of single chip microcomputer is very small.
Determination of scheme
This design needs more keys, and this design is just a practice we have learned. Simple design requirements, easy implementation and low cost. Compared with the above two design schemes, the second design scheme has low cost, takes up less resources of single chip microcomputer and is easy to realize. This design is more suitable for this design, so I chose the second design scheme.
Circuit design principle and chip introduction
Principles and requirements of keyboard control and display circuit design
Design principle and functional requirements of the circuit
In this design, AT89S52 microcontroller is used as the central processing chip, the P0 port of AT89S52 is used to form an independent 8-key keyboard, the serial port of AT89S52 is used for static display, and 74HC595 is used as the LED driver chip.
The circuit design has the following functions and requirements:
(1) The total time of the basketball game timer is 48 minutes, and there are * * * four sections, each section is 12 minutes and 24 seconds. It is required to start the automatic node setting counter as the first segment, the node timer as 12 minutes and 00 seconds, and the 24-second violation as 24 seconds.
(2) The number of basketball games, the time of each game and the 24-second countdown are displayed by numbers, and the serial display by single chip microcomputer is adopted.
(3) The button switch can control the start/pause of the game at any time. After the start, the game will start, and the time will not be counted when the game is paused, but will continue after the restart.
Overall design block diagram of the circuit
According to the design tasks and requirements, the system is initially divided into five functional modules: main circuit, switch start-stop control circuit, display circuit, audio circuit and +5V regulated power supply. Specifically, the main circuit chooses 89S52 as the central processing unit; The switch start/stop control circuit consists of eight keys; The display circuit consists of eight-bit seven-segment digital tube and 74HC595. The audio circuit uses ULN2003 to drive the buzzer; +5V regulator circuit uses 7805 regulator to stabilize the power supply voltage at +5V.