I will not talk much about the installation of Keil platform software. There is a lot of information on this topic on the Internet. You can search Baidu for tutorials on how to install Keil. Now let's start to explain the operation process of creating, closing, and opening a complete project using Keil software.
Step 1: Create a new project folder. First, create a new folder in the D drive directory of the computer and name it "stc89c52rc".
Step 2: Start the Keil software. Double-click the "keil uVision4" icon on the desktop to start the Keil software.
Step 3: Close the existing project that is opened by default. When you open the Keil software, if you find that the software opens a previously existing project by default, please close this project first. If the existing project is not opened by default, this step can be ignored. To close an existing project, click the "Project" option above and select "Close Project" in the pop-up drop-down menu.
Step 4: Use the tool wizard to create a new project. Click the "Project" option above, select "new uVision Project..." in the pop-up drop-down menu, and in the pop-up dialog box, select the directory to save in the folder "stc89c52rc" created in the first step, enter the same file name as the folder name "stc89c52rc", and then click the "Save" button. At this time, a dialog box for selecting the microcontroller model will pop up. Double-click the manufacturer "Atmel", select the model "AT89C52" in the expanded drop-down options, and then click "OK". At this time, an English inquiry box will pop up, "Do you want to copy the STARTUP.A51 file to the project?" We just click "No".
Step 5: Create a new .c source file. Click the "File" option above, select "New..." in the pop-up drop-down menu, and you will see a file named "Text1". Click the "File" option above again, select "Save" in the pop-up drop-down menu, and a save dialog box will pop up. Choose to save it in the folder created in the first step, and name it "stc89c52rc.c". Click "Save".
Step 6: Add the newly created .c source file to the project and establish an association with the project. Click the "+" sign in front of "Target 1" in the "Porject" option box on the left (if you do not find the Project, please follow the explanation in the second item below), and you will see "Source Group 1" in the expanded drop-down menu. Right-click the "Source Group 1" option, select the "Add Existing Files to Group 'Source Group 1'..." option in the drop-down menu, and a file selection dialog box will pop up. Click to select the newly created .c source file, and then click the "Add" button once. Although the dialog box is not closed at this time, the .c source file has been added to the project. At this time, just click the "Close" button again to close this dialog box. At this time, you will find that there is an extra "+" sign in front of "Source Group 1" on the left. Click this "+" sign to expand it, and you will find the .c source file "stc89c52rc.c" that we just added below.
Step 7: Double-click to open the "stc89c52rc.c" .c source file added to the project on the left, and then you can enter our C language code in this "stc89c52rc.c" file. Please copy the following sample code into it, and then click the "File" option again, and select "Save" in the pop-up drop-down menu. At this point, the steps of creating a new project have been completed.
Example code to copy:
#include "REG52.H"
void delay_long(unsigned int uiDelayLong); //delay function
sbit led_dr=P3^5;
void main()
{
while(1)
{
led_dr=1; //LED is on
delay_long(100); //Delay time for 50000 empty instructions
led_dr=0; //LED off
delay_long(100); //Delay time for 50000 empty instructions
}
}
void delay_long(unsigned int uiDelayLong) //delay function
{
unsigned int i;
unsigned int j;
for(i=0;i
{
for(j=0;j<500;j++); //Number of empty instructions in the embedded loop
}
}
Step 8: Open an existing project. The previous seven steps have explained how to create a new project. Now let's teach you how to open an existing project. First, click the "X" in the upper right corner to close the entire Keil software, then double-click the "keil uVision4" icon on the desktop to restart the Keil software. If you find that this software opens a previously existing project by default, please close this project according to the previous third step. Then, click the "Project" option above, select "Open Project..." in the pop-up drop-down menu, and in the pop-up file dialog box, find the new project folder created in the first step, click to select the "stc89c52rc.uvproj" file name, and then click "Open" to open an existing project file.
For detailed operation steps, please click here: bbs.21ic.com/forum.php
Previous article:Section 6: The process of compiling .c source code into .hex machine code
Next article:Section 4: Introduction to platform software and compiler software
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- STMicroelectronics IO-Link Actuator Board Brings Turnkey Reference Design to Industrial Monitoring and Equipment Manufacturers
- Melexis uses coreless technology to reduce the size of current sensing devices
- [ART-Pi Review] 4: Networking to synchronize time and automatically connect to WiFi
- Classification and indicators of AD/DA
- 8-bit data latch 74HC573 application example
- IO port level conversion
- DSP C6000 Architecture
- How to choose various sensors and transmitters
- Analysis of the three most commonly used communication protocols in single-chip microcomputer systems
- Switching power supply PCB layout considerations
- The most complete power supply circuit diagram
- DSP external device connection interface EMIF