STC microcontroller program burning and ISP download related knowledge

This article introduces you to the common serial USB, RS232, UART three conversion modules and their circuit schematics, single-chip ISP download and microcontroller program burning related content, device connection operation method.

As mentioned earlier, the MCU is equivalent to a microcomputer, so the MCU can execute the program. On the computer, we can download all kinds of games and various softwares on the Internet, but how can we let it execute the program when it is a chip that is not in the autumn? Don't worry, this will introduce you to relevant knowledge. There are some professional vocabulary involved here, but we don't understand it, but it doesn't have much impact. It's good to know about it. If you are interested, you can search online to find out. In addition, after learning the latter, many concepts will naturally understand.

1, serial port (RS232, UART)

Broadly speaking, the serial interface is referred to as the serial port, also known as the serial communication interface, and is an extended interface using serial communication. Our familiar USB interface, the full name of the Universal Serial Bus (Universal Serial BUS), is a serial port. The serial port also includes UART, RS232, RS422, RS485 and so on. Generally speaking, the serial port we refer to refers to the serial port such as RS232 and UART, which is often called COM interface.

Old-fashioned desktop computers and some notebooks have an RS232 serial port (RS232 refers to the RS232 level serial port). Later, due to the small number of serial ports, slower speed and larger size, they were gradually eliminated on notebooks and even desktops.

The 51 MCU has a UART serial port (UART = Universal Asynchronous Receiver/Transmitter, a universal asynchronous transceiver transmitter, which refers to a TTL level serial port).

The difference between UART and RS232 is mainly due to different level definitions. The UART is a TTL level, defining 3~5V as a high level, indicating "1", 0V is low, indicating "0", as before, and RS232 is a negative logic level, which defines +5 ~+12V is low, indicating "0", while -12~-5V is high, indicating "1".

The standard serial port refers to the RS232 serial port (also called COM interface). The figure is the standard serial port behind the desktop computer case.

2, download the program to the microcontroller

Some readers may have guessed that loading a microcontroller into a program is done through a computer and using a serial port. But unfortunately it is only half right.

Speaking a bit off topic, in order to feel "professional" point, do not say to the microcontroller "install the program" in the future, the professional point of the statement should be programming, or download the program. Readers are likely to wonder why it is called a programming program. Do you want to use a fire to bake a microcontroller when downloading a program? Of course not. This is like the road is called the road, it has a history, want to know the specific reasons, or wait for everyone to learn the microcontroller, understand the working principle of the early ROM and then go deeper.

Back to the topic, the way different microcontrollers write programs is different. When I first introduced the STC microcontroller, I mentioned one of its advantages: I can use the serial port to download the program, I don't know if the reader noticed it. The same is 51 single-chip, Atmel's products are divided into two types, one is the early 89Cxx system, this type of MCU download program, you need to take down the microcontroller, use a dedicated programmer to program, very troublesome; another This is the later launched 89Sxx series (ISP = In System Programming) that supports ISP. It only needs a few wires to connect to the MCU and downloader, so you can easily download the program.

3, ISP online programming

What is an ISP? ISP means online programming. Its function is that when downloading a program, the microcontroller does not need to be removed from the existing circuit. You may not realize the benefits of this, but its benefits are still very obvious. Let me give an example below.

One day you designed an appliance for your customer that was controlled by a microcontroller. Then many people have bought it, but after a while, you find that the program you wrote has a problem, or some places need to be optimized, but the product you sold, the program has been written inside. At this time, if the microcontroller you are using does not support ISP, you have to go to the customer one by one, remove their products, then remove the microcontroller, burn the program, and then install it back. If you design it improperly, the MCU is still soldered on the circuit, and it can't be taken, it is even worse.

But with an ISP it is different. You can design the product and leave the ISP interface. If there is a problem with the discovery program, you will send the written new program to the Internet, and then send a batch of emails to tell your customers to connect the computer to your product ISP interface with the download cable that comes with the product, and then install a download software. , download the new program, you can use it. You can even write in the manual, our product software is often updated, please go to the official website to download the latest software, this is just once and for all.

