First, click Target 1 in the Project window on the left, and then use the menu "Project->Option for target 'target1'" to display the dialog box for project settings. This dialog box is very complicated, with a total of 8 pages. It is not easy to understand all of them. Fortunately, the default values for most of the settings will be fine.
1. target option
Figure 5
In the Target page of the setup dialog box, as shown in Figure 5, the value after Xtal is the crystal frequency value. The default value is the highest available frequency value of the selected target CPU, which is 24M for the AT89C51 we selected. This value has nothing to do with the final target code generated, and is only used to display the program execution time during software simulation debugging. Correctly setting this value can make the displayed time consistent with the actual time used. Generally, it is set to the same as the crystal frequency used by your hardware. If you don’t need to know the program execution time, you can also not set it. Here it is set to 12.
Memory Model is used to set RAM usage. There are three options: Small means all variables are in the internal RAM of the microcontroller; Compact means one page of external expansion RAM can be used, and Large means all external expansion RAM can be used.
Code Model is used to set the use of ROM space. There are also three options: Small mode, which uses less than 2K of program space; Compact mode, the code size of a single function cannot exceed 2K, and the entire program can use 64K of program space; Large mode, the entire 64K space is available.
The Operating item is the operating system selection. Keil provides two operating systems: Rtx tiny and Rtx full. The operating system is another big topic. Usually we do not use any operating system, that is, use the default value of this item: None (do not use any operating system)
Use on-chip ROM option to confirm whether to use only on-chip ROM (Note: selecting this option does not affect the amount of target code generated in the end);
Off Chip Code memory is used to determine the address range of the system expansion ROM, and Off Chip xData memory group is used to determine the address range of the system expansion RAM. These options must be determined according to the hardware used. Since this example is a single-chip application and no expansion is performed, no reselection is performed and the default values are set.
2. Output options
Figure 6
The OutPut page in the Settings dialog box, as shown in Figure 6, also has multiple options.
Among them, Create Hex file is used to generate executable code files (HEX format files that can be written into the microcontroller chip by a programmer, and the file extension is .HEX). By default, this item is not selected. If you want to write a chip for hardware experiments, you must select this item. This is something that beginners can easily overlook, so please pay special attention to it.
Selecting Debug information will generate debugging information, which is used for debugging. If you need to debug the program, you should select this option.
Browse information generates browsing information, which can be viewed using the menu view->Browse. The default value is used here.
The button "Select Folder for objects" is used to select the folder where the final target file is located. By default, it is in the same folder as the project file.
Name of Executable is used to specify the name of the final generated target file. By default, it is the same as the project name. These two items generally do not need to be changed.
3. Others
The other pages in the Project Settings dialog box are related to the usage of C51 compile options, A51 assembly options, BL51 connector connection options, etc. The default values are taken here without any modification. The following is a brief introduction to the commonly used options in some related pages.
The Listing tab is used to adjust the generated list file options. After assembly or compilation, a (*.lst) list file will be generated. After linking, a (*.m51) list file will also be generated. This page is used to make detailed adjustments to the content and format of the list file. The more commonly used option is the "Assamble Code" item under "C Compile Listing". Selecting this item can generate the assembly code corresponding to the C language source program in the list file.
The C51 tab is used to control the compilation process of Keil's C51 compiler. The most commonly used one is the "Code Optimization" group, as shown in Figure 7. In this group, Level is the optimization level. When C51 compiles the source program, it can optimize the code up to 9 levels. The default level is 8, which generally does not need to be modified. If there are some problems in the compilation, you can try to lower the optimization level. Emphasis is to select the compilation priority mode. The first item is code quantity optimization (the final generated code quantity is small); the second item is speed priority (the final generated code speed is fast); the third item is default. The default is speed priority, which can be changed as needed.
Figure 7
Previous article:The difference between Flash E2prom Ram of MCU
Next article:In-System Programming (ISP) and In-Application Programming (IAP)
Recommended ReadingLatest update time:2024-11-16 19:40
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Single-chip microcomputer C language programming and simulation
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Single chip microcomputer control technology (Li Shuping, Wang Yan, Zhu Yu, Zhang Xiaoyun)
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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Disable automatic layer selection for routing
- [National Technology N32 MCU Development Package] --N32L40x Series
- Positive and negative 12V power supply, MC340463, simulation is OK, but the actual limit is about -5V
- [NUCLEO-WL55JC2 Review 4] STM32WL sub-GHZ RF (LoRa\FSK..)
- AVRDUDE released version 6.4 and moved to github
- Several issues on hysteresis compensation
- I wish you all good health and a safe family and a happy new year!!!
- MSP430FR2311 microcontroller infrared reflective sensing
- Does anyone have the BAP protocol in Volkswagen's CAN protocol?
- [RVB2601 Creative Application Development] 8 If more than a certain number of letters are not shot down, the game will be displayed as over.