The thought section introduces the overall framework of the specific knowledge to be learned later, explains some basic terms, and summarizes the learning ideas and methods. The content of the thought section has a great guiding role in the subsequent learning, especially the modularization idea will run through the entire knowledge system of the learning section. The thought section is not limited to the next few articles, but will also be explained in the form of topics in the learning section.
Reading suggestions: If you have not yet started to practice, you may not be able to have a deep understanding of the thinking method when reading. Just have a general understanding when reading. When you are in specific practice, you can come back and read it as needed.
==================================
In order to help you better understand MCU, this article will first introduce the MCU/computer system as a whole, so that you can have a more accurate grasp of the study of MCU and the design of MCU system, and better distinguish the connection between various knowledge points, as well as their importance and priority, so that you can learn more easily.
In these articles, a lot of new terms and concepts will be involved, which are also the huge difficulties encountered by many beginners. I will introduce them in popular language, so you don’t need to understand them thoroughly, as long as you have a general understanding. At the same time, I will also cover various design ideas of microcontrollers and computer systems, as well as thinking skills when learning.
Because there is not much difference between single-chip microcomputer and computer in essence, the content introduced here is by no means limited to 51 single-chip microcomputer, nor is it just single-chip microcomputer, but various microcomputer systems including computers. Without further ado, let's get to the point.
Modular thinking
Modularity is a very important idea. Its application is not limited to technologies such as single chip microcomputers, but also reflected in our body structure and all aspects of human production and life. What is modularity? According to my understanding, modularity has several characteristics, which are described below.
1. Division of labor, cooperation and specialization
Anyone who has a basic understanding of biology knows that many animals, including humans, are made up of multiple organs. For example, the brain is responsible for thinking, and the heart is responsible for pumping blood. Each organ or tissue is responsible for several functions, and the various organs work in coordination to form a complex whole.
In human society, the phenomenon of division of labor and cooperation is also very common. In life, we need to eat and wear clothes. In relatively backward times, there may be some self-sufficient economic forms, and our own labor meets the most basic needs of life. In modern society, people have more and more needs, and it is impossible to produce them all by ourselves. Everyone focuses on his or her own expertise, such as farmers are responsible for growing food, garment workers are responsible for making clothes, breeders are responsible for breeding, programmers are responsible for writing programs, etc. Various people divide the work and cooperate, and finally exchange the fruits of their labor. When a person focuses on one thing for a long time without worrying about his or her other needs, this person can do it better, and overall, the productivity of society is greatly improved.
2. Module abstraction
If you have some understanding of the basic components of a computer, you will know that a computer consists of several parts, such as the CPU, memory, hard disk, motherboard, and display. If you want to store more movies in your computer, you can consider replacing it with a larger hard disk. We only need to know that the hard disk is the component responsible for storage in the computer, and we don’t need to pay attention to the internal structure of the hard disk. Because each module is highly abstract, the internal principle may be complicated, but to the outside, it is just a black box that can perform specific functions. The advantage of such abstraction is that when replacing the hard disk, you only need to have an abstract understanding of the hard disk from the outside to easily solve the problem, and the rest is just spending money to buy the hard disk.
3. Layering
If you were asked to manage a large company, how would you manage it? Hierarchical management would be a good choice.
You can divide the company into several departments according to the actual situation, such as R&D department, marketing department, finance department, HR and logistics department, etc. Each department is assigned several persons in charge to manage it, and each department is responsible for the designated work. Specifically, in the R&D department, managers may divide it into software department, hardware department, etc. for the convenience of management; and in the software department, there will be different teams, such as mobile client development, server-side development, etc. This layer-by-layer division, where everyone performs their duties, also reflects the characteristics of division of labor and cooperation.
If you are the CEO of a company, when you find that the company's software product development progress is very slow this month, you may directly call the head of the R&D department and get angry: "The company's XX software development is too slow. Look, other companies have released similar products a long time ago. You have to get this done as soon as possible, or you'll be fired!" Then the instructions are passed down layer by layer to the lowest-level employees, and the programmers at the lowest level have to work overtime and work hard again. The slow progress of R&D may be just because a few programmers have recently taken leave for something, but in this process, you don't need to pay too much attention to the details of the bottom layer, and you don't have too much energy to pay attention to it. Just treat the entire R&D department as an abstract whole, which also reflects the characteristics of module abstraction.
Modular design principles
As mentioned above, the characteristics of modularization are widely used. Designing a system based on this idea is modularization. Not only single-chip microcomputer systems, but also computer hardware and software systems can make full use of modularization. Here, let's talk about the methods and ideas of modularization.
For beginners, you only need to have a general understanding of this first. Without actual design, it is not easy to feel these ideas. When you need to design an actual system later, you can come back and read this article if necessary.
1. Top-down, step-by-step refinement; separation of logical design and physical implementation; bottom-up
When designing a relatively complex system, we often draw a block diagram first, where each box represents an abstract functional module. Through the block diagram, we can design the logical relationship between these modules, and then refine the design of each module. Such a module may also be relatively complex, so it will be divided into smaller modules. In this way, the modules are divided step by step until the final technical details are realized. This is the top-down design method, which decomposes a complex problem and gradually refines it. The design of the block diagram is the logical design between modules, and the logical design can be completely separated from the specific physical implementation of each module.
Compared with the top-down design method, there is another approach that is exactly the opposite: bottom-up. First design some core modules, and then gradually expand and improve them. The complete bottom-up approach is only suitable for designing small systems. In practical applications, these two approaches are often combined for design.
2. Module independence reduces coupling
An important idea in modular design is to make modules independent and reduce the coupling between modules. In other words, each module is responsible for completing its own function, and the connection between different modules should be as small as possible to avoid mutual influence.
When you want to replace a larger hard drive for your computer, you generally don't need to consider whether other modules such as memory will be affected, otherwise it will be too troublesome. Because the modular design of the computer is very standardized, the connection between modules is very small.
Reducing coupling is a seemingly simple problem, but it is actually quite troublesome during design. In order to reduce coupling, many technologies need to be used, which will be introduced in actual operation later.
3. Modules are standardized and replaceable
Some students feel that their computers are too slow to respond. After checking online, they found that the computer is probably slow because the mechanical hard disk is too slow. Compared with the hard disk, the CPU and memory are much faster, so it is like the barrel effect, and the computer is slowed down by the slowest hard disk. So they replaced the computer with a solid-state hard disk, and it became much faster.
The internal structures of solid-state drives and mechanical hard drives are completely different. Mechanical hard drives rely on magnetic platters to store data, and a mechanical structure is required to drive the platters to rotate when reading and writing. The mechanical rotation speed cannot be too fast (a 2.5-inch mechanical hard drive rotates at a speed of 7200 revolutions per minute, and the speed of the disk edge can reach 86km/h). If it is too fast, the disk may break directly, or generate huge heat, so the reading and writing speed is far slower than that of electronic devices. Solid-state drives use electronic chips to realize data storage, so the speed is very fast.
Although the two hard disks have very different principles and performance, they can be easily installed on the same computer as long as some parameters are matched, such as both are 2.5 inches. This is because the existing different hard disk designs are standardized, and the hard disk size, interface, etc. have standard specifications, so they can be easily replaced.
4. Module versatility, applicable to a variety of products
A few years ago, mobile phones and other digital products were designed by different people and companies for different brands and devices. The charging interfaces were different, and each digital product was equipped with a set of chargers. When you travel with a lot of digital products, it is annoying to have all kinds of chargers, big and small. And if the charger is broken, you can only buy a new one. This design wastes a lot of resources and brings great inconvenience to people's lives.
In recent years, the charger interfaces of digital products such as MP3, MP4, and mobile phones have been gradually unified, and many devices can be charged using universal USB chargers and data cables. This is much more convenient for users; for device manufacturers, it is not necessary to design a separate charger, and a standard charger can be used directly; it also saves resources. For example, some digital device chargers are optional, so there is no need to buy a charger. The universal charger and mobile phone charging interface design allows one charger to be used for multiple products.
Universality and standardization can both be understood as following certain standardized specifications when designing a module or system. A standardized module can be applied to different systems (a universal charger can charge multiple devices); and multiple similar modules that meet the unified standard can be used in the same system (both mechanical hard drives and solid-state drives can be installed in a computer).
Advantages and disadvantages of modular design
The examples given above have clearly demonstrated many advantages of modular design. Here we summarize its characteristics.
1. Facilitate division of labor and cooperation
For an actual product, it is often not developed by one person, but by many people working together. There are many reasons for this, which may be due to time constraints, such as competition between companies, whoever develops and releases a new product first is most likely to seize the market; it may be because the system is too large and one person cannot complete it in a lifetime, such as the amount of code in an operating system can often reach millions of lines; division of labor and cooperation will also improve overall efficiency, as mentioned earlier.
When multiple people develop the same system, modular development is the best choice. Some people focus on one area, such as Android programs, graphic design, servers, etc. Each person is responsible for developing small modules that match his or her area of focus, while others with broader knowledge and more experience are responsible for the logical combination of modules and finally integrate the entire system together. This process may also be layered, with the system divided into large modules, then split into small modules, and then decomposed and implemented layer by layer.
2. Improve development efficiency
On the one hand, division of labor and cooperation can improve efficiency; on the other hand, using already implemented modules to build new systems like building blocks can greatly improve efficiency.
The development of a module may be completed by many people separately, or by the same person at different times, or it may be obtained for free or purchased from others.
When it comes to learning about single-chip microcomputers, we actually used other people's modules from the beginning. The single-chip microcomputers and various components were all produced by others. Using these modules, we quickly built our own development board.
In the same way, in the detailed learning process later, I hope that every time you finish learning a technical knowledge, you can implement a program module by yourself, such as the driver of the digital tube (although you may not understand what this is now). When the whole knowledge is almost learned, you will have your own program library, that is, a complete set of module programs.
After a long time, you may not remember how to write the digital tube driver. But it doesn't matter, as long as you have written your own program module and provided standard instructions, you can use it directly according to the instructions when needed, without reviewing the previous knowledge again. So when you develop your own single-chip microcomputer system later, you can greatly improve the development efficiency by directly using the module you have developed.
In the later study of specific technologies, I will also analyze in detail how to implement each module as best as possible, what technical knowledge is used, and help everyone build their own program library.
3. Ability to develop complex systems
Division of labor and cooperation enable people to develop huge systems that cannot be completed in one person’s lifetime.
For personal development systems, if you spend several months writing a large program, you may forget how the previous program was written later, which may affect the continued writing of the program. At this time, you may need to look back at the previous program, but the program is not a natural language after all, so it is still quite difficult to read. It is likely that you will find it difficult to understand it later, or at least it will take a lot of time to understand it. When you finally understand the previous things, you find that you have forgotten the following code.
With the modular design method, you can design a small module in a short period of time, make it good enough, and then write a user manual for the entire module that you can understand. When you want to use this module in the future, just treat it as an abstract whole. You don't need to pay attention to the internal details of the module, just read the user manual directly. In this way, you are more likely to develop a relatively large program independently.
4. Easy to maintain and troubleshoot
Ease of maintenance is also an important feature of modularization. Modularization emphasizes reducing the coupling between modules. If a module that is not very core has a problem, it will not have a big impact on other modules. It will only show that some functions in the system cannot be used (of course, if a core module such as a computer CPU has a problem, it may cause the entire system to crash). At this time, you can directly determine which module has a problem and then repair that module, greatly reducing the scope of error inspection.
I don't know if you still remember the article "Summary of Failed Single-Chip Microcomputer Program Download". In the article, it is mentioned that when the download fails, if you have a computer, download cable, and single-chip microcomputer system board that can download the program normally, you can quickly determine whether the problem is with your computer by replacing it. From this, we can see the great significance of modularization in troubleshooting.
5. Disadvantages
Everything has two sides, and modular thinking is no exception. Let me briefly explain it here.
I don't know if you have heard of this saying, that in many Internet companies, "three people get four people's money to do five people's work". Why is it that in many Internet companies, the work is very tiring and the salary is very high, but the bosses are unwilling to reduce the salary and hire more people, and at the same time make the employees more relaxed?
There is a book called "The Mythical Man-Month" which explains the reason for this problem. Man-month is a unit that represents the amount of work that one person can complete in one month. According to the man-month theory, two people need three months to complete the work of six man-months, while three people only need two months. But the fact is that in Internet companies, three people often need much more than two months, and even three months cannot complete the task. The man-month theory is just an impossible myth.
Why is this so? The reason is that when multiple people design the same system, they need to communicate with each other. The more people there are, the greater the cost of communication. So hiring more people means wasting more communication costs.
If we regard each person as a module, the Mythical Man-Month shows that too many modules will increase the communication cost between modules, thereby reducing system efficiency. When there are many modules and the relationships between them are very close, maintaining the independence of modules and the matching between modules becomes a big problem in itself.
But in general, the advantages of modularization far outweigh its disadvantages. Sometimes modularization is a last resort, while some disadvantages often only exist in specific circumstances.
================================================== =====
Previous article:Microcontroller beginner's guide (15) Summary of microcontroller program download failure
Next article:Microcontroller for Beginners (17) Microcontroller/Computer System Overview: Core Modules
Recommended ReadingLatest update time:2024-11-17 06:42
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- After CC2500 continues to send and receive data for a period of time, it can no longer receive data. CC2500 needs to be reset before it can continue to send and receive data.
- Download and answer questions to win prizes: Efficient PCB design with Mentor's Xpedition Layout
- The role of GEL files in TMS320C6000 applications
- National College Student Electronic Design Competition Protues Series
- Can you understand these basic module circuits?
- Oscilloscope Differential Probe Delay Measurement
- [SAMR21 New Gameplay] 24. Usage of I2C
- AD17 There is a problem with copper laying on a four-layer board
- Static Timing Analysis Basics and Applications
- Cost-effective 0-10V analog signal isolation technology: based on Y capacitor isolation