51 MCU programming process and detailed description

Publisher:美人如玉剑如虹Latest update time:2013-01-30 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Step 1: Install Keil software

1. Select the C51V900 installation program in the folder and open it, as shown in the figure:

1.jpg

2. Keep selecting Next in the installation dialog box until Finish completes the Keil installation.

Step 2: Install the USB to Serial Cable Driver

1. Select and open the HL-340 installer in the folder

2.jpg

2. Click INSTALL to automatically complete the installation

3.jpg

Step 3: Create a Keil project

1. Open the Keil icon on the desktop 1.jpgand create a new project. Click [New μVision Project] in the [Project] menu, as shown below:

4.jpg

2. Select the location to save the project. It is recommended to create a new folder to save the project file for easy management in the future.

5.jpg

3. Select the microcontroller model: Open the Atmel 1.jpgdirectory, select AT89C52 in the subdirectory, click OK, and select No (N) in the new dialog box that pops up.

6.jpg

7.jpg

4. Click the [New] menu item in the [File] menu, or press Ctrl+N to create a new file Text1 8.jpg, click the icon in the toolbar 9.jpgor press Ctrl+S, enter the file name in the pop-up save dialog box, and note that you must add ".c" after the file name as the saved file type (for example, shuangshuangbang.c), and then save. [page]

10.jpg

5. Return to the editing interface, click the "+" sign in front of [Target], and then right-click on the [Source Group 1] option to pop up the menu shown in the figure below. Then select the [Add Files to Group 'Source Group1'] menu item, as shown below:

11.jpg

6. In the pop-up dialog box, select the "XXX.c" file you just saved and click [Add], then click [Close], as shown in the figure:

12.jpg

7. Click the "+" sign in front of [Source Group 1] on the left. You can notice that there is an additional sub-item [XXX.c] in the [Source Group 1] folder. The source code file is now associated with the project. Copy Viagra's code from the "XXX.c" code editing window on the right, as shown in the figure:

13.jpg

8. Click [Target Options…] on the toolbar, open the Output tab and select [Create Hex File], click [OK]. Only after the compilation is completed will a Hex file that can be downloaded to the microcontroller be generated, as shown below:

14.jpg[page]

8. Click [Rebuild] on the toolbar, and you can see the status displayed in the status bar (0 errors and 0 warnings). At this time, the establishment of the Keil project is completed and a Hex file that can be downloaded to the microcontroller is generated, as shown below:

Step 4: Query the COM port

1. Use a USB to serial port cable to connect the computer's USB port to the microcontroller's serial port;

2. Right-click "My Computer" and click "Manage". In the pop-up window, select "Device Manager". Click "Port" on the right to see the COM port of the USB-to-serial cable (COM3 port in the figure). Remember that the COM port is displayed, which will be used when downloading the program, as shown in the figure below:

17.jpg

Step 5: Download the Hex file

1. Open the "Program Download" compressed package in the folder and open the STC_ISP_V481.exe program inside, as shown in the figure:

1.jpg

2. In the pop-up interface, select MCU Type as STC89C52RC, click [Open Program File], find the file with the ".hex" suffix in the location where you saved the Keil project before, and choose to open it. Select "COM" as the COM port displayed in Step 4 (my computer shows COM3, so I chose COM3, but different computers may be different, so be sure to choose according to your own computer), as shown below:

18.jpg

2. Finally, click [Download] (before clicking [Download], the MCU must not be powered on), and then press the power switch of the MCU to power on the MCU. At this time, the program will start to download to the MCU. The following figure shows that the program has been successfully burned into the MCU. You only need to install the MCU with the program burned into the Shuangshuang stick:

19.jpg

Reference address:51 MCU programming process and detailed description

Previous article:Electric vehicle wireless remote control system based on AT89C51 single chip microcomputer
Next article:51 MCU burning detailed whole process

Recommended ReadingLatest update time:2024-11-16 15:26

51 MCU timing alarm clock simulation program
The simulation schematic is as follows Basic functions of timer alarm 1. Basic functions of the timer alarm:          Use a 3-digit seven-segment display to show the timer and remaining time (in seconds)          There are 3 buttons to set the timing time:          Operation key K1: Start timing (default is 60 second
[Microcontroller]
51 MCU timing alarm clock simulation program
89c51 microcontroller minimum system, detailed function explanation of 89c51 minimum system schematic diagram
  The minimum system of a single-chip microcomputer is composed of some components necessary to form a single-chip microcomputer system. In addition to the single-chip microcomputer, it also needs to include a power supply circuit, a clock circuit, and a reset circuit. Microcontroller minimum system circuit schematic
[Microcontroller]
89c51 microcontroller minimum system, detailed function explanation of 89c51 minimum system schematic diagram
[51 microcontroller] STC89C52 digital tube static display experiment, including c code (5)
1. Reference tutorial: Qingxiang 51 microcontroller tutorial 2. Basic principles: 1) Number of digital tubes: How many digital tubes are connected together? 2) Digital tube common level: common cathode - the line in the middle of the digital tube is GND. Common anode - the line in the middle of the digital tube is V
[Microcontroller]
[51 microcontroller] STC89C52 digital tube static display experiment, including c code (5)
51 MCU general assembly delay subroutine
: General delay subroutine : 7FEBH - FFEBH : Delay : The delay constant is placed in the R2 register. The delay time corresponding to the time constant N (hexadecimal) (6MZH crystal oscillator) is shown in the following table: : R2=0 : R2 : None Example: Delay 1 second subroutine MOV R2,#18H LC
[Microcontroller]
MCU Learning Notes 51 MCU Basics
In 1980, Intel withdrew the MCS-51 microcontroller. Now it has expanded to include IO ports, AD converters, PWM, WDT (watchdog), IIC, etc. MCS-51 has been discontinued. Compatible with MCS-51 are Atmel's AT89C5X, which is discontinued and does not support ISP download. It has been replaced by AT89S5X, which can be IS
[Microcontroller]
MCU Learning Notes 51 MCU Basics
51 MCU Learning Process "I" - Marquee
Learning microcontrollers requires writing a lot of code manually. Generally, the amount of code for just learning 51 microcontrollers will not be too much. You need to have a certain knowledge of C language, digital circuits and analog circuits. Instead of reading theoretical knowledge, it is better to write more and
[Microcontroller]
51 MCU Learning Process
51 MCU Simulation I2C Bus C Language Implementation
Circuit Schematic     The EEPROM is AT24C01A from ATMEL and the microcontroller is AT89C51 from ATMEL.   Software Description   The C language is Franklin C V3.2. Save the source program as testi2c.c and run the command C51testi2c.c L51TESTI2C.OBJ OHS51TESTI2C Compile and link to ge
[Microcontroller]
51 MCU Simulation I2C Bus C Language Implementation
51 MCU Tutorial from Scratch - MCU Timer/Counter Experiment
We have done the timer experiment before, now let’s take a look at the counting experiment. There are often two requirements for counting at work: first, to display the counted value, and second, to interrupt and alarm when the counted value reaches a certain level. The first type is various counters and od
[Microcontroller]
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号