The Keil development application process is divided into the following steps:

(1) Create a project project file

(2) Select the microcomputer chip model

(3) Select to add microcomputer startup code, etc.

(4) Set project options

(5) Create and edit original program files

(6) Compile the original program file to generate a *.hex file

(7) Single-step or continuous simulation run debugging, observe the running results

(1) Create a project project file

After the keil software is installed, a shortcut icon will be created on the desktop. Double-click the icon to start the keil software and enter the development environment, as shown in the following figure:

Click “project” in the menu bar, select “New uvision project”, and enter the project creation and saving interface, as shown in the following figure:

Here you can choose the directory where the project is stored, it is best to create a new project folder, because the project created by keil will not automatically create a file by default, so create the file yourself, then select the created file, enter the project name, and click Save to enter the project configuration page, as shown below:

Here, select the model of the single-chip microcomputer, the STC89C52 single-chip microcomputer selected by the single-chip microcomputer model of this project, and click OK. A dialog box will pop up as shown below:

Click “Yes” here, the project is created successfully. Next, configure the target project, click the “magic wand” icon on the right side of Target 1 to enter the configuration window, as shown in the figure, first, change XTAL (MHZ) to 11.0592, then switch to the output output selection, and configure the debug output, As shown below

In the above picture, the checkbox in front of Creat HEX file is checked and checked. Click OK to return to the project.

The next step is to create the project source file, right-click the “source grop” menu, select “Add new ITEM to source grop”, select C file (.c), enter and click Add.

Then it is to write the code, the code is well written, there is no error in the compilation, and the HEX file is produced.

There is no error in the code, you can single-step or continuously simulate running and debugging, and observe the running results.Keil C51 has a built-in emulation CPU to simulate the execution of the program. The emulation CPU is powerful and can debug the program without hardware and emulator. However, there are still differences between software simulation and real hardware execution programs. The most obvious one is timing, which is reflected in the speed of program execution and the computer used by the user. The better the computer performance, the faster the running speed.






Reviewing Editor: Liu Qing

Leave a Reply

Your email address will not be published.