I have studied MCU for such a long time (about two years), but I didn’t know what MCU is. Today I finally understood the basic principles of MCU and learned a lot! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! Single-chip microcomputer: A semiconductor microcomputer that integrates a central processing unit (CPU), memory (ROM, RAM), input and output ports (parallel I/O, serial I/O), counter/timer, interrupt system, system clock circuit and system bus on a silicon chip. This is the concept of single-chip microcomputer. I used to think that single-chip microcomputer was a microcomputer. It seems that I only had a rough understanding of single-chip microcomputers. Today I know single-chip microcomputers in detail. Central Processing Unit (CPU): It is equivalent to the human brain and is an extremely important processing unit. When we usually say that a computer has so many bits, we are referring to the number of bits that the CPU processes each time. Currently, the computers we commonly use are 64 bits. The data inside the computer is in the form of binary numbers. Memory (ROM, RAM): ROM: Only Read Memory Read-only memory. RAM: Random Access Memory. RAM is also known as “Random Access Memory”, which directly exchanges data with the CPU. Internal memory, also called main memory (internal memory) (baike.baidu.com/item/%E5%86%85%E9%83%A8%E5%AD%98%E5%82%A8%E5%99%A8). It can be read and written at any time, and the speed is very fast. It is usually used as a temporary data storage medium for the operating system or other running programs.com/item/%E5%AD%98%E5%82%A8%E5%8D%95%E5%85%83/8727749]The contents of the storage unit can be taken out or stored at will as needed, and the access speed is independent of the location of the storage unit. This kind of memory will lose its storage content when the power is off, so it is mainly used to store programs that are used for a short time. ROM can only be read, not written, and the data will not be lost when the power is off. Serial and parallelI/O port: I/O port is equivalent to a person's hand, which can grab things from the outside and pass things to the outside. Parallel I/O is parallel port, serial I/O is one by one. There are several working modes of MCU I/O port, which will be introduced in detail later. Counter, timer: Timer and counter play an important role in computer system, especially in industrial control system. The difference between timer and counter is only in different uses. A timer is essentially a counter. Every time a pulse is received, the counter will add/subtract 1. If the pulse period is fixed, the number of pulses is proportional to the time. In this way, the counter can be used as a counter according to the fixed period of the pulse. For example, the pulse generated by the crystal oscillator in the microcontroller system is a pulse with a fixed pulse period. The time can be calculated according to the number of pulses. If the pulse signal is irregular, then this pulse signal can be used as a counter under ideal conditions. Interrupt system: Some people say that if there is no interruption, our life will become very slow. We are interrupted all the time in our daily life. For example, you are washing clothes at home, and the doorbell rings. You quickly go to open the door. After you check the door, the kettle is turned on and the mobile phone rings. At this time, you have to solve a problem according to the change of seasons. This is the priority. After solving these problems, you go back to wash clothes. For a single-chip microcomputer, an interrupt means that when the CPU is processing A at a certain time, another event B occurs, requesting the CPU to process it immediately (interrupt occurs); the CPU temporarily stops the current work (interrupt response) and turns to Go to process event B (interrupt service), after CPU completes processing event B, return to the place where the original event A was interrupted and continue processing event A (interrupt return). System clock circuit: In China, a person is judged dead when his heart stops beating. Some people may say that he is brain dead, but he is not necessarily dead. For example, some vegetative people are brain dead but their hearts are still beating. For our single-chip microcomputer, the crystal oscillator is the heart of the single-chip microcomputer. The crystal oscillator of our 51 single-chip microcomputer is generally 12M or 11.0592M. The design of the crystal oscillator circuit is very It is very important, and the selection of capacitors next to the crystal oscillator is also very important. Before, a classmate soldered the capacitor of the crystal oscillator circuit to 22pF, and the minimum system board of 51 could not work at all. This problem stuck him for a whole month. Finally, the crystal oscillator was replaced with 33pF, and the minimum system board of 512 could work normally. So the crystal oscillator circuit is very important.
(Crystal Oscillator Circuit) System Bus: Bus? What is a bus? The system bus is also called the internal bus (Internal Bus) or board-level bus (Board-Level) or computer bus (Microcomputer Bus). Because the bus is used to connect the functional components of the microcomputer to form a complete microcomputer system, it is called the system bus. The system bus is the most important bus in the microcomputer system. What people usually call the microcomputer bus refers to the system bus, such as PC bus, AT bus (ISA bus), PCI bus, etc. I don't quite understand it either. I only know the classification of buses: the information transmitted on the system bus includes data information, address information, and control information. Therefore, the system bus contains three buses with different functions, namely, data bus DB (Data Bus),com/item/%E5%9C%B0%E5%9D%80%E6%80%BB%E7%BA%BF] Address bus[/url]AB (Address Bus) andControl busCB (Control Bus). The microcontrollers that people usually use are STC89C52, so do you know the meanings of the letters and numbers? Let me popularize it for you: AT89C52 Meaning: AT Atmel Company (MCU manufacturer) 89 Represents the serial number of the MCU C Represents Calibri CMOS product 52 AT89S52 stands for 8k ROM (if it is 51, it is 4K ROM) Stands for Atmel Company (MCU manufacturer) 89 Stands for the serial number of the MCU S Stands for Calibri ISP Programmable (meaning that the MCU can be written directly into the code without removing it from the circuit board) 52 represents8kROM(if it is51, it is4KROM) com/s?wd=Atmel%E5%85%AC%E5%8F%B8&tn=SE_PcZhidaonwhc_ngpagmjz&rsv_dl=gh_pc_zhidao]Atmel Corporation (MCU manufacturer) 89 Represents the serial number of the MCU S Represents ISPprogrammable (meaning that the MCU can be directly written into the code without removing it from the circuit board) 52 represents8kROM(if it is51, it is4KROM) com/s?wd=Atmel%E5%85%AC%E5%8F%B8&tn=SE_PcZhidaonwhc_ngpagmjz&rsv_dl=gh_pc_zhidao]Atmel Corporation (MCU manufacturer) 89 Represents the serial number of the MCU S Represents ISPprogrammable (meaning that the MCU can be directly written into the code without removing it from the circuit board) 52 represents8kROM(if it is51, it is4KROM)
|