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
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- The problem of maintaining three minutes after clearing
- 2. "Wanli" Raspberry Pi car - Python learning (using Thonny)
- Hand warmer modification
- Summary of reading experience: "Self-study Handbook for Electronic Engineers"
- I2C Bus Protocol and Its Application
- TLP3547 Evaluation Board Evaluation 3: Operating Temperature Rise Test
- Arduino-style pyb
- Application of CAN bus in automobiles
- About the problem of registers hanging on the AXI bus
- I would like to ask the moderator for advice (7). Thank you for your help.