So a small improvement has brought about such a big change. To use the microcontroller, I choose ISP, which is affordable and easy to use.

The STC microcontroller not only supports ISP download, but also needs to be downloaded through the serial port and computer connection, which saves us the money to buy the programmer, it is inexpensive, suitable for us to use.

4, USB and serial port conversion module

Since the USB interface is different from the TTL serial port of the single chip microcomputer, it cannot be directly connected, and is generally connected by a conversion chip. A conversion chip connected to the USB interface requires a corresponding driver to be installed on the computer, and the driver is easily found on the Internet.

The conversion between USB, RS232, and UART has a chip that can be implemented, and it is easy to buy a good finished module. Several commonly used adapters are given below.

The first one is USB to TTL serial port. This is the most commonly used type of adapter. It is often called USB to TTL small board, USB-TTL adapter board, and the common conversion chip is PL2303. You need to install the corresponding driver on the computer. .

USB to RS232 serial port, common conversion chip is CH341, you need to install CH341 driver on the computer when you use it, you can search on Baidu

RS232 serial port to TTL serial port, level conversion chip is MAX232, if your computer has a serial port, you can directly use this adapter, and then connect the TTL serial port to the microcontroller, this does not require a driver.

There is also a USB-RS232 serial port-TTL serial adapter board that integrates three interface conversion functions, as shown in the figure. This feature is more powerful, but the electronics market may not be available.

Many of the finished MCU learning boards on the market provide USB interface, or RS232 serial port + USB interface. On the one hand, the USB interface is responsible for powering the microcontroller, on the other hand, USB to TTL, or RS232 to TTL has been integrated on the learning board.

5, the reference circuit diagram

The reference circuit schematics of these modules are provided by the way below, and do not need to be mastered. If you need to make these modules yourself, you can refer to these circuit diagrams.

MAX232 circuit diagram

Description: http://img.blog.163.com/photo/_d0RMrVlHYPDSDYCWyXoQQ==/5729704625922656662.jpg

PL2303 circuit diagram

USB-RS232 circuit diagram

6, 51 single-chip program programming

About the programmer download of AT89Cxx series MCU, and the ISP mode download program used by AT89Sxx series MCU, we will not introduce in detail. Here we mainly introduce the serial port download mode of STC MCU. When the STC MCU is programmed, the computer end is generally downloaded using the STC-ISP software dedicated to Macrochip. Its interface is as shown.

Let me talk a little bit about this. STC-ISP software is best to download the latest version on the official website of Hongjing. In the first run, there is often a situation similar to the one in the figure below, indicating that component XXX cannot be registered. For the Win7 system, you can first right click on the STC-ISP exe program file and select "Run as administrator" (if it is an XP system, you only need to log in to the computer as an administrator to run the program). If it still doesn't work, you need to download the prompt XXX.DLL or XXX.OCX file, put it in the C:\Windows\System32 folder, then run C:\Windows\System32\cmd.exe as administrator and enter regsvr32 C:\Windows\System32\xxx.dll Enter and register. Such a file is a system dynamic link library file, which is required for program execution, and is not available in some computers, or cannot be registered, so this happens.

If you have already purchased the USB to serial port module, you can install the corresponding driver and plug it into the USB port of the computer. If it is a finished learning board, use the power supply to the learning board, and then connect the download cable to the computer. If all goes well, we can right click on "My Computer" (XP system) or "Computer" (Win7 or higher system) on the computer, manage, open the device manager, you can see the corresponding serial port in the device manager. As shown.

I hope that this article is finished. Everyone installs the STC-ISP software on their own computer and installs the driver conditionally. The specific download method will be introduced later.

Touch screen for Omron

We are saleing Touch screen for Omron,provides the product information.
Touch screen for Omron are widely used for medical and industrial equipment, research shows, machinery equipment, industrial control, man-machine interface, industrial automation integrated workstation, POS, CNC etc. we have a lot of Touch screen for Omron, standing some of our inventory stock.

Touch Screen For Omron,Touch Screen For Omron Replacement,Touch Panel For Omron

GUANGZHOU VICPAS TOUCH TECHNOLOGY CO.,LTD , https://www.touchsuppliers.com