CH340 programmer problem

Hi!

I have a usb to serial converter based on a CH340G chip. Yesterday I used it to program an atmega 328p based homemade soldering station without any problems. Today, when I wanted to reprogram the chip, it gives me the following error:

avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x01 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x01 Problem uploading to board.

I have tried every thing that I could think of. Restarted the computer, tried it on another computer, tried to program another chip, tried to reinstall the drivers. I am running windows7 x64. And yes, I am able to see the device listed in device manager. I made sure that the port, board and processor are the correct ones selected.

Can somebody help me with this problem? Is the programmer ic the problem or am I doing something wrong?

Thanks in advance.

Do you have anything else connected to pins 0 or 1 on the Arduino, or anything that might be bringing down the power supply?

Was the last time you programmed it the first time the chip had been programmed?

If so, is the chip being correctly reset by DTR? (you need DTR pin connected to one side of a 0.1uf cap, other side to reset, and a 10k pullup on reset). If this isn’t wired up, opening serial connection won’t reset the '328, and hence the bootloader won’t run, and you can’t program it.

If that’s okay, check that your fuse settings are correct and reburn bootloader if they’re not.

I think it’s likely an issue with the '328p, not the CH340. It’s extremely unusual for a USB<->serial chip to fail such that the device detected, yet serial didn’t work.

No there isn't something connected to pin 0 and 1. The fuse settings are correct and I am able to program the ic using a genuine arduino board. The problem was the 0.1uF cap that, I forgot to mount. Why did it work the first time without the cap and just the pull up resistor, I don't know. But now it works. :D

Thanks again for your help.

djluck: No there isn't something connected to pin 0 and 1. The fuse settings are correct and I am able to program the ic using a genuine arduino board. The problem was the 0.1uF cap that, I forgot to mount. Why did it work the first time without the cap and just the pull up resistor, I don't know. But now it works. :D

Thanks again for your help.

Yup, not long before I posted that, I had the same thing happen to me. When nothing but the boot loader is in the flash, it just runs the bootloader continually.

i was getting the same errors until I connected the DTR pin, as suggested by DrAzzy above. (Yes, I'm a noob!)

However, I today received a cheap Chinese adapter (as a cheap spare) but it had no DTR on the pinout. A quick look on the 'net for the CH340G told me that pin 13 on the chip is DTR, so I soldered a flying lead onto that pin and now all is working fine.

If you have such an adapter which has six pins rather than 5, you will often find that the sixth pin labelled "RST" is uselessly connected to the actual "reset" pin on the CH340; the "counterfeit" adapter being laid out by some poor sod who clearly had absolutely no engineering knowledge, and mindlessly copied by other counterfeiters!

Of course, what you then need to do is to cut the trace from that interface pin and connect the pin instead to the pin 13 that you have identified. A piece of "Biceflux" transformer wire (solder fusible fluxing insulation) is perfect for the job.

Thanks, but I'm not sure I'm up to cutting traces I can barely see on a tiny PCB.

FYI, BOTH adapters have 6 pins. The one that has a DTR on the pinout, I got from ChilliTronix on eBay (I believe he is a member on this forum).

The other one, without DTR, doesn't have an RST pin either. It has GND, TXD, RXD, 3.3V, 5V, AND VCC. (But it was only 99p, incl. postage from China)

Anyway, I know it's a kludge, but I've got it working with the DTR on a flying lead, so no worries.

Brian_R: The other one, without DTR, doesn't have an RST pin either. It has GND, TXD, RXD, 3.3V, 5V, AND VCC. (But it was only 99p, incl. postage from China)

Anyway, I know it's a kludge, but I've got it working with the DTR on a flying lead, so no worries.

Yup - I use these all the time.

They're meant to have jumper between Vcc and 3.3 or 5v. I clip off the pin I don't want completely. and clip the other one off most of the way, just long enough that I can bend it and touch the Vcc pin where the 90-degree bend is. I solder that in place. Then get on the chip's DTR pin, and run the whole lot into a 6-position 0.1" connector. Badaboom.

I have had much better luck with those than FTDI adapters. Last night all FTDI adapters (which were working the night before) no longer work on my computer. No idea why - it says it doesn't have drivers, no matter how many times I reinstall them. But the ch340g's just keep on going.

DrAzzy: I have had much better luck with those than FTDI adapters. Last night all FTDI adapters (which were working the night before) no longer work on my computer. No idea why - it says it doesn't have drivers, no matter how many times I reinstall them. But the ch340g's just keep on going.

I'm sure you are well aware of the history behind FTDI adapters.

I think the overwhelming message to be expressed here - and may actually reflect industry in general - is:

Do not buy FTDI adapters. Simplest approach.

BULLSHIT PAUL__B You keep posting that gibberish and I'll keep defending FTDI. I have NO problems with FT232 based modules and will keep using and recommending them. They had one driver incident in an attempt to combat counterfeiting of their intellectual property, it backfired, and they withdrew the offending driver. Yet you continue to keep badmouthing them and posting unfounded generalities. Cut it out.

Indeed I am aware of FTDI putting the boot down on the counterfeiters, and taking a shotgun to them without moving their foot first. I certainly got the same message Paul did from that episode shrug.

But I do not believe that can explain my experience, nor many people's at this point, since they pulled the evil driver when they realized the depth of their blunder... And I'm pretty sure mine were legit - they cost a kings ransom to get.

DrAzzy: Indeed I am aware of FTDI putting the boot down on the counterfeiters, and taking a shotgun to them without moving their foot first. I certainly got the same message Paul did from that episode shrug.

Heh, heh.

DrAzzy: But I do not believe that can explain my experience, nor many people's at this point, since they pulled the evil driver when they realised the depth of their blunder... And I'm pretty sure mine were legit - they cost a kings ransom to get.

No doubt. I would not imply it was (necessarily) the problem.

I had a similar problem to this and was getting the same error message.

For me it turned out that the cheap boards I got, had mixed up Tx and Rx and swapping the leads over solved my issue.

Something to try perhaps.