This article first introduced the online programming technology, then gave the design circuit based on two kinds of download lines, and finally elaborated the performance characteristics. Practice shows that this design has low cost and high flexibility. It has strong practical value for microcontroller enthusiasts, especially beginners. First, ISP technology In the practical application of the single-chip microcomputer, the system is often required to be able to run off-line, which requires that the user program code must be solidified into a non-volatile program memory. The process of solidifying user program code into program memory is called programming. Traditional programming of program memory is done by the programmer. The user needs to take the microcontroller off the target board and put it on the programmer. Then the program code is programmed into the program memory by programming software. This programming method is usually called Offline programming (also called off-line programming). However, with the continuous improvement of the chip manufacturing process, the patch type package has been rapidly developed, which makes it impossible for the MCU to be easily removed and placed on the programmer. At present, ISP technology is widely used. This programming method does not take the microcontroller off the target board. Instead, it can directly program the programmed code to the program memory through the relevant interface on the single-chip microcomputer. Is its UART interface, that is, the serial port: For AT89S51 microcontroller, it uses its SPI interface, different interface standards, involving the pin and the download circuit is also different. This article describes the ISP download circuit for the STC microcontroller. Second, serial ISP download line design STC single-chip microcomputer is a new generation, enhanced 51 single-chip microcomputer produced by Hongjing, with a faster operating speed and a wealth of on-chip resources, especially the series of SCM support ISP download, the user uses the STC microcontroller comes with the serial port (ie P3 .0 and P3.1 pins), and then with a simple peripheral circuit can be achieved in the system programming, and on-chip flash erased up to 100,000 times, fully able to meet user needs, the following figure is the serial ISP Download the line schematic. The circuit above uses only one MA×232 chip, four decoupling capacitors with a capacity of 104, and a 9-pin “D†connector. The MA×232 chip is used to convert between RS232 level and TTL level. And electrical isolation, 104 capacitor is mainly used to filter out high-frequency noise, "D" type connector is the physical interface of the microcontroller and computer for RS232 interface standard communication. In accordance with the above circuit after welding, and then to the company's Web site to download a free burning software (name is "STC MCU PC ISP download control software"), and finally with a standard RS-232 data cable to connect the target board and computer The online programming of the program code can be completed. Third, USB port ISP download line design With the development of computers, nowadays laptop computers and even some desktop computers are no longer equipped with RS232 interfaces and are replaced with USB interfaces. However, in some productions or devices, RS232 interfaces are still common, so it is necessary to design a USB-to-serial circuit. . At present, there are many dedicated chips for USB-to-serial conversion, and the overall cost, performance, and circuit simplicity are described. The author introduces the highly integrated USB-to-UART chip CP2102 produced by the US SILICon company. The chip complies with the USB specification 2.0, full speed 12Mbps, integrated on-chip USB transceiver, no external resistors, internal clock integration, no external oscillator, so its most important feature is all the circuits required for monolithic integrated converters. Separately implement interface conversion without using any separate components. The figure below shows the circuit schematic of the USB port ISP download line designed using the CP2102 chip. There are two points to note when making and using this circuit: First, the signal on the UART bus of the CP2101 is a TTL level that can be directly recognized by the microcontroller. If the target board is using an RS232 level, a TTL should be added after the circuit. Ping RS232 level circuit; Second, the CP2101 driver should be installed before using the circuit, the use of the method and the serial ISP download method is basically the same, will not repeat them here. IV. Conclusion With the development of programmable microprocessors in the direction of patch, ISP technology will surely gain attention and popularity. ISP technology not only saves the high cost of general-purpose programmers and adapters, but also reduces the hassle of frequent plugging and unplugging of MCUs, resulting in significant savings. The system development time, and meet the requirements of the user program online update, for microcontroller enthusiasts, especially beginners, has a strong practical value. Lithium Iron Battery,Lithium Battery Pack,48V Lithium Battery Pack,Lifepo4 12V Battery Shenzhen Unitronic Power System Co., Ltd , https://www.unitronicpower.com