Digital currency MCU
identifier ' b' Is the identifier; b' There is a wrong meaning
the common error prompt of identifier is: undefined identifier
Classic errors of C language:
the usage of void main() is not made by any standard. The standard syntax of C language is int main. Any implementation must support int main (void) {/ *... * /} and int main (int argc, char * argv)} {/ *... * /}
similar to a + = a +; Or (I + + + (I + + +) + (I + +) belongs to undefined behavior, which is not to say that this behavior has not been defined in C language. It has been decided for a long time, and its result depends on the compiler implementation
the specification of identifier in C language
1. The identifier consists of letter (A-Z, A-Z), number (0-9) and underline "" And the first character cannot be a number, but it can be a letter or an underline. For example, the correct identifier: ABC, A1, prog_ to
The length of the identifier is determined by the compiler system on the machine, and is generally limited to 8 characters (Note: the length limit of 8 characters is C89 standard, and the length of C99 standard has been extended, and most of the instrial standards are longer) The identifier is sensitive to case, that is, it is strictly case sensitive. Generally, variables are named in lowercase and symbolic constants are named in uppercase For example, length, sum, PI, etcIn order to control MCU through mobile app, GPRS needs to use flow card for remote communication control
WiFi connects to the external network through connecting routers. With fixed IP, it can control the remote communication directly. Without fixed IP, it can control the remote communication with the help of the server of the Internet of things platform (now there are free servers available)
Bluetooth & amp; Infrared, can carry on the close distance communication control< br />
you can't map it here. It's boring ·
otherwise I can give you ·
a complete MP3 player is divided into several parts: CPU, decoder, storage device, host communication port, audio DAC and power amplifier, display interface and control key. As shown in the picture above. The CPU and decoder are the core of the whole system. In my DIY works, these two parts are integrated in one chip. Here we usually call the central processing unit MCU (single chip microprocessor), referred to as MCU. It runs the entire MP3 control program, also known as firewall. Control the work of MP3 components: read data from the storage device and send it to the decoder for decoding; When connecting with the host, complete the data exchange with the host; Receive the operation of control keys, display the system running status and other tasks. Decoder is a hardware mole in the chip, or hardware decoding (some MP3 players are software decoding, completed by high-speed CPU). It can directly decode MP3 data streams of various formats and output PCM or I2S digital audio signals
storage device is an important part of MP3 player. Usually MP3 Walkman uses flash memory. In my works, hard disk memory is used as memory. It transmits data (usually in the form of file) through the communication port of the host computer. When playing back, MCU reads the data in the memory and sends it to the decoder. Data storage is to have a certain format, as we all know, PC management disk data is in the form of files, MP3 is no exception, the most commonly used way is to directly use the PC file system to manage memory, Microsoft operating system uses the fat file system, which is also the most widely used one. One of the tasks of the player is to implement the fat file system, that is, to access and read the data from the disk of the fat file system according to the file name
the host communication port is the way for MP3 player and PC to exchange data, through which PC can operate the data in MP3 player storage device, , delete and files. At present, the most widely used is USB bus, and follow the mass storage protocol defined by Microsoft, MP3 player is used as a mobile storage device of the host. Here we need to follow several specifications: USB communication protocol, large capacity mobile memory specification and SCSI protocol
audio DAC converts digital audio signal into analog audio signal to promote analog audio equipment such as earphone and power amplifier. Here we will introce the digital audio signal. Digital audio signal is relative to analog audio signal. We know that the essence of sound is wave. People say that the frequency of sound that can be heard is between 20Hz and 20kHz, which is called sound wave. The wave representation of analog signal is a continuous function. The basic principle is the superposition of waves with different frequencies and amplitudes. Digital audio signal is a kind of quantization of analog signal (as shown in the figure below). The typical method is to sample the time coordinates at equal time intervals and quantify the amplitude. The number of sampling times per unit time is called sampling frequency. In this way, a section of sound wave can be digitized into a series of values, and each value corresponds to the amplitude value of the corresponding sampling point. Arranging these numbers in order is the digital audio signal. This is the ADC (analog-to-digital conversion) process, DAC (digital to analog conversion) process on the contrary, will be continuous digital sampling frequency sequence into the corresponding voltage. The information decoded by MP3 decoder belongs to digital audio signal (digital audio signal has different formats, the most commonly used are PCM and I2S). It needs to be converted into analog signal through DAC converter to drive power amplifier and be recognized by human ear
the display device of MP3 player usually adopts LCD or LED. Display the working status of the system
the control keyboard is usually a button switch. The keyboard and real devices together constitute the man-machine interface of MP3 player.
this paper mainly introces: basketball game timer. This paper first introces the relevant knowledge of single chip microcomputer, carries on the corresponding research on single chip microcomputer, and uses it with 74HC595 serial display circuit. The main core of this circuit is AT89S51, which uses the combination of software and hardware to realize the automatic start-up. The counter is the first section, the section timer is 12 minutes and 00 seconds, and the violation of 24 seconds is 24 seconds. The number of basketball games at that time, the time of each session and the countdown of 24 seconds are displayed by numbers, and the serial display of single chip microcomputer is adopted. Finally, this paper will describe the installation and debugging of this circuit in detail, and make a brief description of the problems in the debugging process
key words: AT89S52 single chip microcomputer; 74HC595 XXX
Abstract
Abstract this article mainly introced: Basketball game timer. This article first introced that monolithic integrated circuit' s related knowledge, concts the corresponding research to the monolithic integrated circuit, and its and 74HC595 serial display circuit coordination use. This electric circuit main core is AT89S51, realizes using the software and hardware' s union starting sets at the festival counter for first, the festival timer is 12 minute 00 second automatically, 24 second case of breaching the rules is 24 seconds. With the digital demonstration basketball game at that time the pitch number, each time and 24 second countdown, used the monolithic integrated circuit serial demonstration. Finally, this article will narrate this electric circuit' s installment and the debugging in detail, and to will debug the question which in the process will appear to give the briefing< br />
key words 89S52 monolithic integrated circuit; 74HC595; XXX
subject background
with the rapid development of electronic technology, the humanization and intellectualization of electronic procts have been very mature, and its development prospect is still immeasurable. Today's people need an electronic proct that can bring convenience to themselves. Of course, it's better to be humanized and intelligent. How can we be intelligent? The introction of MCU is a good example. SCM, also known as single chip microcomputer, also known as microcontroller, is an important branch of microcomputer. SCM is a large-scale integrated circuit chip developed in the mid-1970s. It is a device that 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 the computer through two branches of computer system and embedded computer system. At present, SCM has penetrated into every field of our life, it is almost difficult to find any field without SCM. Around us, there are automatic washing machines, high-grade electric fans, electronic kitchenware, frequency conversion air conditioning, remote control color TV sets, video recorders, VCD / DVD players, combination audio, electronic organ, etc. with MCU as the main controller. Single chip microcomputer has been in a wide range of computer applications in the performance of incisively and vividly, out of the limelight. From household appliances to office automation procts such as copiers, printers, scanners and fax machines; From intelligent instrument, instrial measurement and control device to CT, MRI γ Knife and other medical equipment; From digital cameras and video recorders to aerospace technology, navigation equipment and modern military equipment; From all kinds of electronic currency, such as telephone card, water and electricity card to identity card, access control card, file management card and related card reader / writer, SCM plays an important role in it. Therefore, SCM has become one of the professional technologies that electronic workers must master. Single chip microcomputer is a micro central processor, which can complete a lot of intelligent work through programming. Therefore, its emergence has played a great role in promoting the intellectualization and miniaturization of electronic technology. With the improvement of people's living standards and the development of social economy, people begin 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 decision to ensure the smooth progress of the game. This requires a special timing tool. So I designed a basketball game timer. The design is simple, low cost and easy to make. It can be used in street basketball match and campus basketball match. You can get a practical basketball game timer for very little money
this design focuses on the understanding of the working principle of single-chip microcomputer and keyboard control and display principle, so as to lay a foundation for my future study and development in the field of single-chip microcomputer, improve my hands-on ability and design ability, cultivate innovation ability, enrich my theoretical knowledge, and combine theory with practice. The significance of this design lies in the further 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. The design further understand the basic circuit design process, improve their design concept, enrich their theoretical knowledge, consolidate the knowledge, so that their hands-on brain ability to further improve, for their future study and work to lay a good foundation for their professional skills<
Introction to design
in basketball games, in addition to the total time countdown, in order to speed up the rhythm of the game, the new rules also require the attacker to have a shot in 24 seconds, otherwise it will be regarded as a violation. According to the requirements, a basketball game timing controller is designed based on AT89S52 MCU. The first half and the second half of the basketball match are controlled four times, with 12 minutes in each session. It is required to be able to pause at any time. After starting, the timing will continue, and it can be cleared after the end of a session. According to the rules of basketball game, the attacker has 24 seconds as an example& quot; Score & quot& quot; Second & quot; LED digital tube is used for display. Use the switch to control the start / pause of the timer. The design of the basketball game timer can time the total time of the game and each time the players control the ball. The timer uses key operation and LED display, which is very practical. This timer can also be used as the timer of other ball games after the program parameters are slightly modified
the main control chip is AT89S52, which uses 12Mhz crystal oscillator, p0.0-p0.7 as keyboard input. A1 is the 12 minute pause key; A2 is to start the 12 minute timer button, and the 24 second timer starts; A3 is 24s reset open key (press this key when shooting or exchanging control ball); A4 is the 24 second timer stop key (no violation); A5 is the start key for total timing and 24 second timing at the same time; A6 is the stop key for total timing and 24s timing at the same time
the circuit uses static display to light up all digital tubes together and display different characters at the same time. Turn on the digital tube latch output. The first digit of the display shows the number of timing sections, the third to sixth digits show the minutes of timing, and the last two digits show 24 seconds. The t0 timer is used to interrupt for 24 seconds, and the T1 timer is used to interrupt for 12 minutes. At the same time, the circuit scans through the keyboard and turns to the corresponding key according to the key value<
design scheme of system circuit
proposal of system design scheme
this design is a keyboard control and display circuit design based on 89S52 single chip microcomputer. From the design function of the system, the system can be divided into two parts, namely keyboard input control part and display part. There are different design schemes for each part, At first, I worked out the following two schemes:
the first scheme:
the keyboard control adopts matrix scanning keyboard, which can be composed of four common keys × 4 matrix keyboard, which is directly connected to port P0 of 89S52 single chip microcomputer. The high four bits are used as rows and the low four bits are used as columns. The scanning and positioning of keyboard are completed by software. The display part adopts dynamic display, uses shift register 74LS164 and decoder 74LS138 to drive seven segment nixie tube display through display driver. The cost of this scheme is low, the price of the two peripheral chips used is very low, and the I / O port of single-chip microcomputer occupies less, which can save the interface resources of single-chip microcomputer
the second scheme:
independent keyboard is used for keyboard control, and the & quot; Connect to zero end & quot; The & quot; Test end & quot; By detecting the level state of the input line, it is easy to determine which key has been pressed. This method has high operation speed and simple software structure. This method is more suitable for the occasion of less keys or higher operation speed. The display part adopts the static display method. The so-called static display means that each display occupies a separate interface with latch function for stroke font code. In this way, as long as the MCU sends the font code to the interface circuit, it doesn't need to worry about it. Until it wants to display new data, it sends the new font code. Therefore, the CPU cost of this method is small
determination of the scheme
this design requires more keys, and this design is only a practice of the learned knowledge, the design requirements are simple, easy to implement, and the cost is low. Compared with the above two design schemes, the second one is low cost, occupies less MCU resources, and is easy to realize. This design is more suitable for this design, so the second design scheme is selected<
circuit design principle and chip introction
keyboard control and display circuit design principle and requirements
circuit design principle and functional requirements
this design uses AT89S52 single chip microcomputer chip as the central processing chip, uses the P port of AT89S52 to form an independent 8-key keyboard, uses AT89S52 serial port static display, and uses 74HC595 as the LED driver chip< The circuit design has the following functions and requirements:
(1) the basketball game timer is 48 minutes, a total of four sections, each section of 12 minutes and 24 seconds violation. It is required to automatically set the section counter as the first section, the section timer as 12 minutes and 00 seconds, and the 24 second violation as 24 seconds
(2) the number of basketball sessions, the time of each session and the countdown of 24 seconds are displayed by digital display, and the serial display of single chip microcomputer is adopted
(3) you can use the button switch to control the start / pause of the game at any time. After the start, the game starts. There is no time ring the pause, and the time will continue after the restart< According to the design tasks and requirements, the system can be preliminarily divided into five functional moles: main circuit, switch start / stop control circuit, display circuit, audio circuit and + 5V regulated power supply. The main circuit uses 89S52 as CPU; The switch start / stop control circuit consists of eight buttons; The display circuit is composed of 8-bit 7-segment nixie tube and 74HC595; The sound circuit uses ULN2003 to drive the buzzer+ The 5 V voltage stabilizing circuit adopts 7805 voltage stabilizing block to stabilize the power supply voltage at + 5 v.
1. Take the task of energy center abyss party
2. According to the requirements, pass through the four underground city maps in the energy center, and get the Lord's task items (there should be four spaces in the taskbar)
3. After obtaining all the mission items, you can start the abyss Party of the energy center.