2826 views|0 replies

1379

Posts

0

Resources
The OP
 

Some experience accumulated when debugging a system using Keil C [Copy link]

Some experience we have accumulated when debugging a system using Keil C

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 is passed but the result of the microcontroller operation is wrong. It is normal after switching to version 6.14.
This post is from MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list