1 Introduction
STC (Hongjing Technology) Company launched STC 89C/S 51XX/52XX series of single-chip microcomputers, which have the advantages of low price, undecryptable, low power consumption, high speed, high reliability, strong anti-static, strong anti-interference, etc. Its instruction code is fully compatible with the traditional 8051 single-chip microcomputer, and the on-chip resources are very rich. They all have built-in rewritable Flash memory and provide ISP (In-System Programming) programming mode. As a typical representative of the STC 89C/S51XX/52XX series of single-chip microcomputers, STC89C52RC has the following features: 8K bytes of programmable flash memory, 1000 write/erase cycle life, 10 years of data retention time, three-level program memory lock, 512 internal RAM, 32 programmable I/O lines, two 16-bit timers/counters, 5 interrupt sources, programmable serial channels, low-power idle and power-down modes, and on-chip oscillators and clock circuits. Therefore, this powerful and highly cost-effective single-chip microcomputer is widely used in China.
ISP online programming is a technology that completely subverts the traditional programming mode. It will not damage the pins of the chip, and the download speed is very fast, thus shortening the design time, reducing R&D costs, accelerating the launch of products, and greatly improving work efficiency. The general programmer adopts the method of using PL2303, CP2102, FT232 and other main control chips, but the cost is often high, and some chips are not stable, and very few chip firmware versions have bugs. In view of this, this paper proposes a design scheme of ISP programmer based on domestic CH340T chip. After repeated testing of STC89C52RC and other chips, the function is stable and the performance is excellent.
2 System Hardware Design
2.1 System overall structure diagram
The overall structure of the system is shown in Figure 1. The USB power supply and data transmission module is mainly responsible for powering the microcontroller and CH340T and other modules, and converting the USB serial data from the computer into serial port data through CH340T and communicating with the microcontroller, providing a data channel for microcontroller programming.
2.2 Introduction to the core chip CH340T
CH340T is an interface conversion and microcontroller peripheral chip designed and produced by Nanjing Qinheng Electronics Co., Ltd. It supports USB2.0. It can realize functions such as USB to serial port, expansion of computer asynchronous serial port and USB to IrDA infrared. This design is only used for USB to serial port. The converted serial port is a full-duplex serial port with built-in receiving and sending buffers. It supports communication baud rates from 50bps to 2Mbps, and the allowable baud rate error for sending is less than 0.3%, and the allowable baud rate error for receiving is less than 2%. Its use is relatively simple, and the peripheral components only require crystals, resistors and capacitors.
CH340T has 20 standard pin interfaces. The main ones are 1. UD+ and UD- pins, which have built-in USB pull-up resistors and can be directly connected to the USB bus. 2. GND and VCC, namely ground and power pins, support 5V or 3.3V power supply voltage. 3. Data transmission pins TXD and RXD, which are serial port data sending and receiving pins respectively. When the input is idle, RXD is generally high level, but if the R232 pin is high level and the auxiliary RS232 function is enabled, an inverter will be automatically inserted into the RXD pin, and it will become low level by default; when the output is idle, TXD is generally high level. 4. Other pins. Including MODEM contact signal pins and auxiliary pins.
2.3 System Schematic Diagram
The schematic diagram is shown in Figure 2.
In the figure, in addition to data transmission, USB interface P1 also powers the CH340T chip, microcontroller and other components after voltage stabilization by LM7805. When using 5V working voltage, the VCC pin of the CH340 chip inputs an external 5V power supply, and the V3 pin should be connected to a power decoupling capacitor with a capacity of 4700pF or 0.01uF. The CH340T adapter chip converts UD1+ and UD1- into serial port signals and serial port data to communicate with the microcontroller serial port. It should be noted that the serial receiving port CRXD of the CH340T chip needs to be connected to the P3.1 (serial output port TXD) of the microcontroller through the PNP transistor Q1 in the form of an emitter generator to achieve the buffering and isolation of the data.
The MCU subsystem uses a 40-pin test socket. For normal programming, the necessary MCU reset circuit and crystal oscillator circuit are connected externally. In particular, in order to improve the applicability of the programmer, the crystal oscillator circuit uses jumper switch J1 to provide 2 operating frequencies for the MCU: 12MHz and 11.0592M.
3 System Testing
The software involved in ISP programming mainly consists of three parts: USB driver, MCU firmware program and computer application program. The MCU firmware program is used to enable the computer to read and program the E2PROM (data Flash) inside the STC MCU, which has been solidified in the MCU in advance.
Before testing, you must first install the USB driver software USB DriverInstaller.exe, which can map the programming connected to the computer USB interface to a virtual serial port, usually COM3 or COM4. Then install the STC microcontroller online programming and burning software STC-ISP. STC-ISP is designed for STC series microcontrollers. It can download STC89 series, 12C2052 series and 12C5410 series STC microcontrollers. It is powerful and easy to use. This programmer requires a version above V3.0.
The test steps are: insert the STC89C52RC microcontroller into the programmer socket, and then insert the whole into the computer USB port (or connect the programmer and the computer with a USB cable). Then open the STC-ISP software, select the MCU microcontroller model (MCUTYPE) in the main interface, import the Hex file (Open File/Open File), select the serial port (COM:
COM3 or COM4, etc.) and baud rate, and finally click the Download button. The main interface after successful download is shown in Figure 3.
After repeated tests, the programmer designed in this solution has normal functions and reliable performance.
4 Conclusion
This article introduces a simple, practical and low-cost ISP programmer design. After repeated tests, the programmer designed in this scheme has the advantages of stable function, fast speed, low price and easy use, which is suitable for programming STC 89C/S51XX/52XX series microcontrollers. In addition, this system has good scalability. With a slight change in the schematic diagram, the ISP programming download of more microcontrollers such as Atmega8515/Atmega162 (AVR chip) can be realized with the help of SPI interface.
Previous article:Say goodbye to annoying power cords: Can wireless mobile power become popular?
Next article:Design of digital control constant current source circuit based on single chip microcomputer
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- EEWORLD University Hall----Computer Organization and Design: RISC-V (Zhejiang University)
- TMS320F28335 ADC Explanation
- The domestic operating system RT-Thread seems to be more powerful and can enter the automotive field
- Use of resolver decoding chip AD2S1200
- GaN goes mobile?
- Is there any MEMS or sensor expert?
- Leakage current and withstand voltage test of low voltage battery products
- MSP430 Registers
- BMS insulation detection circuit
- i.MX6ULL Embedded Linux Development 1-Preliminary Study on Uboot Transplantation