当前位置:网站首页>51 single chip microcomputer learning notes (1)
51 single chip microcomputer learning notes (1)
2022-07-25 14:37:00 【The world is darker than pupils】
Programming environment ——KEIL Software installation
Premise : Get ready keil 4 Installation program and corresponding registration machine

- open C51V901.exe(Keil 4 Erection sequence )

* Click on Next

* Check I agree all the terms of···
* Click on Next

* Set the installation path , Select the installation directory according to your situation , Please click Browse Browse and select , It is recommended that the installation path do not contain Chinese , After setting the installation path, click Next

* Enter relevant information , Just type whatever you want , Click... After input Next

* Start installation , Wait for the installation to finish

* installation is complete , Click on Finish end
Activate keil 4
- Open the registration machine software KEIL_Lic.exe, The interface is as follows

* Open the newly installed from the desktop Keil 4 Software shortcut entry keil 4( Be careful , To run in administrator mode )

* Click on the top left corner File Menu selection Lincense Management, As shown in the figure below


- Copy CID Code to cutting board , Switch to the registration machine

* Get the registration code from the registration machine , Copy into License Management Below the interface New License ID Code in , And click the Add LIC, Software activation can be completed .
* The successful activation is shown below

* So far, the software has been installed . Next, you can learn and practice the program .
Engineering creation
- Open the installed editing environment Keil, Enter the following interface
!
* Click on the above Project Column selection New uVision Project Enter the following interface

* After selecting the project storage path , Enter project name ( Such as template), Click save , Enter the following interface

* choice Atmel And select AT89C51 Click on OK And select no in the subsequent pop-up window , As shown below



* Click to create a new file in the upper left corner as shown below


* Click the save button , Select the newly created project path , Name it led.c And save

- Click the following button , Enter the engineering document management interface


* Click on Add Files, Will just set up led.c Join the project , As shown below


* After adding successfully, you can view it under the project

Light up the first LED
- Keil 4 In order to C Language is the editing environment of code editing language , So its grammar is C As the standard . Edit the code as follows

#include "reg51.h" // It can also be written as #include <reg51.h> The function of this line is to introduce 51 SCM library file sbit LED = P2^0; // Define SCM pins (IO)P2^0 by LED, This pin is connected with a LED Connect , And it's time to LED One section has been connected to the positive pole
void main() // Define the main function , The program enters from here
{
while (1) // Definition while loop , Condition is 1, namely while It's been circulating
{
LED = 0; // Set up P2^0 The pin is low level , Forming loop ,LED Lighten up
}
}- Click the compile button , Check the code for errors

* If the code is OK , Set up to generate hex file ( Write the file format of MCU ), The operation is as follows


* After setting up , Recompile the side code as follows

Write the code into the MCU
- Premise Prepare to burn the software , Provided by MCU developers , The following takes Puzhong technology SCM as an example

thus , congratulations , Lit up the first LED, Opened their own SCM life
边栏推荐
- easygui使用的语法总结
- sudo rosdep init Error ROS安装问题解决方案
- CTS test introduction (how to introduce interface test in interview)
- The main function of component procurement system, digital procurement helps component enterprises develop rapidly
- Keys and scan based on redis delete keys with TTL -1
- C language and SQL Server database technology
- SSM framework integration, simple case
- Gateway reports an error service_ UNAVAILABLE
- The concept and operation rules of calculus of variations
- Thymeleaf setting disabled
猜你喜欢

阿里云安装MYSQL5.7

MySQL table operation

如何让一套代码完美适配各种屏幕?

Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%

直播课堂系统05-后台管理系统
![[eloquence] negotiation persuasion skills and Strategies](/img/01/0fcbbfcf35a6d166c14ba4215eacac.jpg)
[eloquence] negotiation persuasion skills and Strategies
![应用实践:Paddle分类模型大集成者[PaddleHub、Finetune、prompt]](/img/b6/62a346174bfa63fe352f9ef7596bfc.png)
应用实践:Paddle分类模型大集成者[PaddleHub、Finetune、prompt]

English grammar_ Indefinite pronoun - other / other

Why do China Construction and China Railway need this certificate? What is the reason?

Can the variable name be in Chinese? Directly fooled people
随机推荐
Niuke multi school E G J L
Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
直播课堂系统05-后台管理系统
LeetCode-198-打家劫舍
thymeleaf通过样式控制display是否显示
Development of uni app offline ID card identification plug-in based on paddleocr
云安全技术发展综述
06、类神经网络
Awk from entry to earth (24) extract the IP of the instruction network card
基于AMD EPYC服务器的EDA芯片设计解决方案
Go language founder leaves Google
How to make a set of code fit all kinds of screens perfectly?
各种平台dpkg包下载地址(包括arm64)
OverTheWire-Bandit
SSH服务器拒绝了密码
006操作符简介
Initial flask and simple application
Alibaba cloud installs mysql5.7
GameFramework制作游戏(二)制作UI界面
苹果官网产品打折 买iPhone 13 Pro Max 可省600元