Some experience accumulated when debugging a system using Keil C

Publisher:江上HZLatest update time:2012-07-04 Source: 21ic Keywords:KeilC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
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 passes but the result of the microcontroller operation is wrong. It is normal after switching to version 6.14.
Keywords:KeilC Reference address:Some experience accumulated when debugging a system using Keil C

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

Experience in making and using KeilC51 Monitor-51 simulation board
MCS-51 single-chip microcomputer is the most widely used and enduring one in my country. In the past, single-chip microcomputer applications were mainly written in assembly language. Since the readability and portability of assembly language programs are poor, the use of assembly language to write single-chip microcom
[Microcontroller]
Experience in making and using KeilC51 Monitor-51 simulation board
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号