Microcontroller for Beginners (16) Microcontroller/Computer System Overview: Modular Concept

Publisher:JikaiLatest update time:2016-05-23 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
So far, the introduction to the microcontroller has come to an end. From this article, we will start to study the idea section.

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.

================================================== =====

Keywords:MCU Reference address:Microcontroller for Beginners (16) Microcontroller/Computer System Overview: Modular Concept

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

Design of infrared wireless PPM transmitter based on AT89S52 single chip microcomputer
1 Introduction In industrial and living environments, the emergence of portable information terminal devices has accelerated the introduction of wireless digital communication lines and local area networks. However, due to the limitations of radio, it has been hindered in the application of wireless hig
[Microcontroller]
Design of infrared wireless PPM transmitter based on AT89S52 single chip microcomputer
【51 MCU】I/O port
Summarize P0: Open-drain bidirectional I/O port without built-in pull-up resistor, can be used as a high-impedance input terminal. When P0 port is used as a normal I/O, an external 10KΩ pull-up resistor is required. When used as a low 8-bit address/data bus, no external pull-up resistor is required.
[Microcontroller]
【51 MCU】I/O port
Internal A/D conversion of PIC microcontroller
//Requirement, connect the potentiometer on the board to RA0, set the AD related registers of PIC, and display the voltage #include pic.h __CONFIG(0x3831); //Configuration bit 18323831 #define uint unsigned int #define uchar unsigned char //Common cathode digital tube (the board uses Darlington tube ULN2003, invert
[Microcontroller]
How to break through the growth pole of the automotive MCU market? Xihua Technology's TMCU breaks through the barriers
The huge opportunities and changes brought by the "New Four Modernizations" to the automotive industry have also impacted the existing supply chain system. Domestic chip companies that were once blocked by high technical barriers have gradually broken through. Among them, the key components of auto
[Automotive Electronics]
What are the differences between microcontrollers, ARM, and FPGA embedded systems, and what are their respective characteristics?
Features of MCU: (1) Limited by the integration level, the on-chip memory capacity is small, generally ROM: less than 8KB; (2) RAM: less than 256KB. (3) High reliability (4) Easy to expand (5) Strong control function (6) Easy to develop Features of ARM: (1) Built-in cheap program memory (FLASH) and non-volatile data m
[Microcontroller]
MCU timer register
The standard 51 MCU has two timers, T0 and T1. T is the abbreviation of Timer. Now many 51 series MCUs will add additional timers. Here we will talk about timers 0 and 1. As mentioned earlier, each functional module of the MCU is controlled by its SFR, that is, special function register. There are several special func
[Microcontroller]
MCU timer register
AT89C51 single chip microcomputer --2. Introduction to single chip microcomputer and C language
1. Microcontroller Overview 1.1 Computer components The computer host basically relies on the CPU, memory stick, and your bus controller (motherboard). The motherboard connects to these external hardware devices through its own hardware interface, such as the mouse and keyboard. The modem is the network MCU is com
[Microcontroller]
AT89C51 single chip microcomputer --2. Introduction to single chip microcomputer and C language
Explanation of the architecture of the external circuits and ports of the ht46f49e microcontroller
Through the study of the brief description of the functions of the single-chip microcomputer in the introduction to the single-chip microcomputer , we know that the core function of the single-chip microcomputer can be described as: being able to perform certain operations in sequence according to the pre-set function
[Power Management]
Explanation of the architecture of the external circuits and ports of the ht46f49e microcontroller
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号