The first question many people who want to learn microcontrollers ask me is how can they learn microcontrollers well? For this question, today I will tell you how I started learning microcontrollers, how I got started, and how I became proficient in the process.
Let's talk about the single-chip microcomputer first. Generally, the MCS-51 single-chip microcomputer that we use more now has a lot of information, many people use it, and the market is also very large. In my personal experience, how can I learn the single-chip microcomputer course faster? The single-chip microcomputer course is a subject that attaches great importance to hands-on practice. You can't always read books, but you must read books first to learn it, because from the book you need to have a general understanding of the various functional registers of the single-chip microcomputer. To put it more clearly, we use the single-chip microcomputer to control the various functional registers of the single-chip microcomputer with software. To put it more clearly, it is to control when the level of those pins of the single-chip microcomputer outputs high and when it outputs low. These changes in high and low levels control your system board and realize the various functions we need. As for reading books, you only need to have a general understanding of what each pin of the single-chip microcomputer does? What kind of functions can it achieve? You may not understand it the first time or the second time, but it doesn't matter, because you still lack practical sensory understanding. So I always say that it is enough to read books for two or three days to learn single-chip microcomputers. You can read five or six novels a day, and it is enough to read single-chip microcomputers two or three times in two or three days. You don't need to read them carefully. I recommend a book. This one is enough. The title is "New MCS-51 Single-chip Microcomputer Application Design", which is published by Harbin Institute of Technology Press and the author is Zhang Yigang. It is very important to have a general understanding of the content of the book and then practice. If you don't practice to learn single-chip microcomputers, it is impossible to learn. There are two ways to practice. One way is to spend money to buy a single-chip microcomputer learning board. It doesn't require too many functions. For beginners, you buy a board with many functions. There are many things on it that you will never use in your life. I suggest running lights, digital tubes, independent keyboards, matrix keyboards, AD or DA (the principle is the same), LCDs, buzzers, and that's about it. If you can apply the above-mentioned things skillfully, it can be said that you have already entered the hardware of single-chip microcomputers. The rest is to practice designing circuits by yourself and constantly accumulate experience. As long as you pass the first level, the rest of the road will be much easier. Everyone may have heard that everything is difficult at the beginning. Method 2: If you have an expert in single-chip microcomputers around you, ask him for help and let him help you build a simple minimum system board. For an expert, it only takes one minute to make a minimum system board for a single-chip microcomputer, but it is much more difficult for a beginner, because only when you understand the hardware can you use it skillfully. If you don’t have such an expert around you and can’t find someone who can help you, then I advise you to buy one yourself. After all, it is much more convenient to have one yourself. You can use it when doing small experiments such as single-chip microcomputers in the future, and it is also trouble-free.
After you have a MCU learning board, you should practice more. It is best to have a computer of your own. Watch fewer movies and play fewer games every day. Connect the learning board and computer, open the debugging software and sit in front of the computer. First learn how to use the debugging software, and then start with the simplest running light experiment. When you can make the eight running lights flow freely according to your wishes, you have already got started. You will find how fascinating the MCU is. It is so fun. This is not learning knowledge, but playing. When the program you wrote is realized according to your wishes, you are happier than doing anything else. You will be addicted, really. People who work in electronics are really addicted. Then make the digital tube light up. After these two things, you can't help yourself. You have begun to consider what career you want to take in this life. This is how you practice. You will definitely encounter many problems when writing programs. At this time, you can look for them in books or ask others. When you get the answers, you will remember them for a lifetime. Knowledge must be used in real life to solve practical problems. Only in this way can it play its role. Think about it yourself. You have been in college for so many years and have been in class every day. What have you learned in class? Are you busy for the final exam? You got 90 points after the exam, hahaha, so happy, but you forgot everything when you came back to school next semester, right? What did you learn? But I tell you that once you learn the microcontroller, you will never forget it. In addition, let me talk about the problem of programming in assembly and C language. Many students have C language courses in their freshman and sophomore years. I have also taken them. I know that at that time, every day I was multiplying, adding, and calculating factorials. What's the use of learning it? Would you be stupid if you were asked to program a microcontroller in C language? We must be able to use the things in the book. Microcontroller programming can be done in C language or assembly language, but I suggest that C language is better. If you have a foundation in C language, it will be easier to learn. If not, you can also learn C language while learning microcontroller. C language is also very simple, just a tool. I advise you to learn it, it will definitely be useful in the future, otherwise you will have to learn it in the future. It doesn't matter if you don't know any assembly language, but you will suffer in the future if you don't know any C language. Assembly language is efficient in writing program codes, but it is relatively difficult and verbose, especially when encountering algorithm problems, it is very troublesome. Now the main frequency of microcontrollers is constantly increasing, and we don't need such efficient code at all, because there is a high-frequency clock, and the ROM of microcontrollers is also constantly improving, which is enough to hold any code you write in C language. There are a lot of C language materials and they are easy to find. It will be very portable in the future. You only need to change an IO port to write a temperature sensor program and it can be used anywhere, so I advise everyone to use C language.
To sum up, as long as you have confidence, can stick to what you do, and have a strong will not to give up until you succeed, then learning a microcontroller is a very easy thing.
Steps: 1. Find a book to learn about the structure of the microcontroller. Just get a general understanding. You don't have to understand everything. I won't let you publish a book. (Three days)
2. Find a learning board to practice programming. Learning microcontrollers is all about practicing programming. If you encounter something you don’t know, ask someone or look up a book. (20 days)
3. Find some small circuit materials on the Internet and practice designing peripheral circuits. After soldering, debug by yourself and get familiar with the process. (10 days)
4. Design your own circuits and products with your own personal style. You are already a master.
Did you see it? If you work hard for more than a month, you can become a master. That’s all I have to say. It depends on you whether you can learn it or not and whether you can put in the effort.
My experience in learning microcontrollers.
Many people say that it is best to learn assembly language before learning MCU. From my experience, I can tell you that this is absolutely not necessary. Beginners can directly use C language to program MCU from the beginning, which not only saves time, but is also easy to learn and will improve quickly. When you first start learning MCU, don't waste time trying to understand the internal structure of the MCU. This will only undermine your confidence. When you learn programming, you will naturally master its internal structure step by step.
Learning and practice of single chip microcomputer.
The key to improving MCU is practice. If you want to learn MCU well, software programming is essential. But being familiar with hardware is also very important for learning MCU well. How to learn hardware well, hands-on practice is essential. We can make our own electronic production by ourselves, and by completing it, we can improve our understanding of some chips and use them proficiently. In this way, we can learn more about the structure of the chip. I believe that when you complete an electronic production of your own, your MCU level will be qualitatively improved.
This is my experience in learning MCU, I hope it will be helpful for MCU enthusiasts to learn MCU well. [page]
Using a microcontroller means understanding the microcontroller hardware structure and the application of internal resources, and learning the initialization settings of various functions in assembly or C language.
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 the timer
Once you learn how to use a timer, you can use a single-chip microcomputer to implement a sequential circuit. The function of a 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 a row, 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, and logic plus time control is the basis for the use of single-chip microcomputers.
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 operation of the program, processes the fast action, and returns to execute the normal program after the processing is completed. The difficulty in using the interrupt function is that it is necessary to accurately know when the interrupt is not allowed to occur (shield interrupt) and when the interrupt is allowed to occur (open interrupt), 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 programs can do one thing and monitor one thing. Once the monitored thing occurs, it interrupts the thing being done and processes the monitored thing. Of course, it can also monitor multiple things. Figuratively speaking, the interrupt function enables the single-chip microcomputer 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, conversion error, etc. 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 of 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 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 development direction of product development.
So far, it is equivalent to learning 15 moves of the Eighteen Dragon Subduing Palms, but it is not yet the level of being invincible. Even so, it is still considered a master of single-chip computers!!
And program compilation to realize various functions.
Previous article:Introduction to various programmers for single chip microcomputers
Next article:What are microcontroller clock cycle, machine cycle, and instruction cycle?
Recommended ReadingLatest update time:2024-11-16 15:40
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- C2000 floating point calculation notes - differences between CPU and CLA and error handling techniques
- EEWORLD University ---- Theoretical basis of IoT terminal development
- Tips for implementing I2C with MSP
- ARM-based support for advanced video graphics capabilities on MCUs
- 12-bit ADC
- New Bluetooth TFT color screen capacitive touch electronic bracelet 10 yuan each
- Research and application of GaN materials
- What does it mean to have a window in the solder mask layer of a PCB? Reasons for having a window in the solder mask layer of a PCB
- Signal generator and DA conversion
- Use AM5728 EVM to make and download 6678 program