Detailed tutorial on making a single-chip USB-ISP download line

Publisher:熙风细雨Latest update time:2020-02-03 Source: elecfansKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Nowadays, laptops and desktops are gradually abandoning parallel and serial ports; many netizens also told me that desktops no longer have parallel ports and download cables cannot be used, and asked me to help them think of a solution. It seems that making a USB-ISP download cable is inevitable.


After searching online, I found two main solutions. One is to use FT245 serial port chip plus ATMEGA8, and the other is to use only ATMEGA8 to complete the software simulation of USB serial port protocol and ISP download. It is said that the first method is stable, but the cost is high, the circuit is complicated, and it is not convenient to make it yourself. We still follow the principle of low cost and simple and easy to make. Just use a single M8 to do it.


OK! No more nonsense, let's get to work. I searched the Internet and found a diagram that has few bugs and is easy to make.

Detailed tutorial on making a single-chip USB-ISP download line

Before making it, you must first clarify a few points. First, this USB download cable itself is an AVR microcontroller. After it is made, you must first download the program to it through other parallel or serial port ISP download cables, so that it can work. Second, you must first have a general understanding of the basic information of this AVR stand-alone machine M8. Only in this way can you have an understanding of the circuit, which is convenient for debugging. Therefore, the parallel port ISP download cable you originally used still plays a key role here, so don't throw it away! I will illustrate this process first:

Detailed tutorial on making a single-chip USB-ISP download line

Next, prepare the components as required in the above figure.

Detailed tutorial on making a single-chip USB-ISP download line

After the components are prepared, you must first check the quality, the resistance of the resistor, the polarity of the light-emitting tube, and whether the capacitor is short-circuited. Test whether the voltage regulation values ​​of the two voltage regulators are correct. The most important thing is to first connect the USB interface to the PC with an extension cable, and then use a multimeter to measure where the positive pole is and make a mark. This way you can figure out the position of D+ and D-, and you won't connect the power supply in reverse. This is to avoid repeatedly soldering with the wrong polarity after soldering. The soldering pad will easily fall off, and it also avoids connecting the components in reverse and burning them. (I started using a male USB interface, but later found that it didn't work on the board and would likely come loose with a little force. So I changed to a female interface)


I sorted out the circuit diagram because some components are not needed and some are for easier inspection to avoid missing any connections.

Detailed tutorial on making a single-chip USB-ISP download line

There is nothing much to say about the soldering process. It is not a PCB board, but a perforated board. Make a rough layout in advance (the layout principle is to shorten the lead length and use as few jumpers as possible. It seems that I made quite a few jumpers!) Then solder according to the circuit diagram above. After completion, it looks like the following figure. Does it look good? :

Detailed tutorial on making a single-chip USB-ISP download line

Detailed tutorial on making a single-chip USB-ISP download line

Here’s the reverse side, it’s a bit horrible!

Detailed tutorial on making a single-chip USB-ISP download line

Before debugging, you need to clarify a few issues:

First, the power supply issue: the original parallel download line is powered by the S51 board, that is to say, when you solder your USB-ISP board and install the firmware on it, the USB-ISP board must supply power to the original parallel download line, and after the firmware is installed, the USB-ISP board relies on the PC's USB port to supply power to our USB-IS board, and your future 51 experimental board cannot supply power to this USB-ISP board, otherwise the PC and the 51 experimental board will both supply power to the USB-ISP, and the different voltages may burn the PC port or components. Therefore, the J2 jumper is used to distinguish between installing firmware and normal downloading. When installing firmware, add an additional power supply to the USB-ISP, short-circuit J2, and power can be supplied to the original parallel download line through the J2 port. When in normal use, the additional power supply on the USB-ISP board is removed, and the power is supplied by the PC's USB port. Disconnect J2 to isolate the power supply of the USB-ISP board and the 51 board.

Detailed tutorial on making a single-chip USB-ISP download line

J1 is a speed reduction jumper, which slows down when shorted. It is required to be at a slow speed when installing the firmware. J3 is an M8 reset jumper, which requires M8 to be in reset state when installing the firmware. These three jumpers are disconnected during normal use.


Second, the ISP interface problem: you need to understand the corresponding wiring of the download interface. MOSI, MISO, RST, and SCK must correspond to each other and cannot be mistaken. In other words, the parallel port function lines of your original parallel port download cable must be connected to the ten-pin ISP interface and the interface of the USB-ISP download cable. For example, my 51 board is made by myself, and the ten-pin download interface on it is connected by me at will without following any standards. Therefore, when I made the parallel port download cable, I matched the function lines on the parallel port download cable with those on the 51 board one by one, so that it can be debugged. Now it is the same when making a USB-ISP download cable. It must be done according to my own ten-pin interface method. As long as the function lines are accurately matched, it will be fine.


