A simple and practical STC89C52RC programmer design

1 Introduction

STC (Chengjing Technology) company launched STC 89C/S 51XX/52XX series of single-chip microcomputers, which have the advantages of low price, unresolvable, low power consumption, high speed, high reliability, strong anti-static, strong anti-interference, etc. Compatible with traditional 8051 microcontrollers, the on-chip resources are very rich, and both have built-in flash memory that can be repeatedly erased and written, and provide ISP (In-System Programming) programming mode. The STC89C52RC is a typical representative of the STC 89C/S51XX/52XX series of single-piece machines. It features 8K bytes of programmable flash memory, 1000 write/erase cycle life, 10 years of data retention time, and 3 levels of program memory lock. 512 Internal RAM, 32 Programmable I/O Lines, Two 16-Bit Timer/Counters, Five Interrupt Sources, Programmable Serial Channel, Low-Power Idle and Power-Down Mode, and On-Chip Oscillator and Clock Circuitry Wait. Therefore, this powerful and ultra-high cost performance single-chip microcomputer is widely used in China.

ISP online programming is a technology that completely overturns the traditional programming mode. It does not damage the pins of the chip, and the download speed is fast, which shortens the design time, reduces the development cost, accelerates the market launch, and greatly improves the product. Work efficiency. The general programmer adopts the main control chip such as PL2303, CP2102, FT232, etc., but the cost is high, and some chips have poor stability. Very few chip firmware versions have bugs. In view of this, this paper proposes the domestic CH340T chip as The design of the main ISP programmer is repeatedly tested by STC89C52RC and other functions, and the function is stable and the performance is excellent.

2 system hardware design

2.1 Overall structure of the system

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 modules such as the MCU and the CH340T, and converting the USB serial data from the computer to the serial port data through the CH340T and communicating with the MCU, providing a data channel for the MCU programming.

Overall structure of the system

2.2 Core Chip CH340T Introduction

CH340T is an interface conversion and single-chip peripheral chip designed and manufactured by Nanjing Yuheng Electronics Co., Ltd. It supports USB2.0. It can realize functions such as USB to serial port, extended computer asynchronous serial port and USB to IrDA infrared. This design is only used for USB to serial port. The converted serial port is full-duplex serial port, built-in receiving and sending buffer, supporting communication baud rate from 50bps to 2Mbps, sending allowable baud rate error "0.3%, receiving allowable baud The rate error is 2%. The method of use is relatively simple, and the peripheral components only need crystals, resistors and capacitors.

The CH340T has 20 standard pin interfaces. There are mainly 1, UD+ and UD- pins, which have built-in USB pull-up resistors that can be directly connected to the USB bus. 2. GND and VCC, ground and power pins, support 5V or 3.3V supply voltage. 3. Data transmission pins TXD and RXD are the serial data transmission and reception pins respectively. When the input is idle, the general RXD is high. However, if the R232 pin is high and the auxiliary RS232 function is enabled, an inverter is automatically inserted into the RXD pin, and the default is low. When the output is idle, Generally TXD is high. 4. Other pins. Includes MODEM contact signal pins and auxiliary pins.

2.3 System schematic

The schematic is shown in Figure 2.

Schematic

In the figure, the USB interface P1 is used for power transmission. It is also regulated by the LM7805 to supply power to the CH340T chip and the microcontroller and other components. When using the 5V operating voltage, the VCC pin of the CH340 chip is input to the external 5V power supply, and the V3 is referenced. The pin should be connected to a power supply decoupling capacitor with a capacity of 4700pF or 0.01uF. The CH340T adapter chip converts UD1+ and UD1- into serial port signal serial data and microcontroller serial port for communication. It should be noted that the serial receiving port CRXD of the CH340T chip needs to be connected to the P3.1 transistor Q1 of the MCU through the PNP transistor Q1 to form the emitter generator to achieve the buffering and isolation of the data.

The MCU subsystem uses a 40-pin test socket. For normal programming, the external MCU reset circuit and crystal oscillator circuit are externally connected. In particular, in order to improve the applicability of the programmer, the crystal oscillator circuit uses the jumper switch J1 to provide two operating frequencies of 12MHz and 11.0592M for the microcontroller.

3 system test

The software involved in ISP programming mainly consists of three parts: USB driver, microcontroller firmware program and computer application. The MCU firmware program is used to implement the computer to read and program the E2PROM (data flash) inside the STC MCU, which has been solidified in the MCU.

Before testing, you must first install the USB driver software USB DriverInstaller.exe, which can map the programming of the USB interface of the access computer to a virtual serial port, usually COM3 or COM4. Then install the STC MCU online programming software STC-ISP.STC -ISP is software designed for STC series microcontrollers. It can download STC microcontrollers such as STC89 series, 12C2052 series and 12C5410 series. It is powerful and easy to use. This programmer requires a version above V3.0.

The test procedure is to insert the microcontroller STC89C52RC into the programmer socket and insert it into the computer USB interface (or connect the programmer to the computer with a USB cable). Then open the STC-ISP software, select the MCU MCU model (MCUTYPE) in the main interface, import the Hex file (Open File), and select the serial port (COM:

COM3 or COM4, ​​etc.) and baud rate, and finally click the download button. The main interface of the successful download is shown in Figure 3.

Download the successful main interface diagram

After repeated tests on the programmer designed by this scheme, the function is normal and the performance is reliable.

4 Conclusion

This article describes a simple, practical, and inexpensive ISP programmer design. After repeated testing, the programmer designed by this scheme has the advantages of stable function, fast speed, low price and easy to use, and is suitable for program burning of STC 89C/S51XX/52XX series single-chip microcomputers. In addition, the system has better scalability, and the schematic diagram is slightly modified. By means of the SPI interface, the ISP programming download of more single-chip microcomputers such as Atmega8515/Atmega162 (AVR chip) is realized.

The Glass heater is made out of tempered glass and features and LCD touch screen panel with a remote control so you can visibly see and adjust your Glass Panel heater. This Glass panel heaters can be easily mounted to the wall or be freestanding on its own if you don`t feel like hanging it up.

We have White Glass Panel Heater and Black Glass Panel Heater .

Function: mechanical, Digital or Wifi.

Welcome to OEM

Professional Wall Mounted Glass Panel Heater manufacturer is located in China, including Glass Panel Heaters Wall Mounted,Glass Wall Heater, Glass Panel Heater, etc.

Glass Panel Heater

Wall Mounted Glass Panel Heater,Glass Panel Heaters Wall Mounted,Glass Wall Heater,Mistral Glass Panel Heater

Fenry manufacturing Co., Ltd , https://www.cnfenry.com