Since the advent of microcontrollers, controlling robots has become increasingly easier. However, before such excellent tools were available, how did engineers make robots move?
Before digital computers were invented, people built analog computers using vacuum tubes, capacitors, inductors, and resistors, which could perform many simple calculations and control tasks. An analog computer uses signals that are not binary (1 or 0) but rather analog signals that continuously vary in voltage, similar to the operations used in various controllers in automatic control principles. Don’t underestimate analog computers; during the Middle Eastern wars of the 1980s, the Arab countries used Soviet-made fully automatic anti-aircraft guns that incorporated analog computers to calculate aircraft trajectories and control artillery fire.
Before the invention of analog computers, during the steam engine era, some mechanical geniuses constructed mechanical computers using hundreds of gears and cams. People would turn various gears marked with numbers, and other gears would display the calculation results. Mechanical computers were once high-tech products in human history; during World War II, Germany’s famous cipher machine was a type of electromechanical hybrid computer, which was the most secretive communication tool at that time.
Controllers Made of Springs, Stopwatches, and Relays
At the beginning of the electrical era, people used the mechanical rotation of clockworks to control the on-off of some relays, thereby controlling the operation of machine tools and production lines. This device is similar to the timers used in early washing machines.
Looking at these cumbersome machines, doesn’t it make your head spin? It’s still easier to study microcontrollers!
Many beginners in microcontrollers often ask me: I am currently a beginner in microcontrollers; how can I learn microcontrollers faster? Is there a market for learning microcontrollers? Regarding this question, I will share my thoughts on how I learned microcontrollers, how to get started, and how to become proficient. First, let’s talk about microcontrollers. The MCS-51 microcontroller is widely used (but considering cost and pin resources, different microcontroller models are used in practical development). Its learning materials are abundant, and the learning cost is very low. If you’ve heard of the chips used in companies but don’t know them, have you ever asked how much that emulator costs? The 51 microcontroller is excellent for beginners in intelligent control. ARM is too mysterious, and PLC is too expensive; after thinking about it, the 51 is still the best choice.
So how can we learn microcontrollers faster and better? The subject of microcontrollers emphasizes hands-on practice, and it is a discipline that combines computer programming and electronic technology. If you are a microcontroller expert, it means you are also proficient in computer programming and electronic technology.
Reading is Essential When Learning Microcontrollers
You can’t just read books, but you must start by reading them first, which seems contradictory. This is because you need to understand the various functional registers of microcontrollers (such as pin control registers, timers, interrupts, and serial port-related registers) from books. The core of controlling microcontrollers is to use programs to control various functional registers by assigning binary data (0 or 1) to them. This way, for pin registers, the microcontroller can output high and low levels to control external devices based on binary data. For internal resource registers, the microcontroller also uses binary data to utilize its internal functions. For example, the microcontroller pin register P1, the statement P1=0xfe; (MOV P1,#0FEH) indicates that the first pin of the microcontroller P1 is outputting a low level while the other pins are outputting high levels. For the interrupt enable register IE, the statement IE=0x81; (MOV IE,#81H) indicates that the overall switch for interrupts is turned on along with the sub-switch for external interrupt 0.
As for reading books, you only need to have a general understanding of what each pin and special function register does and what functions they can achieve. This is extremely important, and it may be the primary purpose of reading. The first and second readings may not be clear, but that’s okay because you still lack practical sensory experience. Through the following experiments, you can gain a very intuitive understanding. In this process, you must spend time; learning programs should not be memorized, but understanding registers must be diligently studied to grasp their functions.
I recommend one book; this one is enough. The book is titled “Examples on 8051,” which has both assembly language and C language versions. It is an incredibly powerful book, and I finished reading it during a five-day holiday. After finishing it, I felt like I had become a microcontroller expert. The book is richly illustrated, and the content is tightly organized, unlike many technical documents on the market that are preachy, where you learn concepts, instructions, and interfaces sequentially, only to realize that learning microcontrollers feels like deciphering a heavenly book.
According to the book’s arrangement, read through the first two chapters step by step, then it’s all about practice, definitely practice, which is a crucial step. There are many examples of paper tigers in the battlefield; the same goes for learning microcontrollers. Many graduate students and even PhD students in related fields graduate without knowing the distribution of microcontroller IO ports, let alone discussing development. Even some so-called microcontroller experts only remain at the programming level, thinking that after buying a high-level learning board and practicing all the programs on it, they feel like they are second to none, not knowing how to learn microcontrollers next. Unbeknownst to them, many of them do not even know the appropriate resistor for the LED in microcontrollers, let alone the pin distribution of microcontrollers. If they develop like this, isn’t it “playing with fire”? Isn’t that just talking without action?
What Do You Need to Prepare for Learning Microcontrollers?
Reading books is not enough for learning microcontrollers; practice must also start from reality. Nowadays, technology is highly modularized; everything can be modularized. In the end, technicians have become people who only know how to use the knowledge left by their ancestors. Basic knowledge must still be known. After all, the ultimate goal of learning microcontrollers is development, to create intelligent control entities that reflect one’s value.
Regarding practice, there are two methods to choose from: buy a 51 microcontroller experiment board, which doesn’t require too many functions. For beginners, a board with many features is excellent, but there are many things on it that you will never use in your life. Moreover, some experiment boards use surface-mounted components and double-sided wiring to reduce costs while increasing functionality; the more complicated, the higher the level. It seems that they designed it with the mindset that learning microcontrollers only requires downloading programs according to their prompts.
Many beginners still think that microcontrollers are not just a chip but the single-board computers often mentioned in old textbooks that are no longer used. I believe that having these few modules is enough for beginners in microcontrollers; the rest must be developed independently. Flowing lights, digital tubes, keyboards, buzzers, serial communication, AD, etc. are generally sufficient. If you can skillfully apply the above, you can say that you have entered the hardware realm of microcontrollers, and the rest is just practicing circuit design and accumulating experience.
When designing circuits, you must learn PCB design software. After all, product development requires computer-aided design for mass production; manual efficiency is too low. However, during the learning process, I suggest doing the soldering yourself. Before soldering, you must understand the circuit connections. You can find many circuit schematics online, but not all of them are usable, so it’s advisable to prepare a breadboard. With it, you can test the circuit before soldering. If it works on the breadboard, your later soldering will be successful; if not, you can just find another one. As long as you pass the first hurdle, the following path will be easier; the beginning is always the hardest.
Method Two: If you have someone around you who is a beginner in microcontrollers and has strong hands-on skills, ask them to help you set up a simple microcontroller minimum circuit, even if it’s just to control an LED. For them, building a microcontroller minimum system board is easy, but it can be much harder for beginners. Once this barrier is broken, everything becomes simple. Only by understanding the hardware can you use it skillfully. Only by knowing how programs are downloaded into the microcontroller can you understand why you need to write microcontroller programs; this motivation comes from having a solid foundation. Programming microcontrollers is like conversing with the microcontroller. If you don’t know who the other party is or if they are listening, will you still have the passion to speak? Of course, if there is no one like that, as I said, find several minimum circuit schematics online and solder them on a breadboard. If you don’t know how to do that, I suggest you buy an experiment board, which will be useful for future learning experiments and project testing.
How to Enter the World of Microcontroller Development
With a microcontroller experiment board, you should practice more. It’s best to have a computer; download fewer movies, play fewer online games, connect the experiment board to the computer, install the necessary software, download reference programs, and modify the reference programs, starting with the simplest traffic light experiment. Once you discover that you can control the traffic light and understand the soft and hard design of traffic, you have entered the field. You will find how fascinating microcontrollers are. This is not just about learning knowledge; it’s about enhancing your value. Designing a traffic light with such a wide range of applications is a piece of cake; will you still feel that you haven’t learned anything? Will you still feel that you know nothing? You’ve applied knowledge from computer programming and electronic technology.
When the program you write achieves your desired results, it brings more happiness than anything else. The sense of achievement and fulfillment from learning is incredibly rare. Then let the digital tube light up to display the numbers you need. Once you master these two parts, you won’t be able to extricate yourself; you’ll begin to consider which field you want to pursue in your life. Learning like this, when you write programs, you will definitely encounter many problems. At this time, you can refer back to the books you studied before, including programming books and digital/analog electronics books. You will realize that the knowledge you learned before is still useful. When you encounter something you don’t understand, go back to the books you studied; this is the essence of “reviewing the old and learning the new, which can be a teacher.”
Knowledge must be applied to real life to solve practical problems. For example, using a microcontroller to design a simple home appliance timer or an infrared remote control can bring its function to life. Think about it: after so many years of university, after exploring for so long, hesitating and wandering, attending classes every day, what have you learned? Is it just to work hard for a 60-point exam and feel happy about scoring 90 points, boasting about how well you learned your major in front of others? Unbeknownst to you, university exams are not like high school exams. What’s the use of getting a scholarship? But when the next semester starts, you realize you’ve forgotten everything you learned. What did you learn? Why recommend learning microcontrollers? Because microcontrollers are a discipline for engineering students, combining computer programming, electronic technology, and various control languages. Rather than saying learning is about mastering microcontrollers, it’s more about learning a comprehensive discipline.
Should You Learn Assembly Language or C Language for Microcontroller Programming?
Regarding the question of whether to program in assembly or C language, this confuses many people. It may mainly stem from the guidance of school teaching and some textbooks. In the first year, students are taught C programming, but before they understand its practical applications, they quickly move on to other languages. Even when they start specialized microcontroller courses, the content is similar to technical documentation, with many instructions but not many complete examples, so after learning, they still don’t know why they need to learn programming. Many students start C programming in their first year; I’ve been through it too, but back then, it was just multiplication and addition, calculating factorials, etc., using C language to solve elementary school math problems, attending lab sessions twice a week, typing endlessly in front of the book, and after class, not knowing what I had mastered or its usefulness. After finishing the course, what’s the use? When asked in an interview, “Have you learned programming?” what immediately comes to mind? C language, VC, VB, etc. Many think C language is fundamental and engineering-oriented, while VC is advanced and object-oriented. But when the boss asks, “Can you apply what you learned in C language to practical situations? For example, can you design a timing alarm in C language?” You’ll be at a loss because you haven’t learned it in school.
Programming in microcontrollers can be done in either C or assembly language, but I recommend C language as it is better. It allows for modular management, making programming easier and more portable, suitable for writing large programs. If you already have a foundation in C language, it will be easier to learn; if not, you can learn C language while learning microcontrollers. Although many people start with assembly language, writing small programs in assembly language is still simple. However, if you want to implement some algorithms, assembly language can become complex. Although the compiled code in C language is noticeably longer than in assembly language, and its execution efficiency is not as high, in previous microcontroller development, due to chip technology and microcontroller frequency limitations, many microcontrollers had very limited internal memory and frequency. However, things are different now; the internal memory of chips no longer cares about these differences, and the frequency is increasing.
So should assembly language be abandoned? No, it must be learned. There are two reasons: first, when starting with microcontrollers, assembly language has simple syntax. Second, if you want to become a senior designer of microcontroller programs, mastering assembly language is essential. Many advanced microcontrollers, like ARM, use assembly language as the boot code, and many newly released microcontrollers initially have assembly language compilers before C language compilers are available. Therefore, I believe for learning microcontrollers, start with assembly language, master C language, and then become proficient in assembly language.
Finally, for learning microcontrollers, start with the basics and then focus on the market and what talents companies need. I believe that with a solid foundation, you can quickly adapt to the required microcontroller types before interviews, as learning is fundamentally the same.
1.What do hardware engineers primarily do?
2.The most sophisticated coding techniques
3.Regardless of whether you have graduated or are under 30, it is recommended to read this career plan!
4.Nine key technologies of multi-core processors that must be considered during design!
5.In 2016, what was the salary of embedded software development engineers? Check if you meet the standards!
6.What books did foreign tech experts read when they were young to learn programming?
Disclaimer: This article is a network repost, and the copyright belongs to the original author. If there are any copyright issues, please contact us, and we will confirm the copyright based on the materials you provide and pay the remuneration or delete the content.