J1 is a speed reduction jumper, which slows down when shorted. It is required to be at a slow speed when installing the firmware. J3 is an M8 reset jumper, which requires M8 to be in reset state when installing the firmware. These three jumpers are disconnected during normal use.


Different PC download software has different definitions of parallel port pins. You must make sure to understand this, otherwise it will be impossible to download normally. Some software has configuration files that can set the function of a certain pin of the parallel port according to your requirements. For example, ISPLAY 1.5. Its configuration file is as follows:

Detailed tutorial on making a single-chip USB-ISP download line

You can modify the parallel port pin numbers of MOSI, MISO, SCK, RST, OE, LE and other function outputs to adapt to your download line.


My original parallel port download cable used an official picture:

Detailed tutorial on making a single-chip USB-ISP download line

Its supporting PC download software ISP-30A cannot set the parallel port pin number by itself. The interface is as shown below.

Detailed tutorial on making a single-chip USB-ISP download line

OK! Now start debugging and check if the USB-ISP download board is connected incorrectly or short-circuited. Short the three jumpers of the USB-ISP download board, connect an external power supply, and measure the current to be 6mA, which should be fine. Connect the parallel port end of the original parallel download cable to the PC, connect the ten-pin ISP interface end to the USB download board, and measure the voltage on the parallel port board to be normal. As shown in the figure below: (This is a schematic diagram because the light is not good when the PC is plugged in the house, so it is not clear)

Detailed tutorial on making a single-chip USB-ISP download line

At this time, the LED on the USB download board will not light up, because there is no program in it and it cannot run. Start downloading. Run ISPLAY1.5 on the PC as shown in the figure:

Detailed tutorial on making a single-chip USB-ISP download line

I have modified the function lines in the configuration file Pin_config.ini to the same pin numbers as my parallel port download line. I selected the configuration file in the "Program Settings" in the lower left corner. I clicked the "Detect Device" button, but the device was still not detected, as shown above. I think my parallel port download line must be good, I have been using it all the time! Could it be that the configuration file does not work? Or the LE control timing is different from the requirements of my board? I might as well try the ISP-30A that I have been using! So I ran it. Because I want to download the program to ATMEGA8, I selected MEGA8 in the device option.

Detailed tutorial on making a single-chip USB-ISP download line

Sure enough, I clicked Read and it was able to read normally, so I clicked Open file and selected the 11K main.hex file downloaded from the Internet, clicked Write, and then wrote the program and verified that everything was OK. Then clicked Fuse Bytes and checked SUT0 and CKSEL0 in the figure below.

Detailed tutorial on making a single-chip USB-ISP download line

Then return to the main interface and click Write LBs. After writing, I pulled out the three jumpers, and the green LED was on, indicating that the M8 program was running. In this way, the firmware of my USB download board was installed.

I unplugged the USB download board from the parallel port downloader, removed the additional power supply and plugged it into the USB port of the PC. It immediately found the new USB device. Everything went smoothly. The driver installation went smoothly all the way (this part of the software usage has been written in detail online, so I won’t repeat it). The PC told me that the device was ready to use. I connected my 51 board and the USB download cable to

Detailed tutorial on making a single-chip USB-ISP download line

Run PROGISP1.6.6

Detailed tutorial on making a single-chip USB-ISP download line

After a burst of ecstasy, I selected USBASP in the selection box under "Programmer and Interface" and AT89S51 in "Select Chip".


Click the RD button on the right side of "Chip Identification Word", oh! But the device cannot be detected as shown below:

Detailed tutorial on making a single-chip USB-ISP download line

This window pops up, indicating that the USB download cable is normal, but the 51 target board cannot be detected. Is it because the ISP cable is too long? I made another ISP cable with only 10CM, but the problem remains.


Suddenly I remembered that there was a post on the Internet saying that a modified firmware could solve the Chip Enable Program Error on the 51 board. I immediately went online to find the 18K USBISP.hex file and redid the download. Everything went well. Then I ran PROGISP1.6.6.


Haha! 51 devices have been detected.

Detailed tutorial on making a single-chip USB-ISP download line

The signature word does not match, so just ignore it and click "Yes". Then try to click the "Read Flash" button. Success!

Then I clicked "Load Flash" and selected a previous HEX file of mine, clicked the automatic button below, and the red light-emitting tube kept flashing. I was so happy!


However, it always fails when I check it after writing it, haha!

[1] [2]
Keywords:MCU Reference address:Detailed tutorial on making a single-chip USB-ISP download line

Previous article:Mega16 MCU scientific calculator program source code
Next article:AVR microcontroller and its features

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components
Guess you like

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号