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.
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-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.
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.
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.
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 picture below shows the blank board and soldered components for the second proofing.
* 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.
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.
Powerful STC-ISP software!
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.
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.
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.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet