1. What are the advantages and disadvantages of C language and assembly language in microcontroller programming? Answer: Assembly language is a symbolic language that uses text 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, different CPUs may have different assembly languages, so it is not easy to transplant.
C language is a structured high-level language. Its advantages are good readability and easy transplantation, and it is a commonly used computer language. The disadvantage is that it takes up more resources and its execution efficiency is not as high as assembly language.
For the 8-bit MCU with RISC architecture that is currently widely used, its internal ROM, RAM, STACK and other resources are limited. If it is written in C language, a C language instruction will become many machine codes after compilation, which may easily cause problems such as insufficient ROM 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, and it is clear what action is performed at each step. In addition, the program size and stack call situation are easy to control, and debugging is also more convenient. Therefore, in the development of single-chip microcomputers, we still recommend the use of assembly language.
2. C or assembly language can be used for single-chip microcomputers, can C++ be used? Answer: In single-chip microcomputer programming, assembly and C are mainly used, and C++ is not used.
3. Do you have to know C to do single-chip microcomputer programming? Answer: Assembly language is a symbolic language that uses text 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, different CPUs may have different assembly languages, so it is not easy to transplant.
For the 8-bit MCU with RISC architecture that is currently widely used, its internal ROM, RAM, STACK and other resources are limited. If it is written in C language, a C language instruction will become many machine codes after compilation, which is easy to cause problems such as insufficient ROM space and stack overflow. Moreover, some single-chip microcomputer manufacturers may not be able to provide C compilers. In assembly language, one instruction corresponds to one machine code, and it is clear what action is performed at each step. In addition, the program size and stack call situation are easy to control, and debugging is also more convenient. Therefore, in the development of single-chip microcomputers with fewer resources, we still recommend the use of assembly language.
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 computing 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, and
significantly increase the readability of the software, making it easier to improve and expand, thereby developing a larger scale and more complete system.
In summary, using C language for single-chip microcomputer programming is an inevitable trend in single-chip microcomputer development and application. Therefore, as a single-chip microcomputer developer with comprehensive technology and involved in large-scale software system development, it is best to master basic C language programming.
4. When developing a complex project with a short development time, is it better to use C or assembly? Answer: For complex projects with a short development time, you can use C language, but the premise is that you are very familiar with the C language and C compiler of the MCU system, and pay special attention to the data types and algorithms that the C compiler system can support. Although C language is the most common high-level language, different MCU manufacturers have different C language compiler 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.
5. In teaching, I need to use 8088 and 196 chip microcontroller programming. Where can I find books or materials on this subject?
A: Regarding textbooks in this area, a commonly used textbook in college is "IBM-PC Assembly Language Programming" published by Tsinghua University Press. It can be found online and in bookstores. In addition, many other textbooks can be searched online, 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" (authors: Zhong Xiaojie and Chen Tao, published by Machinery Industry Press), etc., which can be found in larger science and technology bookstores or ordered directly online.
6. Should beginners learn C or assembly first? A: For beginners of single-chip microcomputers, 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 single-chip microcomputers, thus laying a solid foundation.
7. I am a third-year student of electronic science and technology at Wuhan University. I have learned electronic circuits, digital logic, assembly and interface, and C language, but I always feel confused and feel like I don't know anything. What should I do?
Answer: The university process is a theoretical process, and there are relatively few opportunities for practice, which often leads to 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 start to get in touch with some professional courses from the third year of college. Electronic-related majors will offer related single-chip microcomputer application courses and simple experimental projects. Therefore, you must fully grasp the opportunities of experimental classes and practice more on the actual machine operation. You can usually read more related 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, 2-3 people will work together to make a complete system, which will be more helpful. When you reach the fourth year graduation design stage, you can also choose related topics to do some actual cases to gain experience. There is a process of accumulating experience in everything you do, step by step.
8. As a student, how can I learn single-chip microcomputer programming well? Answer: The most important thing to learn single-chip microcomputer programming well is practice, and gain experience in practice. For students in school, there are indeed fewer opportunities for practice, but if there is a chance, you can choose related topics for graduation internships, so that you can get in touch with actual projects. And if the principle of single-chip microcomputer is a main course, I believe the school will arrange more opportunities for practice on the computer. If you have the ability, you can find some related part-time jobs to do, which will be more helpful. And the development and application of single-chip microcomputers requires the combination of software and hardware, so you can't just be satisfied with how
perfect . You should also pay attention to the accumulation of hardware knowledge, visit electronic forums and websites more often, and buy some related magazines. If possible, you can go to the electronic market to buy some small parts and build a small system to make it work.
HOTLEK's single-chip microcomputer is an 8-bit single-chip microcomputer with RISC structure. It can be widely used in household appliances, security systems, handheld games, etc. Generally speaking, it can be divided into I/O type single-chip microcomputer, LCD type single-chip microcomputer, A/D type single-chip microcomputer, A/D with LCD type single-chip microcomputer, etc.
9. How can you become a master of single-chip microcomputer programming? Answer: To become a master of single-chip microcomputer, you should practice more, pay attention to the development trend of single-chip microcomputers; often visit some related websites, where you can find a lot of useful information.
10. Are women suitable for the MCU software programming industry? Answer: It depends on your interest and your patience for software programming. Both men and women are suitable for this industry.
Previous article:Three steps to learn MCU programming design
Next article:The eight most important steps to learn microcontrollers
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Disturbance-free continuous power supply solution (disturbance-free quick switching with anti-sway module)
- Power supply obstacle" + electromagnetic interference and inductive howling
- Install an N102 on STM32F103 and experience NB-IoT development at home
- Selecting a buck-boost solution
- MSP430F5529 library functions
- Simple laser flashlight circuit diagram
- Zero-knowledge open source sharing-temperature and humidity module SHT3X SHT30 SHT31 SHT35
- Why does the waveform of the bubble sensor in medical infusion pipeline have two segments?
- MSP430: Introduction to the method of programming long data to Flash
- Common causes of RF interference in mobile communication systems