There are 6 requirements for learning MCU quickly:
1. Familiar with the principle and structure of single chip microcomputer;
2. Learn digital electronics and analog electronics to lay a solid foundation for circuit design;
3. Be proficient in using C language and learn other people's programs;
4. Have a certain understanding of the operating system principles;
5. You need to have at least some basic knowledge of Protel;
6. The ability to actually debug circuits.
Steps to learn microcontrollers
There are many types of single-chip microcomputers, but 51 is the most basic, so it is best to start learning single-chip microcomputers from 51, which is not only easy to use, but also very practical. However, 51 single-chip microcomputers are too basic after all, and many subsequent single-chip microcomputers have greatly expanded their functions. Therefore, according to the route of most people in our laboratory, most people will learn AVR single-chip microcomputers next. AVR single-chip microcomputers have greatly improved functions compared to 51, integrating many practical functions such as A/D and fast PWM, and have many similarities in functions with many large single-chip microcomputers. Therefore, if you want to master other single-chip microcomputers in the future, AVR is undoubtedly a good springboard.
The learning process
The ultimate goal of learning MCU is, of course, practice. The learning I am talking about is different from the MCU learning in class. I have read some MCU textbooks before. Some of them talk about the working principle and internal structure of MCU. These things are not needed for us for the time being. We can learn them when the class starts in the future. What we need to learn now is how to write some simple small programs with MCU, putting aside the internal structure principle for the time being. It is from the perspective of practicality. There is a saying on the Internet that it is a learning method called practice first and then theory.
Therefore, my point of view is as follows: first of all, you need to have a basic understanding of the hardware structure of the microcontroller. At least you need to know the functions and differences of each pin, and be able to build a minimum system of a microcontroller by yourself. Then you can start directly with the program. It is best to program in C language, starting with a simple marquee, and gradually deepening. You can gradually make some digital tubes, LCDs, DS1302, DS18B20 and other electronic components. In-depth, you can combine some specific examples to expand some interrupts, serial communication and other functions. Another point to be stated is that the C language used in the microcontroller is actually very limited. A large part of the content learned in C++ in class is not used in the initial microcontroller programming. Therefore, there is no need to stop at the microcontroller because you feel that your C language foundation is not very good!
Tools for learning
In terms of software, the 51 microcontroller uses KEIL software, which is available in the school library software download and other websites. You can find relevant information on the specific usage. There are more software for AVR. I use CVAVR. There are also ICCAVR and other compiler software. It depends on personal preference. It is recommended to learn after you have a certain 51 foundation. Another is the burning software. The function of the burning software is to burn the HEX file generated by the compiler into the microcontroller. This is practical with the download line. If there is a parallel port, it is best to use a parallel port download line. The software is best to use Guangzhou Shuanglong's SLISP software. If the laptop does not have a parallel port, you have to buy a downloader yourself, called USBASP, which is sold in the online electronic market for about 20 yuan. The software will come with the CD.
In terms of hardware, first of all, you need a single-chip microcomputer. There is one thing to note about single-chip microcomputers. It is best to buy 89S51 and 89S52 models of 51 single-chip microcomputers. The burning program I mentioned above is the ISP method. These two single-chip microcomputers support ISP download, so if you buy other models of burning programs, it may not be convenient. The AVR single-chip microcomputer commonly uses ATmega16L. The difference between other models is not very big, and some are even compatible. As for the single-chip microcomputer development board, the current price is very expensive, ranging from one hundred to several hundred. However, it is better to avoid the one that costs more than 60 yuan advertised in the school last time, which is of little use. It is of course good to buy one, but it doesn’t matter if you don’t have it. It is also very convenient to buy a circuit board and build it yourself. It is very easy to lead out the ISP interface and burn the program, and then it is also very convenient to lead out the I/O port for expansion.
Several other points to note when learning microcontrollers:
1. Give equal weight to theory and practice
For a beginner of single-chip microcomputer, if you learn in a textbook way, you will be faced with a lot of instructions and nouns. After learning for a long time, you still can't figure out what these instructions do. Maybe you will feel boring and give up halfway in a few days. Therefore, it is a good method to combine learning with practice. You can learn and practice at the same time, step by step. In this way, you can understand, grasp and root the instructions used in your mind in a few times, and even "deeply rooted". In other words, after you have learned a few instructions (not a large number at a time, but understanding), you should do experiments next. Through experiments, you can feel the control effect of the instructions just now, see the eyes (light) and hear the ears (sound), and you can deeply understand how the instructions are converted into signals to achieve control. Seeing the results of your learning through experiments not only gives you a sense of accomplishment, but also enhances your interest in single-chip microcomputers. To be honest, single-chip microcomputers are not so much learned as practiced through experiments. Moreover, doing experiments themselves is also a learning process. Therefore, the learning method of learning while practicing is particularly effective.
2. Arrange your time reasonably and persevere
Learning single-chip microcomputers cannot be done in a half-hearted way. You need to have perseverance and determination. After learning a few instructions, you should do experiments in time to integrate them. Don't wait for a few days or weeks to do experiments. This will not be effective and you may even forget what you learned. In addition, you must be mentally prepared to fight a "protracted war". Don't study for a few days when you are interested and give up for a few weeks when you are not interested. Perseverance is a very important point in learning single-chip microcomputers. [page]
3. Check patiently when encountering problems
MCU has both hardware and software. Sometimes a program does not work no matter how you adjust it, but it is correct from a theoretical analysis. In this case, you need to carefully find the reason. When learning MCU, you often encounter many problems, and sometimes you can't solve them in a day or two. In this case, you need to be patient and start from the bottom. I believe that every time you find an error, you will gain something new. Don't give up easily!!!
4. Knowledge that has only been learned briefly is only slightly better than a superficial understanding at best. Therefore, the better method is to relearn it after a period of time (1-2 months), and use the knowledge learned frequently. In this way, you can thoroughly understand and digest it by repeating it several times and never forget it.
5. Make appropriate investments to purchase experimental equipment and books and materials
The technology of single-chip microcomputer is of high value. Once you learn it, the benefits it brings to you are also high. Whether you are applying for a job or starting a factory or company, the prospects are bright and unlimited. Therefore, when learning, you should be willing to invest appropriately to purchase necessary learning and experimental equipment. In addition, you should often go to science and technology bookstores to buy some books suitable for your own learning and improvement. A good book is really important. You can read it at any time and supplement the knowledge you don’t understand or forget at any time.
Learning to use a microcontroller means understanding the microcontroller hardware structure and the application of internal resources, learning how to initialize various functions in assembly or C language, and how to compile programs to implement various functions.
Step 1: Use of Digital I/O
By using buttons to input signals and LEDs to display output levels, you can learn the digital I/O functions of pins. After pressing a button, a LED lights up. This is the function of combinational logic in digital circuits. Although it is very simple, you can learn general microcontroller programming ideas. For example, many registers must be set to initialize the pins so that the pins have digital input and output functions. Every time a function of the microcontroller is used, the register that controls the function must be set. This is the characteristic of microcontroller programming. Don't be afraid of trouble. All microcontrollers are like this.
Step 2: Use of timer. Once you learn how to use the timer, you can use a single-chip microcomputer to implement a sequential circuit. The function of the sequential circuit is powerful and has many applications in the control of industrial and household electrical equipment. For example, a single-chip microcomputer can be used to implement a corridor light switch with a button. After the button is pressed once, the light will automatically turn off after 3 minutes. When the button is pressed twice in succession, the light will always be on. When the button is pressed for more than 2 seconds, the light will turn off. Digital integrated circuits can implement sequential circuits, programmable logic devices (PLDs) can implement sequential circuits, and programmable controllers (PLCs) can also implement sequential circuits, but only single-chip microcomputers are the simplest and lowest cost to implement.
The use of timers is very important. Logic plus time control is the basis of the use of microcontrollers.
Step 3: Interrupt
The characteristic of a single-chip microcomputer is that a program is repeatedly executed. The execution of each instruction in the program requires a certain execution time. If the program does not execute a certain instruction, the action of the instruction will not occur, which will delay many fast-moving things, such as the falling edge when a button is pressed. In order to make the single-chip microcomputer respond to fast actions during the normal operation of the program, the interrupt function of the single-chip microcomputer must be used. This function is that after the fast action occurs, the single-chip microcomputer interrupts the normal running program and processes the fast action. After the processing is completed, it returns to execute the normal program. The difficulty in using the interrupt function is that it is necessary to accurately know when to not allow interrupts to occur (shield interrupts) and when to allow interrupts to occur (enable interrupts), which registers need to be set to make a certain interrupt work, what the program should do when the interrupt starts, what the program should do after the interrupt is completed, etc.
After learning about interrupts, you can compile programs with more complex structures. Such a program can do one thing and monitor one thing. Once the monitored thing happens, it will interrupt the thing it is doing and handle the monitored thing. Of course, it can also monitor multiple things. Figuratively speaking, the interrupt function enables the microcontroller to have the function of eating from the bowl and watching the pot.
Learning the above three steps is equivalent to the Eighteen Dragon Subduing Palms. If you have mastered three of the palms, you can barely protect yourself.
Step 4: RS232 communication with PC
All microcontrollers have USART interfaces, especially many models in the MSP430 series, which have two USART interfaces. The USART interface cannot be directly connected to the RS232 interface of a PC. The logic levels between them are different, so a MAX3232 chip is needed for level conversion.
The use of USART interface is very important. Through this interface, information can be exchanged between the microcontroller and the PC. Although RS232 communication is not advanced, it is very important to learn the interface. To use the USART interface correctly, you need to learn the communication protocol, PC RS232 interface programming and other knowledge. Imagine that the data on the microcontroller experiment board is displayed on the PC monitor, and the keyboard signal of the PC can be displayed on the microcontroller experiment board. How interesting it would be!
Step 5: Learn A/D conversion
The MAP430 microcontroller has a multi-channel 12-bit A/D converter, which can be used to operate analog quantities, display and detect voltage, current and other signals. When learning, pay attention to concepts such as analog ground and digital ground, reference voltage, sampling time, conversion rate, and conversion error.
A simple example of using the A/D conversion function is to design a voltmeter.
Step 6: Learn PCI, I2C interface and LCD interface
The use of these interfaces can make it easier for the microcontroller to connect to external devices, which is very important in expanding the functions of the microcontroller.
Step 7: Learn to compare, capture, and PWM functions
These functions enable the microcontroller to control the motor, detect the speed signal, and realize the control functions such as the motor speed regulator.
If you have learned all the above seven steps, you can design a general application system, which is equivalent to learning the ten moves of the Eighteen Dragon Subduing Palms and being able to attack.
Step 8: Learn the hardware and software design of USB interface, TCP/IP interface, and various industrial buses. It is very important to learn the hardware and software design of USB interface, TCP/IP interface, and various industrial buses, because this is the current direction of product development.
So far, it is equivalent to learning 15 moves of the Eighteen Dragon Subduing Palms, but it is not enough to be invincible. Even so, it is still considered a master of single-chip computers.
Previous article:Common faults of single chip microcomputer and their solutions
Next article:Single chip microcomputer controlled flash light circuit
Recommended ReadingLatest update time:2024-11-17 05:39
- 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
- Internet of Things Era | Which industries benefit from the application of Internet of Things
- FPGA Deep Analysis.pdf
- C51 uses macro definition to replace printf function
- Understanding the CAN bus from the bottom up
- Cheats
- STM32F429 USB_OTG_FS (PA11, PA12) read USB disk problem
- How to control trace impedance of PCB for signal integrity?
- Disassembling the USB wireless network card, the circuit scheme is very classic
- Design of Switching Power Supply Using MSP430 Microcontroller
- Analog Electronics Course Selection Test