How to get started with microcontrollers

Publisher:彩虹微笑Latest update time:2015-10-13 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The first question many people who want to learn MCUs ask is how can they learn MCUs well? For this question, I will tell you how I started to learn MCUs, how I got started, and how I became proficient in this 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. The changes of these 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 be realized? 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. 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 does not require too many functions. For beginners, there are many things on the board with many functions that you will never use in your life. I suggest that there are running lights, digital tubes, independent keyboards, matrix keyboards, AD or DA (same principle) LCD, buzzer, which is about the same. If you can skillfully apply the above-mentioned things, 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 hurdle, the rest of the road will be much easier. We may have heard that the beginning is always the hardest.

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 to help you, then I advise you to buy one yourself. After all, it is much more convenient to have one yourself, and 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. Watch less movies and play less games every day. Connect the learning board and the 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 entered the door. 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 do electronics are really addicted. Then make the digital tube light up. After these two items, you can't extricate yourself. You have begun to consider what career you want to go in this life. This is how to practice. When writing programs, you will definitely encounter many problems. At this time, you will look for it in a book or ask others. When you get the answer, you will remember it for a lifetime. Knowledge must be used in real life to solve practical problems, so that it can play its role. Think about it yourself. You have been in college for so many years and have classes every day. What have you learned in class? Are you busy for the final exam? I got 90 points after the exam, so happy, hahahaha, but I forgot everything when I came back from the 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 language and C language. Many students have C language courses in their freshman and sophomore years. I also took it and 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 the microcontroller in C language? We must be able to use what is 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 microcontrollers. C language is also very simple, just a tool. I advise you to learn it better, and it will definitely be useful in the future. Otherwise, you have to learn it in the future. It doesn't matter if you don't know any assembly language, but if you don't know any C language, you will suffer in the future. Programming in assembly language is efficient, but relatively difficult and wordy, especially when encountering algorithmic problems. It is extremely troublesome. Now the main frequency of microcontrollers is constantly increasing, and we don't need such high-efficiency code at all. Because of the high-frequency clock, the ROM of microcontrollers is also constantly improving, which is enough to hold any code you write in C language. There is a lot of information on C language and it is 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.

 The next thing is programming. Let's talk about the learning process of programming. One of the best ways is to imitate. First, find someone else's ready-made program that can be compiled to generate code, download it, see the phenomenon, and then write it yourself. If there is an error, compare it with the correct one. After success, continue to learn. The most annoying thing is that some people take other people's programs, compile them directly, and after downloading them, they think they can do it, but when they have to write it themselves, they can't write it. Even if they copy it, they have to be familiar with it. This is a necessary process. In the end, what level do you need to reach? That is, the most basic timers, interrupts, and I/O ports of the microcontroller can be directly written without flipping through books or looking for other people's codes. Some people say that assembly language is direct and easy to understand, but if you can write 100 lines of assembly language, what about more than 1,000 lines? If you want to do a multiplication and division, assembly language will not work. C language is universal and easy to transplant. If you learn assembly language, you can learn one set of 51 microcontrollers, another set of avr microcontrollers, and even msp430. However, C language is the same. You can just take the algorithm and change the I/O port and you can use it. It is convenient for development.

 Finally, let me calculate the cost of learning microcontrollers. When I was learning before, I needed to buy a programmer, etc., but now I don't need to. For beginners, 51 microcontrollers are the best, with a lot of information, universal, and simple. The better ones on the market now include S series, C51 series, STC series, and of course, enhanced ones from various companies. From a learning perspective, S series and STC series are recommended, and they can be downloaded through ISP. I am currently using the STC series, and the minimum development system is:

8 yuan for a single chip microcomputer

Max232 3 yuan

Serial cable costs 6 yuan (can be made by yourself, just 3 cables)

Resistor and capacitor 3 yuan

Crystal oscillator 1 yuan

Light Emitting Diode 2 Yuan

Universal board 3 yuan

 The total cost is 26 yuan. Of course, these are just the basics. If you develop it yourself, you will also need a soldering iron, power supply, solder, etc. Other resources, such as digital tubes, buzzers, LCDs, etc. can be expanded slowly. Software is even more convenient. Keil can be downloaded directly from the Internet. In short, the resources are very rich now. Learning microcontrollers is not a difficult task. As long as you study hard, I believe that it should take about one month.

In summary, as long as you have confidence, can stick to things, and have a strong will not to give up until you succeed, it is very easy to learn a microcontroller.

Steps  :
1. Find a book to get a rough understanding of the structure of the microcontroller. Just get a rough understanding. You don't have to understand everything, and you won't be allowed to publish a book. (Three days)
2. Find some small circuit materials on the Internet to practice designing peripheral circuits. After soldering, debug yourself and get familiar with the process. (Ten days)
3. Find a learning board to practice writing programs. Learning microcontrollers is about practicing writing programs. If you encounter something you don't know, ask people or look up books. I bought a development board at the beginning and got it done in twenty days.
4. Design circuits and products with your own personal style... You are already a master... Do you see it? You can become a master in more than a month of hard work. 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 hard work!

Reference address:How to get started with microcontrollers

Previous article:MCU interrupt example
Next article:Summary of MCU button connection method

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号