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.
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:
Next, prepare the components as required in the above figure.
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.
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? :
Here’s the reverse side, it’s a bit horrible!
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.
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:
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:
Its supporting PC download software ISP-30A cannot set the parallel port pin number by itself. The interface is as shown below.
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)
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:
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.
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.
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
Run PROGISP1.6.6
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:
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.
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!
Previous article:Mega16 MCU scientific calculator program source code
Next article:AVR microcontroller and its features
- Popular Resources
- Popular amplifiers
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
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications