Single chip microcomputer
Introduction
Single-chip microcomputer is also called single-chip microcontroller. It is not a chip that completes a certain logic function, but integrates a computer system into a chip. It is equivalent to a miniature computer. Compared with a computer, the single-chip microcomputer only lacks I/O equipment. In a nutshell: a chip becomes a computer. Its small size, light weight and low price provide convenient conditions for learning, application and development. At the same time, learning to use a single-chip microcomputer is the best choice to understand the principle and structure of the computer.
Single-chip microcomputers have been used in a wide range of fields, such as smart meters, real-time industrial control, communication equipment, navigation systems, household appliances, etc.
Since the 1990s, single-chip technology has been developed. With the progress of the times and the development of technology, the practical application of this technology is becoming more mature, and single-chip computers are widely used in various fields. Nowadays, people pay more and more attention to the development and application of single-chip microcomputers in intelligent electronic technology. The development of single-chip microcomputers has entered a new era. Whether it is automatic measurement or the practice of smart meters, you can see the presence of single-chip technology. In the current process of industrial development, the electronics industry is an emerging industry. In industrial production, people successfully use electronic information technology to integrate electronic information technology with single-chip microcomputer technology, which effectively improves the application effect of single-chip microcomputers. As a branch of computer technology, the application of single chip microcomputer technology in the field of electronic products has enriched the functions of electronic products, and also provided a new way for the development and application of intelligent electronic equipment, realizing the innovation and development of intelligent electronic equipment .
Single-chip microcomputer is also called monolithic microcontroller, which belongs to an integrated circuit chip. The single-chip microcomputer mainly includes CPU, read-only memory ROM and random access memory RAM, etc. The diversified data acquisition and control system can allow the single-chip microcomputer to complete various complex operations, whether it is to control operation symbols or issue operation instructions to the system. Completed by the microcontroller. It can be seen that the single-chip microcomputer can be fully applied in intelligent electronic equipment by virtue of its powerful data processing technology and calculation function. Simply put, a single-chip microcomputer is a chip, this chip constitutes a system, through the application of integrated circuit technology, data computing and processing capabilities are integrated into the chip to achieve high-speed data processing.
Basic structure
The block diagram of the single-chip microcomputer is shown in the figure below:
The arithmetic unit
The arithmetic unit is composed of arithmetic logic Unit (Arithmetic & Logical Unit, ALU), accumulator and register are composed of several parts. The function of the ALU is to perform arithmetic or logical operations on the incoming data. The input source is two 8-bit data, which come from the accumulator and the data register respectively. ALU can complete operations such as adding, subtracting, AND, OR, comparing the size of these two data, and finally storing the result in the accumulator.
The arithmetic unit has two functions:
(1) Perform various arithmetic operations.
(2) Perform various logic operations and conduct logic tests, such as zero value test or comparison of two values.
All operations performed by the arithmetic unit are directed by the control signal sent by the controller, and an arithmetic operation produces an operation result, and a logic operation produces a judgment.
Controller
The controller is composed of a program counter, an instruction register, an instruction decoder, a timing generator, and an operation controller. Coordinate and direct the operation of the entire microcomputer system. Its main functions are:
(1) Take an instruction from the memory and point out the location of the next instruction in the memory.
(2) Decode and test instructions, and generate corresponding operation control signals to facilitate the execution of prescribed actions.
(3) Command and control the direction of data flow between CPU, memory, and input and output devices.
The microprocessor interconnects the ALU, counter, register and control part through the internal bus, and connects with the external memory and input and output interface circuits through the external bus. The external bus is also called the system bus, which is divided into data bus DB, address bus AB and control bus CB. Through the input and output interface circuit, realize the connection with various peripheral devices.
Main register
(1) Accumulator A
Accumulator A is the most frequently used register in the microprocessor. It has dual functions in arithmetic and logical operations: before the operation, it is used to save an operand; after the operation, it is used to save the result of the sum, difference or logical operation.
(2) Data register DR
Data register is a temporary storage unit that sends (writes) or fetches (read) data to memory and input/output devices through the data bus. It can save an instruction that is being decoded, it can also save a data byte that is being sent to the memory for storage, and so on.
(3) Instruction register IR and instruction decoder ID
Instructions include opcodes and operands.
The instruction register is used to save an instruction currently being executed. When an instruction is executed, it is first fetched from the memory to the data register, and then transferred to the instruction register. When the system executes a given instruction, the operation code must be decoded to determine the required operation, and the instruction decoder is responsible for this work. Among them, the output of the opcode field in the instruction register is the input of the instruction decoder.
(4) Program counter PC
PC is used to determine the address of the next instruction to ensure that the program can be executed continuously, so it is usually called the instruction address counter. Before the program starts to execute, the memory unit address of the first instruction of the program (that is, the first address of the program) must be sent to the PC so that it always points to the address of the next instruction to be executed.
(5) Address register AR
The address register is used to save the address of the memory unit or I/O device that the current CPU wants to access. Due to the difference in speed between memory and CPU, address registers must be used to maintain address information until the memory read/write operation is completed.
Obviously, when the CPU stores data to the memory, the CPU accesses data from the internal memory, and the CPU reads instructions from the memory, address registers and data registers are all used. Similarly, if the address of the peripheral device is viewed as a memory address unit, then when the CPU and the peripheral device exchange information, the address register and the data register are also needed.
Hardware features
(1) The single-chip microcomputer has a relatively small size, and the internal chip is used as a computer system. Its structure is simple, but the functions are complete, it is very convenient to use, and it can be modularized.
(2) The single-chip microcomputer has a high degree of integration and strong reliability. Even if the single-chip microcomputer is working for a long time, there will be no malfunction.
(3) The low voltage and low energy consumption of single-chip microcomputers are the first choice in people's daily life, which provides convenience for production and research and development.
(4) The single-chip microcomputer has a strong ability to process data and arithmetic. It can be used in various environments and has a strong control ability.
Structure and function of 51 single-chip microcomputer
History
The development of single-chip microcomputer has gone through stages such as 4-bit, 8-bit, 16-bit and 32-bit. 8-bit single-chip microcomputers are widely used in various fields such as industrial control, intelligent interface, instrumentation, etc. due to their strong functions. 8-bit single-chip microcomputers still occupy the mainstream position in medium and small-scale applications. Plays an increasingly important role. In the early 1980s, Intel introduced the 8-bit MCS-51 series of microcontrollers.
Components of 51 single-chip microcomputer
Logical components of MCS-51 single-chip microcomputer, including an 8-bit CPU and on-chip oscillator, 80514B mask ROM, 87514KBEPROM, 8031 without ROM, special functions Register SFR128BRAM, timer/counter T0 and T1, parallel I/O interface: P0, P1, P2, P3; Serial interface: TXD, RXD; Interrupt system: INT0, INT1.
Basic functions
CPU with 1.8-bit data bus and 16-bit address bus;
2. Boolean processing capability and bit Processing capacity;
3. Adopt Harvard structure, program memory and data memory address space are independent, easy to program design;
4. 64KB program memory and 64KB data memory with the same address;
5.0-8KB on-chip program memory (no 8031, 4KB for 8051, 8KB for 8052, 20KB for 89C55);
6.128 bytes of on-chip data memory (8051 has 256 words Section);
7.32 bidirectional and bit-addressable I/O lines;
8. Two 16-bit timers/counters (there are 3 in 8052);
p>9. A full-duplex serial I/O interface;
10. The interrupt structure of multiple interrupt sources has two interrupt priority levels;
11. On-chip clock oscillator.
Features
The features of single-chip microcomputers can be summarized into the following aspects: high integration; large storage capacity; strong external expansion capabilities; strong control functions.
1. From the internal hardware to the software, there is a complete set of bitwise operating systems called bit processors. The processing objects are not words or bytes but bits. It can not only process a bit of some special function registers on the chip, such as transfer, set, clear, test, etc., but also perform bit logic operations. Its functions are very complete and easy to use.
2. At the same time, a dual-function address interval is specially opened in the on-chip RAM interval, which is extremely flexible to use. This function undoubtedly provides users with great convenience.
3. Multiplication and division instructions, which also bring convenience to programming. Many 8-bit single-chip microcomputers do not have the multiplication function, and it is very inconvenient to compile a subroutine call when doing multiplication.
Application
Energy-saving control
As smart electronic devices may be carried out frequently, the energy consumption requirements for these devices are very high, so they often Some energy-saving control modules will be designed to increase the standby time of smart electronic devices. The application of single-chip microcomputer technology in energy-saving control is mainly divided into the following aspects: First, when smart electronic devices are out, most of them are in light-load mode. At this time, energy-saving control is required to ensure their basic functions. , To further reduce power consumption. Through the collection of data in smart electronic devices, the single-chip microcomputer can roughly infer that the current device is at a lower load. At this time, the voltage and current output can be reduced to achieve the purpose of energy saving; second, the single-chip microcomputer can control the rhythm of energy consumption, such as: In the Mi Band, the human body’s heart rate, sleep, and exercise steps are collected. These numbers will be stored locally after being collected, and then reported at a minute-level frequency; when the information is not reported, the device is in a state of low energy consumption. When information is reported, there will be some network transmission consumption. The single-chip microcomputer can control the rhythm of energy consumption and control most of the time of the bracelet in a low energy consumption state, which can make the standby time as long as 72 hours or more.
Intelligent voice devices
In order to better improve the intelligence of smart electronic devices, humans can be controlled through simple language to achieve the purpose of voice man-machine interaction. At present, the voice processing chip has been developed and is beginning to be used in smart electronic devices. The application of single-chip microcomputer in intelligent voice equipment is mainly divided into the following two parts: First, in terms of software settings, because the single-chip microcomputer can process some business logic through programming, it can operate the intelligent voice processing process. For example: in the navigation smart electronic device, some of the road names, distances, etc. can be extracted, and then broadcast; at the same time, you can also choose different names and kisses to broadcast, truly realize intelligent customized operations, and better meet User needs; secondly, in terms of hardware design, because smart voice devices consume more resources, in order to better extend the standby time of the product, the single-chip technology will be used to dynamically control the power of the product to further reduce the power consumption. At the same time, it can also improve the response time of the hardware through the single-chip technology, and further improve the user experience.
Alarm control
For some electronic devices, there will be automatic alarm settings. Alarm control is also an area often used by single-chip technology, which is mainly reflected in the following aspects: First For some automatic alarm devices, for example, the fire alarm that is often used at home is a device that turns on a smart alarm when the external environment reaches a certain condition. If the indoor smoke concentration reaches a certain level, or the collection of external data reaches In a certain state, the alarm setting is automatically triggered to realize the function of smart alarm; second, for some smart electronic devices, if the external environment exceeds the working environment of the device, or when the device has some abnormal conditions , It will trigger its own alarm mechanism, allowing users to understand the operation details of the equipment in time, and provide solutions based on the alarm information. For example: In some factories, some equipment is often installed to monitor the production environment of the factory. When some abnormal data occurs, an alarm will occur. To ensure the normal operation of the equipment, equipment maintenance personnel need to deal with it in time to avoid A major failure occurred.
Medical equipment
With the continuous improvement of medical equipment technology, single-chip microcomputers have begun to be widely used in medical equipment, which are mainly reflected in: First, perform data on the patient’s physical characteristics Intelligent monitoring can install some medical equipment on the patient and collect the body data, and then interact with the background control system. If the patient's physical characteristics are found to be abnormal, an alarm will be generated in time. For example: some medical equipment can monitor the patient’s heartbeat, pulse, blood pressure, etc., if abnormalities are found, they will promptly call the doctor for treatment; second, some smart electronic devices will also be used during the operation, for example: some operations require access In the case of avoiding surgery, the operation process can be completed by controlling the smart device to further reduce the patient’s pain and improve the speed of the patient’s body recovery; third, the smart physical examination data analysis device can integrate the user’s physical examination data After inputting it, and then inputting it to the analysis device, through comparison with normal data, the user’s physical illness can be predicted and diagnosed in time. With the continuous improvement of the level of medical technology in our country, the application of single-chip technology has become more and more extensive, improving the level of medical technology and better maintaining the health of patients.
Application features
Single-chip microcomputer has the following application characteristics: (1) It has good integration; (2) The single-chip microcomputer itself is small in size; (3) The single-chip microcomputer has powerful control Function, while the operating voltage is relatively low; (4) MCU has the advantages of easy portability and high cost performance. Single-chip microcomputers are mainly used in the following fields: automated office, mechatronics, cutting-edge weapons and military defense, aerospace, automotive electronics, medical equipment, commercial marketing equipment, computer communications, home appliances, daily Life and real-time control fields, etc.
Development of single-chip technology
The development of single-chip microcomputer in electronic technology mainly includes CPU development, program development, memory development, computer development and C language program development. At the same time, the development can guarantee The single-chip microcomputer can be carried out normally and orderly in a very complicated computer and control environment, which requires relevant personnel to take certain measures. The following is a brief introduction of the author: (1) CPU development. The development of the CPU bus width in the single-chip microcomputer can effectively improve the problem of the slow information processing function of the single-chip microcomputer, improve the efficiency and speed of information processing, develop and improve the actual structure of the central processing unit, and be able to run 2-3 CPUs at the same time, thereby greatly improving the single-chip microcomputer The overall performance.
(2) Program development. The reasonable application of embedded systems has been vigorously promoted. When developing programs, it is required to automatically execute various instructions, so that external data can be collected quickly and accurately, and the application efficiency of single-chip microcomputers can be improved.
(3) Memory development. The development of single-chip microcomputers should focus on memory, and strengthen the exploration of new memory based on traditional memory read and write functions, so that it can achieve both static read and write and dynamic read and write, thereby significantly improving storage performance.
(4) Computer development. Further optimize and develop the stand-alone chip stress analysis, and apply the computer system to realize data transmission by connecting the communication data.
(5) C language program development. The optimized development of C language can ensure that the single-chip microcomputer can be carried out normally and orderly in a very complex computer and control environment, and promote its realization of a wide range of comprehensive applications.
Effective application of single-chip microcomputer
(1) Service life. The life span mainly refers to the following two aspects: the products developed by the single-chip microcomputer have good stability and long service life, which can run stably for 10 years or more than 20 years; they have a longer service life compared with microprocessors. With the continuous improvement of semiconductor technology and the continuous improvement of MPU update speed, some of them have been successfully listed. At the same time, the younger CPU cores will also continue to be enriched with the development of I/O modules and have a longer life cycle. With the emergence of new CPU products, the field of single-chip microcomputers has continued to expand, and the options for users have also increased. The main development trend of single-chip microcomputers is the common progress of 32-bit, 16-bit and 8-bit single-chip microcomputers. Initially, the single-chip microcomputer mainly started with 8 bits. With the development of multimedia technology, Internet technology and mobile communication technology, 32-bit single-chip microcomputers have gradually developed. For example, the 32-bit CPU single-chip computer Mororola68k once achieved sales of 80 million pieces, while the development of 16-bit single-chip computers has made great progress in terms of output and variety, showing a growth trend.
(2) Running speed. The main point in the development of MUP is to continuously increase the speed, which is mainly marked by the clock frequency, which gradually increases. However, there is a certain difference between single-chip microcomputer and MUP. In order to further enhance the anti-interference ability of the single-chip microcomputer and reduce the influence of noise, the single-chip microcomputer gradually began to reduce the clock frequency during the development process, and for this reason, it would not hesitate to reduce the computing efficiency. Starting from the internal system of the single-chip microcomputer, the internal timing is changed, and the operation speed of the single-chip microcomputer is further improved without increasing the clock frequency.
(3) High reliability and low noise technology. The first is that EFT technology is an anti-interference technology. When the sinusoidal signal in the oscillation circuit is affected by the external environment, the waveform it emits is superimposed on various glitch signals, and people often use Schmitt circuits in the process of processing. After shaping, the circuit oscillation burr will then become a clock that triggers signal interference. Alternate use of the RC filter circuit and Schmitt circuit can effectively eliminate the burr effect, make the effect invalid, and promote the smooth transmission of the system clock signal. Further improve the stability of the microcontroller. The second is the drive technology and low-noise wiring technology. Traditional single-chip microcomputers usually set the ground wire and power supply in the symmetrical pin positions of the circuit shell, mostly in the symmetrical positions of the upper right and lower left, upper left and lower right parts, so that the power supply noise Pass through the whole chip smoothly and interfere with the internal circuit of the single chip microcomputer. Most single-chip microcomputers set the power supply pin and the ground wire in two adjacent pins, which can effectively reduce the current passing through the entire chip. At the same time, it can also set a decoupling capacitor in the printed circuit board to further reduce the effect of noise.
(4) Mask and OTP. OTP is a one-time input single chip. In the past, the masked MCU was used as a sign of the maturity of MCU products. Because the mask has a corresponding production cycle, and the price of OTP-type MCUs has been continuously reduced, product manufacturing through OTP is gradually Become a development trend in recent years. Compared with the mask method, it has advantages such as low risk and short production cycle. In the new era of social discovery, the demand for OTP-type single-chip microcomputers is also rising.
Troubleshooting
Troubleshooting of single-chip microcomputer
1. Three conditions for the normal working of single-chip microcomputer
The three conditions for the MCU to work are power, clock crystal, and reset. When the single-chip microcomputer cannot work normally, we must first check these three conditions, use a voltmeter or a multimeter to detect its power and ground pins, and check whether the voltage between the two pins is about 5V; for clock crystal oscillations For normal operation, we'd better use an oscilloscope to check to see if the sine wave pulse of the corresponding frequency can be detected; reset detection is relatively simple, the reset level of the microcontroller is generally high reset, and the microcontroller is generally reset when the power is turned on. A high level of about 5V will appear on the pin. In addition, when the reset button is pressed, a high level will appear on the reset pin, which can be detected with a general voltmeter or a multimeter.
2. Detection of whether the microcontroller is working normally
Whether the microcontroller is working normally, we mainly use the method of writing programs to detect and Troubleshoot. This detection requires hardware and software that "burn in" the code. The principle of detection is to "burn" a piece of normal code with the detection function into the single-chip microcomputer through the hardware and software of the "burn in" code. Check two aspects: the first is whether the target code can be normally written into the single-chip microcomputer. When the target code cannot be normally written into the single-chip microcomputer, it means that the single-chip microcomputer has been damaged and needs to be replaced with the same type of single-chip microcomputer; the second is that the target code can be normally written into the single-chip microcomputer. Is the latter effect a function set by the program? If it is, it means that the microcontroller is normal.
When replacing the single-chip microcomputer, it is best to use the same type of single-chip microcomputer, and then write the target code given by the company. The price of the single-chip microcomputer is generally relatively cheap at present, and the retail price is about 5 yuan.
The content of Baidu Baike is co-edited by netizens. If you find that the content of your entry is inaccurate or imperfect, welcome to use your entry editing service (free of charge) to participate in the correction. Go now>>
Latest: U.S. Republican Party
Next: Transmission efficiency