51 Is it easy to find a job with self-study on single-chip microcomputer? How to learn to find a suitable job

Self-study does not mean that it is impossible. If it is quick, it is better to find one-on-one. It is recommended to finish 51 and learn STM32. It is not difficult for 51 single-chip microcomputer. It is enough to use spare time. Then I will do a few projects, so I can find a job. If I don’t understand, I can provide some help. I still have a set of my own opinions on the research of single-chip microcomputer. I will share some basic knowledge of single-chip microcomputer. I hope it can help self-study. you.

The SCON of the single-chip microcomputer is a serial port. It has two bits. These two bits are used as interrupt flag bits. There are other bits. , the interrupt control of 80C51 is an interrupt control achieved by the control of the special function register, that is to say, the interrupt has an interrupt application, and the interrupt flag bit becomes 1. The CPU also queried, whether the CPU should allow the current interrupt It is necessary to achieve specific control through the control of the special function register IE. Each bit in IE is understood as an electronic switch. If the switch gives it 1 or 0, it will hit the switch to the corresponding position. , if you want the terminal to allow it, turn this switch to 1, so each bit here has a specific meaning, corresponding to the sub-switch and the main valve, that is, the interrupted sub-switch and the interrupted total valve. Switch, which can be assigned a value to control whether the interrupt is allowed to IP or the control register of the interrupt priority.

The 51 microcontroller has two levels of interrupt priority, either high priority or low priority. When the IP default microcontroller is powered on reset, every bit in it is 0. If you want to set the current interrupt to high Priority, set this bit to 1, if you want to set it to low priority, set it to 0, because it is zero when power-on reset, unless you want to set it to high priority, that is, set it to 0 It is set to 1. If you don’t set it, it will all belong to low priority by default. Although it is said to belong to low priority, there are 5 interrupts. These 5 interrupts still need to be arranged in an interrupt order. This order There is a default, they belong to the first link, but if these 5 interrupts are applied at the same time, there must be a plan, which one is executed first and which one is executed later, this is the default natural priority of the interrupt to decide.

The order of priority is from high to low, external interrupt 0 counter 0, external interrupt 1 timer counter 1, each interrupt of the serial port gives it the service entry address of the interrupt, and how many are loaded? The entry address of the terminal service of each unit, that is, the corresponding from 0003H to 0023H, each interrupt is given an interrupt vector entry address, in fact, it is to find the entry address of the interrupt service routine, and a jump is generally made in the entry address. instruction, jump it to the interrupt service function to execute, that is to say, when the default microcontroller is powered on, the initial value of IP is 0, that is, all terminals are low priority by default, if there are multiple interrupts applied at the same time At this time, it should be in this order. For example, if three interrupts apply for an interrupt at the same time, so that its flag bits are all changed to 1, the CPU will process the external interrupt 0 first, and the external interrupt will be processed in the order of the default natural priority. After the processing of 0 is completed, the timer counter 0 is processed. After the timer counter 0 is processed, the external interrupt 1 is processed. It is executed in this order. There is such a running mechanism by default.

If you want to interrupt this mechanism, for example, you want to make the priority of timer counter 0 higher than external interrupt 0. If you don't set the priority, you must go in this order by default. When three interrupts come at the same time, you want to Make the interrupt of timer counter 0 be executed first, then execute external interrupt 0, and then execute external interrupt 1. At this time, you can set the IP, make it 1, and clear the other two bits to 0. , in this case it belongs to the high priority, the two of them are in low priority, it must be served first when it is in high priority, so when the three of them interrupt the application at the same time, they must execute 0 first, and after the execution is completed, the two of them are in Interrupt at the same level, if you currently want to interrupt the order of this priority.

There are three basic principles for the processing of interrupt priority. The first is that when the CPU touches several interrupts at the same time, it needs to respond to the highest interrupt request first. The priority level is the highest, and it will get a response first and is executing the interrupt process. Among them, an external interrupt is being executed, and another interrupt request occurs during the execution of the interrupt service function. For example, an interrupt request for timer counter 0 occurs. At this time, it cannot be interrupted because your priority is relatively low. If you have to follow the default natural priority, your priority is lower than mine and you can't interrupt me, unless the priority is set to external interrupt 0. At this time, an interrupt application is in the process of executing external interrupt 0. , because the priority of setting it is higher than me, so it can interrupt me, if its priority is not set, the default natural priority is lower than me, it is impossible to interrupt the external interrupt 0, that is to say In the process of an interrupt service, it cannot be interrupted by a new peer or low-level interrupt, but it can be interrupted by a high-priority interrupt. Basic principles of interrupt handling.

If you need it, you can read the relevant articles repeatedly , and master the relevant knowledge to achieve arbitrary settings, so as to deal with different priority sorting, including terminal control, so that it is easier to get started when writing program examples. .

If you are interested in single-chip microcomputer, you can check the content shared in previous issues . I hope it can help you to take some detours on the road of learning single-chip microcomputer . If you want to get started with single-chip microcomputer, you can continue to pay attention to Chuangwei single-chip microcomputer programming . share .

Guess you like

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