Is it necessary to learn every single type of microcontroller?

Is this even a question? The answer is definitely not. The advantage of learning 51 single-chip microcomputer is that after learning 51, you will naturally draw inferences from one case and the other. There are so many types of single-chip microcomputers on the market. After learning all of them, it is estimated that you will not be able to learn all of them until you buy specialty products in Liuzhou. If you want to learn single-chip microcomputer, it is recommended to start from 51. Through 51, you should find out the internal resources of all single-chip microcomputers. If you understand, the usage of each internal module is thoroughly understood. I know how to start using it for development. Let’s continue to share some basic knowledge related to single-chip microcomputers. The following articles only represent personal opinions. I don’t like to spray lightly. Encourage!

How to understand the concept of interrupt, this needs to be deeply understood. In fact, interrupt is a kind of operation mechanism, a mechanism for single chip microcomputer to handle things, or a way for CPU to handle events. Once you understand interrupt, for It is very helpful to write programs. Using interrupts to solve foreground and background programs is a programming idea or a programming method that is often used.

How many interrupts does the 51 single-chip microcomputer have, or what kinds of interrupt sources can the ordinary 51 single-chip microcomputer support, which interrupts can cause the interrupt of the 51 single-chip microcomputer, which kinds of interrupts the 51 single-chip microcomputer can handle, and what can the middle segment do? solve what problem.

The interrupt system of the single-chip microcomputer is actually a processing mechanism set up to enable the CPU to have the ability to handle external emergency events. If there is no interrupt system, in fact, it must rely on the method of software program query to process some events, or some things. , if there are many things that need to be processed, or the number of tasks that need to be processed by the CPU is relatively large, some urgent events that need to be processed will not get real-time response or real-time processing, the interrupt system is to To solve these problems, in fact, the terminal system uses some hardware operations to liberate the CPU, so that the CPU can deal with some emergency events in real time. When there are no real-time events, the CPU can do some other things. Some events that do not need to be handled urgently, in this case, it is easy to build foreground and background application programs, and the interrupt system of the single-chip microcomputer supports external interrupts and internal interrupts.

Now many high-performance MCU interrupt systems support more interrupts. For example, the MCU has added ADC, added PSW8, some bus interfaces, and SPR interfaces, all of which support interrupts. The structure of the interrupt system of ordinary 51 MCUs is relatively speaking. Relatively simple, first understand a basic concept of interrupt, interrupt is set for real-time processing.

For example, someone is reading a book in daily life. At this time, the mobile phone rings and needs to answer the phone. This time is in the process of reading a book. This is one thing that the main program of your CPU is doing. During the process of reading a book The phone rings, that is, an interrupt event occurs. At this time, the CPU, that is, the human brain, actually needs to handle the call. This is called an interrupt request. An external interrupt request comes. As for whether the brain should Handling this event, including whether the CPU should handle this event or not, is determined by the CPU. When there is an external interrupt signal or an internal interrupt signal, whether the CPU should allow this interrupt, or whether to respond to this interrupt, we need to To control, the special function register allows the control register to control this signal, whether to perform interrupt service or not.

Interrupt does not just refer to interrupt application. The concept of interrupt should refer to the application from the middle section to the permission of the interrupt, to the interrupt service, and the whole process of the return of the interrupt after the interrupt service is completed can be understood as an interrupt. When it is necessary to properly combine some phenomena in daily life, it will be easier to understand. After all, some operating mechanisms of the single-chip microcomputer are invented by people. In this way, it is easier to understand the concept of some single-chip microcomputers. Interruption actually refers to the sudden When the event arrives, first terminate the current work in progress, turn to handle the emergency, and after the processing is completed, return to the place where it was originally terminated to continue the work. The whole process is called the middle section.

If you are interested in single-chip microcomputer, you can pay attention to the content shared in previous issues. I hope that everyone will take less thunder on the road of learning single-chip microcomputer. Huawei single-chip microcomputer programming.

Guess you like

Origin blog.csdn.net/m0_66707146/article/details/123483540