当前位置:网站首页>[MCU] 51 MCU burning those things
[MCU] 51 MCU burning those things
2022-07-25 20:27:00 【Record the years of ignorance】
Pre tutorial
Preface
On a whim recently, I want to study 51 Single chip microcomputer installation system , So I bought one 51 The minimum system board of single chip microcomputer , As shown in the figure below .
I also bought one STC86C52, I plan to experiment with this single chip microcomputer . But unfortunately , First step —— There is a problem with the burning program , So I spent several hours searching for relevant information , Meanwhile, I also studied other models 51 Download mode of MCU .
51 There are several ways to download SCM ?
It is suggested to read this blog before reading :【 The embedded 】 A thorough understanding of MCU program burning
For this question , The most important thing is to distinguish models . First, let's talk about the older ATmel Of AT89S52, This type of single chip microcomputer adopts SPI agreement For program writing , That is, the one on the right in the above figure 10 One pin . Although it uses more pins than SPI many , But its essence is based on SPI agreement .
And for the still widely used STC Of 51 Single chip microcomputer , Usually download programs through serial port , It's using Bootstrap The way of burning . But there are two kinds , One is cold start , One is hot start .
STC89C52
First, Cold start , because STC SCM is based on serial port to download , And its internal boot program has been solidified , Every time you power on and reset , The system first executes the boot program , Check whether there are download instructions , without , Continue to execute the user program , If there is , Then update the program , The execution logic is shown in the figure below .【 The picture is from the official website manual 】
therefore , In actual use , Because the bootstrap executes too fast , You need to click the download button on the upper computer first , At this time, the upper computer began to transmit instructions to the MCU to download the program (0x7F), Then power on to start from the boot program , In this way, you can realize the cold start to download the program .
attach :STC What is the difference between cold start and reset of single chip microcomputer
however , What needs to be noted here is , General USB turn TTL Modules cannot be used to STC Of 51 SCM download program ! The circuit must be slightly modified , Refer to the official website manual , As shown in the figure below .
If it's general USB turn TTL The module will be connected only TXD,RXD,GND The chip will also have electricity ( because TXD and RXD All are 5V), This phenomenon is called Serial port leakage , This will cause the chip to remain in a state of power , Thus, it cannot be cold started . So generally speaking 51 The cold start burning circuits of single chip microcomputer have been arranged , It is estimated that no one will specially make one that only applies to STC MCU program burning USB turn TTL modular .
Find a tutorial , This download circuit and related theoretical knowledge are introduced in detail , It is suggested that those who want to draw their own board can look at it in combination with the official manual . attach : link
This cold start download procedure is a little complicated , Need to power on and power off repeatedly , Therefore, there is another download method that can realize hot start , That is, the program update operation can be completed without powering down , The principle of this implementation is STC There are registers in the single chip microcomputer, which can make the chip execute from the boot program . As shown in the figure below .

The specific practice of this method remains to be studied , Take a look at the following links
Latest test //2022.7.18
I tried again today STC89C52 Serial port download , It's easy to find out by accident ! When I wrote this blog before, I found that I usually bought it USB The module to serial port cannot be directly used to STC89C52 Download the program's , But I tried it today and found it was possible !, Although there will be serial port leakage , That is, the power indicator is half on , But it can be burned into the program ! Make a note of .
AT89S52
After that, the commonly used STC Single chip microcomputer , Let's talk about the older AT89S52. The burning mode of this type of MCU is based on SPI agreement , That's what it is 10 Pin interface . This kind of MCU needs to be bought USBisp perhaps USBasp equipment , As shown in the figure below .
The corresponding upper computer is ProgISP, Here is a software station Download link , It's still relatively clean . At present, there are mainly two versions circulating on the Internet :1.72 and 2.0, It is recommended to use 1.72 Version of , because 2.0 Version does not support USBasp. Open software , The interface is shown in the figure below .
First of all, pay attention to that program state, If Programmer inserted (USBasp or USBisp) And the one on the left PRG The icon of is colored , All is well , It shows that your current programmer can use , If it's gray , Then start troubleshooting , First determine Is the driver installed , because USBasp You need to install the driver , Personally, I don't recommend looking for someone else to download a good driver file , Then you use this to update the driver . A better solution is to use software Zadig, This software is very common , It is mainly used to install some USB The driver , Here is also a software station Download link , It's very clean .
If the driver has been installed but it is difficult to use , It is recommended to delete the device in the device manager first , Then install the drive . Start by opening Zadig, Then insert USBasp, You can find it in its list USBasp The option to , Then install the drive as shown in the figure below .
If there is no device in the list , You can click on option, choice List All Devices, As shown in the figure below .
After installing the drive , It can be restarted ProgISP try , See if that icon is still gray , If something goes wrong , That's basically a hardware problem , I have to buy another .
边栏推荐
- Application of conductive slip ring in mechanical equipment
- [today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued
- DIY personal server (DIY storage server)
- “链”接无限可能:数字资产链,精彩马上来!
- Redis source code -ziplist
- Cloud native guide: what is cloud native infrastructure
- test
- Increase swap space
- wallys//wifi6 wifi5 router IPQ6018 IPQ4019 IPQ4029 802.11ax 802.11ac
- Working principle of radar water level gauge and precautions for installation and maintenance
猜你喜欢

Mobile web layout method

Learn FPGA from the bottom structure (16) -- customization and testing of pll/mmcm IP

Difference Between Accuracy and Precision

Socket error Event: 32 Error: 10053. Connection closing...Socket close
![[leetcode] 28. Implement strstr ()](/img/87/0af2da458e53d31012d6535cc132bb.png)
[leetcode] 28. Implement strstr ()

【高等数学】【5】定积分及应用

"Share" devaxpress asp Net v22.1 latest version system environment configuration requirements

Advantages of network virtualization of various manufacturers

Kubernetes进阶部分学习笔记

10.< tag-动态规划和子序列, 子数组>lt.53. 最大子数组和 + lt.392. 判断子序列 dbc
随机推荐
[today in history] July 8: PostgreSQL release; SUSE acquires the largest service provider of k8s; Activision Blizzard merger
Kubernetes advanced part learning notes
Vivo official website app full model UI adaptation scheme
增加 swap 空间
智能电子界桩自然保护区远程监控解决方案
redis源码 -ziplist
[tensorrt] dynamic batch reasoning
[today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
TGA file format (waveform sound file format)
“链”接无限可能:数字资产链,精彩马上来!
Fanoutexchange switch code tutorial
Apache MINA框架「建议收藏」
Network RTK UAV test [easy to understand]
【ONNX】pytorch模型导出成ONNX格式:支持多参数与动态输入
什么是聚类分析?聚类分析方法的类别[通俗易懂]
谷歌Pixel 6a屏下指纹扫描仪存在重大安全漏洞
各厂商网络虚拟化的优势
【TensorRT】trtexec工具转engine
Cloud native guide: what is cloud native infrastructure
[onnx] export pytorch model to onnx format: support multi parameter and dynamic input