The programmer communicates with the PC host computer through the USB interface. Users only need to perform simple operations on the PC host computer GUI to erase, program, verify and encrypt STC 89C/S51XX/52XX series microcontrollers. After repeated tests on STC89C52RC and other microcontrollers, the programmer has the advantages of stable function, fast speed, low price and easy use.
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, which shortens the design time, reduces the R&D cost, accelerates the product launch, and greatly improves 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 < 0.3%, and the allowable baud rate error for receiving is < 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. [page]
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 of the USB interface connected to the computer 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 article has normal functions and reliable performance.
4 Conclusion
This article introduces a simple, practical and low-cost ISP programmer. This programmer has the advantages of stable function, fast speed, low price and easy use, and 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, it can realize ISP programming download for more microcontrollers such as Atmega8515/Atmega162 (AVR chip) with the help of SPI interface.
Previous article:Design of work and rest alarm controller
Next article:Research on the design of external data storage expansion based on MCS-8051 single chip microcomputer
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Another TWS earphone charging box disassembly
- The official ST Chinese forum is now online. Let’s go and have a look.
- Qorvo Launches High-Performance BAW Filters to Support Band 41 5G Base Station Deployment
- It’s dangerous to make phone calls at a gas station, so is it safe to pay by scanning a QR code with your mobile phone?
- MSP430 MCU's own hardware SPI communication
- Is this description correct for the three working conditions of a transistor? To achieve these conditions, how should the peripheral circuit...
- Microstrip transmission line impedance matching engineering example
- 5-minute quick talk - Nichicon small lithium-ion rechargeable battery
- Biological test paper discharge current peak detection circuit
- What methods can be used to generate a ±0.2V rectangular wave?