1. Since Keil C does not support Chinese very well, the displayed cursor will be inconsistent with the actual cursor position, which will affect the modification of Chinese comments. Under Windows 2000, we can set the font to Courier, so that it can be displayed normally.
2. When using an MCU with off-chip memory (such as W77E58, which has 1K off-chip memory), you must set the flag bit and choose the large mode for compilation, otherwise there will be errors.
3. When using Keil C to track the program running status, you must block the statement that causes Warning, otherwise there may be errors when tracking the statement.
4. When calling an array, Keil C first loads the array into memory. If you want to use a long array in C, you can use the code keyword, so that the DB function of the assembly is realized. Keil C will not load the array marked with code into memory, it will directly read Rom.
5. When programming involves communication, timing is very important. The execution speed of pulling up the pin is much faster than checking the pin level.
6. When waiting for the pin level to change, we need to set a timeout process, otherwise the program will deadlock due to an unexpected error.
7. Where C language can be used, try not to use assembly language, especially in the implementation of algorithms, which are obscure and difficult to understand.
8. Several parameter arrays of the program occupy a large space, among which the LCD background array is the longest, with 4,000 bytes. Therefore, those initialization arrays are placed in another C file, and the keyword extern is used in the main file to define them, so as not to interfere with the writing of the main file.
9. The lower the correlation between all functions, the more conducive it is to the expansion of functions in the future.
10. When compiling an array with the code keyword in version 6.20, the compilation passes but the result of the microcontroller operation is wrong. It is normal after switching to version 6.14.
Previous article:Several useful modules for single-chip C51 programming
Next article:A summary of mixed programming of C and assembly
Recommended ReadingLatest update time:2024-11-17 03:51
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- Is it OK to use 74HC164 like this?
- Share an open source architecture of ethercat-based on XMC4800
- (Transfer) bluetooth abbreviation
- TI is now bringing you the skills to master complex automotive electronics design
- First experience - unboxing
- WIFI 6 is coming, do you know about it?
- 【ST NUCLEO-H743ZI Review】(5)FREERTOS
- I plan to equip the slag EBAZ4205 with an extended version
- TMC5130 is used as a driver to drive the motor. Why does the motor hum when it is stationary?
- Live broadcast at 10 am today [TI's optimized solutions in industrial multi-protocol communication applications]