90% of microcontroller beginners will encounter 10 problems

Publisher:blazingsLatest update time:2022-12-14 Source: zhihu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

01. What are the advantages and disadvantages of C language and assembly language when developing microcontrollers?

Assembly language is a symbolic language that uses literal mnemonics to represent machine instructions. It is the language closest to machine code. Its main advantages are that it takes up less resources and has high program execution efficiency. However, the assembly language of different CPUs may be different, so it is not easy to transplant.

C language is a structured high-level language. Its advantages are good readability and easy transplantation. It is a commonly used computer language. The disadvantage is that it takes up more resources and the execution efficiency is not as high as assembly.

For the currently commonly used RISC architecture 8-bit MCU, its internal ROM, RAM, STACK and other resources are limited. If written in C language, a C language instruction will become many machine codes after compilation, and ROM will easily appear. Issues such as insufficient space and stack overflow. Moreover, some microcontroller manufacturers may not be able to provide C compilers. In assembly language, one instruction corresponds to one machine code. It is clear what action is performed at each step, and the program size and stack call situation are easy to control, making debugging more convenient. Therefore, in the development of microcontrollers with fewer resources, it is better to use assembly language.



02. C or assembly language can be used in microcontrollers, but can C++?

In the development of microcontrollers, assembly and C are mainly used, and C++ is not used.

03. To engage in microcontroller development, do you have to know C?

Assembly language is a symbolic language that uses literal mnemonics to represent machine instructions. It is the language closest to machine code. Its main advantages are that it takes up less resources and has high program execution efficiency. However, the assembly language of different CPUs may be different, so it is not easy to transplant.

C language is a compiled programming language that takes into account the characteristics of multiple high-level languages ​​and has the functions of assembly language. C language has rich library functions, fast operation speed, high compilation efficiency, good portability, and can directly control the system hardware. C language is a structured programming language that supports the top-down structured programming technology widely used in current programming. In addition, C language programs have a complete module program structure, which provides a strong guarantee for the use of modular programming methods in software development. Therefore, using C language for programming has become a mainstream in software development. Using C language to write target system software will greatly shorten the development cycle, significantly increase the readability of the software, and facilitate improvement and expansion, thereby developing a system with larger scale and more complete performance.

To sum up, using C language for microcontroller programming is an inevitable trend in the development and application of microcontrollers. Therefore, as a microcontroller developer with comprehensive skills and involved in the development of larger-scale software systems, it is best to master basic C language programming.

04. When developing a more complex project with a short development time, is it better to use C or assembly?

For complex projects with tight development time, C language can be used, but the prerequisite is that you are very familiar with the C language and C compiler of the MCU system. Pay special attention to the data types and algorithms that the C compilation system can support. Although C language is the most common high-level language, different MCU manufacturers have different C language compilation systems, especially in the operation of some special function modules. If you don't understand these features, it will be troublesome to debug, and in the end it may not be as fast as using assembly.

05. Where can I find textbooks on 8088 and 196 chip microcontrollers?

Regarding the textbook in this area, one commonly used in universities is "IBM-PC Assembly Language Programming" published by Tsinghua University Press, which can be found online and in bookstores. In addition, you can also search for many other textbooks on the Internet, such as: "Microcomputer Principles and Assembly Language Tutorial" (edited by Yang Yanshuang, Zhang Xiaodong, etc.) and "16/32-bit Microcomputer Principles, Assembly Language and Interface Technology" (Author: Zhong Xiaojie, Chen Tao, Machinery Industry Publishing House Publishing House), etc., you can find them in larger science and technology bookstores or order them directly online.

06. Should beginners learn C or assembly first?

For beginners of microcontrollers, they should start with assembly. Because assembly language is the language closest to machine code, it can deepen beginners' understanding of the various functional modules of the microcontroller, thereby laying a solid foundation.

07. A junior in college has learned electronic circuits, digital logic, assembly and interfaces, and C language, but always feels confused and seems to know nothing. What should I do?

The university process is a theoretical process with relatively few opportunities for practice, which often results in a disconnect between theory and practice. This is a common problem in the domestic university education system, but students must not aim too high. Generally, you will be exposed to some professional courses starting from your junior year. Electronics-related majors will offer related microcontroller application courses and simple experimental projects. Then you must fully seize the opportunity of experimental classes and practice more practical machine operations. You can usually look at relevant electronic technology magazine websites to see other people's development experience, hardware design solutions and other people's software design experience. If possible, you can also participate in some electronic design competitions. Taking this opportunity for 2-3 people to work together to build a complete system will be more helpful. At the graduation project stage of your senior year, you can also choose relevant topics to do some practical cases to gain experience. Whatever you do, there is a process of accumulation of experience, step by step.

08. As a student, how to learn microcontroller well?

To learn microcontroller well, the most important thing is to practice and gain experience in practice. For school students, there will indeed be fewer practical opportunities, but if there is a chance, you can choose relevant topics for graduation internships, so that you can be exposed to actual projects. And if the principle of microcontroller and microcomputer is a main course, I believe the school will arrange more opportunities for practical computer use. If you are able, you can find some related part-time jobs, which will be more helpful. Moreover, the development and application of microcontrollers require the combination of software and hardware, so you can't just be satisfied with perfect programming skills. You should also pay attention to the accumulation of hardware knowledge, visit more electronic forum websites, and buy some related magazines.

09. How can I become a master of microcontrollers?

To become a master of microcontrollers, you should practice more and always pay attention to the development trends of microcontrollers; you should often visit related websites, where you can find a lot of useful information.

10. How long can 8-bit computers last?

At present, the main focus of MCU products is still in the 8-bit field, which is mainly used in six major markets: automotive applications, consumer electronics, computers and PC peripherals, telecommunications and communications, office automation, and industrial control. Among them, the automotive market is mostly in Europe and the United States. , while the Asia-Pacific region is dominated by consumer electronics, with large quantities and low unit prices as the mainstream products. Currently, there is a considerable price difference between 16-bit MCUs and 8-bit products, and new application areas are still being developed, at least for now. There is still a place for 8-bit MCUs.


Reference address:90% of microcontroller beginners will encounter 10 problems

Previous article:Microcontroller study notes, three steps to teach you
Next article:Children's shoes, let's talk about the learning methods of microcontroller programming technology.

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号