- After we keil software installation is successful, we started a new project trip.
- First, we create a new folder on the desktop, named 51 projects . Inside the new two folders named obj, main
- We double-click keil software. Click Project , select New uVision Project ........
- Then we found just the new 51 project folder for our new file named LED , and stored in 51 project folder inside the obj folder, click Save
- In the pop-up window find Atmel , click next to +
- We choose to learn AT89C52 , click the OK .
- In the next pop-up window, we have chosen is
- We press the shortcut Ctrl + N , . Ctrl + S to save the file in the new 51 projects inside the main folder inside, a name called led.c
- We click on the three colored small box , which pops up in the screen, click Add Files
- 找到我们刚才保存的led.c文件点击Add,添加进我们的工程
- 文件添加完成后,在文件里面输入下图代码
- 再点击一便下图三个按钮
- 下面出现提示0错误0警告
- 我们再点击小魔术棒按钮
- 选择output,将里面的Create HEX File勾选上点击OK即可。
- 我们在将刚才的三个按钮,在点击编译一遍。
- 我们接下来找到第一次上课文件夹,找到下图软件单击
- 我们选择一下单片机型号,在STC89C51系列里面选择STC89C52.
- 我们将单片机连接至电脑,并打开开发板开关。在串口号里面选择最长的那个,单击一下
- 我们接着点击打开程序文件,找到我们新建的C51工程里面的obj文件夹,点击打开。
- 点击下载程序,在将开发板开关关掉并打开,程序就下进去了
如果我写的文章帮助大家节省了时间,记得点个赞,如果想跟我一起学习知识,可以关注我一下