宋元浩

51 microcontroller offline download and programmer

 
Overview

Project description;

1: The most convenient thing about STC51 microcontroller is ISP download. Generally, CH340 is used to download and program. However, STC microcontroller needs to be powered off and cold-started during ISP programming to achieve successful programming. Sometimes, even if you perform power off, it may not be possible to program. Success, because the power of the target microcontroller circuit is not completely released. The most convenient way is to use CH340 and a self-locking switch to control the power on and off of the target board. When the self-locking switch is turned on, it can supply power to the target microcontroller, and the self-locking When disconnected, you can discharge it through a resistor of about 10, but this means that you have to use your hands to perform power-off download every time you burn, and you have to switch it on and off by hand every time you download, which feels very troublesome, so according to STC The company's open source schematic diagram was used to create this downloader. The cost is about 15 yuan. It is all open source. You are welcome to use it to develop STC51 microcontrollers. 51 is faith. It is easy to get started and there are many tutorials! 2: The functions of the circuit are described as follows. CH340E.png The above is a USB to serial port circuit, using CH340E. This chip has a built-in crystal oscillator. I like its small package. The M_RXD and M_TXD of the serial port are connected to P3.0 (pin 13) and P3.1 of IAP15F2K61S2 respectively. (14 feet). up-date.pngUP-DATE1 in the above circuit is used to download the master chip and continuously power the external circuit. LED1 is connected to P3.2 (pin 15) to indicate whether the download is successful. If the download is successful, the light will continue to flash. SPI memory.png The SPI protocol memory circuit above is used to store user programs for offline downloading. If the program is less than 47KB, you do not need this SPI memory. SS, MOSI, MISO, and SCLK are connected to pins 25, 24, 23, and 22 of the microcontroller respectively. foot. 3.png The circuit in red circle 1 is used to connect the RXD and TXD pins of the target microcontroller (i.e., the P3.0 and P3.1 pins of the target microcontroller) for programming. M_TXD2 and M_RXD2 are connected to P1.1 and P1.0 of the microcontroller respectively. foot. The circuit in red circle 2 is used to control the power supply and power off of the target microcontroller. When SVCC_E is at a level, it supplies power to the target microcontroller. This is why the target microcontroller can be continuously powered by pressing the UP-DATE button, because when it is off, When the motherboard is out of power, SVCC_E is low-level and the P2 transistor is turned on to supply power to the target microcontroller. The function of R21 is to quickly discharge the remaining charge when the P2 transistor is cut off. The 3-digit offline download button in the red circle performs an offline download when the Download potential is low. IDC.png

The above is the output terminal circuit of the downloader. Pins 1 and 2 of the IDC female socket are grounded, and pins 3 and 5 are used to set the target where only P1.0 and P1.1 are good or only P3.2 and P3.3 are zero to download. When the microcontroller is set to zero potential, pins 4 and 6 are connected to the TXD and RXD of the target microcontroller respectively, which are used for program burning. Pins 7 and 8 are the power supply pins for the target microcontroller. The voltage here is generally about 5 volts during downloading. 9 Pins 10 and 10 are the input pins for external 5V power supply to the offline writer. You can only choose 1 from 2 for external power supply or USB power supply. Remember! ! !

It’s not difficult to make this based on the open source drawings. The most important thing is that Easy EDA is easy to find components. It’s really fun to use. The funniest thing is that it was sent out for proofing without a USB socket. The first version of the USB female socket is not packaged.png   The picture below shows the blank board and soldered components for the second proofing. Empty board.pngSoldered components picture.png

* 3. Describe the key points involved in the hardware and software parts of the work;

The problem I encountered with the hardware was that I replaced the P2 PNP transistor with a PMOS transistor, which resulted in the inability to create an offline programming master chip at first. I replaced the MOS transistor with a PNP transistor and could produce a programming master chip. , the LED used is very bright, so I changed the current limiting resistor to 47k, it is not difficult to solder the components. The two buttons 1 and 3 in the red circle are connected in parallel and are used to upgrade the motherboard and continuously supply power to the external target board. If you want to upgrade, you need to solder the upgrade pad on the back to be useful. Red circle 2 is the ISP output IDC female socket. IN-VCC is the external input to power the offline programmer. If USB power supply is used, external power supply cannot be used. OUT-VCC is the output terminal for offline programming to power the target board. , RXD is connected to the P3.0 pin of the target microcontroller, and TXD is connected to the P3.1 pin of the target microcontroller. P32 and P33 are used to set P3.2 and P3.3 to 0 voltage before downloading. Red circle 4 is the offline download button. STC offline downloader function introduction 1.pngSTC offline downloader function introduction 2.png

The red circle is the resistance pad. The resistance pad can be connected with a resistor or directly soldered for upgrade. It must be soldered after the upgrade. Upgrade resistor.png Powerful STC-ISP software! STC-ISP.png Make an offline programming master chip and follow steps 2, 3, and 4 to successfully create the programmer. If you have a welding upgrade pad, remember to use a soldering iron to open it, otherwise it will keep detecting that the microcontroller cannot be programmed, and then you can Happy to develop STC51 microcontroller. Step 1-Open STC-ISP software.png3 steps-STC offline downloader firmware burning interface.png4 steps-STC offline downloader master film burning success interface.png After offline downloading, you can press the UP-DATE button to continue powering the target board. There is a button on the front and back for easy operation. Press the button in the red circle to continuously power the target board.png

Hahaha, the video is here! https://v.youku.com/v_show/id_XNDI5OTAyNDIyMA==.html?spm=a2hzp.8244740.0.0

https://lceda.cn/editor#id=|485ae38237634e9d9bfb53482317a4f7|68ca1f7535c74c06bcf49e2a0d2824ec are all open source.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-20 03:32:20

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号