Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Arduino Nano CH340 USB/Serial driver stopped working, with work-around

Status
Not open for further replies.
My Arduino Nano with CH340 USB/Serial driver mysteriously stopped working recently. It has worked in the past, and the same is true of two other Arduino Nanos that I tested. Specifically, when I plug in the device using a mini USB cable there is no response (and no serial port assignment). This happens under Windows 10, Linux (Ubuntu), and MacOS (Mojave). By trial and error I found a work-around: use a micro USB cable (USB-A on one end, micro USB on the other), together with a mini/micro adapter plug. Since using the same mini USB cable works with an FTDI adapter (serial port assigned), this clearly has something to do with the CH340 driver and its interaction with the mini USB cable. Clearly the first stage of USB/Serial initiialization called Enumeration is not happening without the work-around. Perhaps the micro USB cable plus adapter has different impedance characteristics vs the mini USB cable? Can somebody provide a more detailed explanation?

While investigating this problem I learned that the RS232 protocol assigns nominal -12V for logical "1" and nominal +12V for logical "0". Do these legacy voltages appear anywhere in the interface when the CH340 or the FTDI chips are employed?

BTW, there is another unrelated potential problem with the Arduino Nano with CH340 driver (Chinese clones). The latest version of the Arduino IDE (1.8.9) assumes by default that a different version of the bootloader has been installed compared with the one installed on the Chinese clones. To upload sketches to the Chinese clone the IDE must be configured as follows (alternatively, burn a different bootloader):

Tools / Board / Arduino Nano
Tools / Processor / ATmega328P (Old Bootloader)


Thanks!
Electronaut
 
While investigating this problem I learned that the RS232 protocol assigns nominal -12V for logical "1" and nominal +12V for logical "0". Do these legacy voltages appear anywhere in the interface when the CH340 or the FTDI chips are employed?

No, it's simply 0 to 5V (or 3.3V) - there would be no point whatsoever converting it to +/-12V and then immediately converting it back down again - the reasons for the +/-12V were historical, and from mechanical devices (teletypes etc.).
 
Is your micro-USB cable a short one that came with a USB battery? If so, it probably doesn't have wires for the data lines - those things are evil.

At any rate, I think your problem is a simple bad cable, as I've used the CH340G with all sorts of cables of different types and they are reliable.
 
The problem is the newer ide is smarter it's not like the older ide there is now a boot loader cheaking and some more stuff added.
you now have this for the nano
nano.jpg

The ide I was using with my older computer didn't have thos and I had to install drivers for windows because the older drivers no longer worked that I used before.
 
On the bad cable theory, this is not clear, since I tested with more than one, and I used my FTDI adapter to separate the power-only/charging cables from those that have active data lines (D+/D-). Under Windows 10 I assume that if I get a beep when I connect the FTDI device then the data lines are active. Otherwise, I assume that the cable is power-only, and do not use it for testing my Arduino Nano. After filtering out the power-only cables using this test, all of my mini USB cables do not work with the Arduino Nano, while all of my micro USB cables (+ micro/mini adapter plug) do work. What is really strange about this is that at some point in the past the mini USB cables did work! [One of my theories is that a bad cable may have damaged all of my Arduino Nano's, resulting in this odd behavior. If this is true, you are correct, and the source of the problem is a bad cable.]

Do you think my test for power-only/charging cables will always work? Do USB cable testers exist?
 
The simple test for "power-only cables" sketched above will not always work. For example, a power-only cable identified in this way will not charge some devices (Sony action camera, for example). These devices work differently when powered on (act like flash drives) and when powered off (charge), and the data lines are probably used for this purpose. Given the wide variety of behaviors, perhaps there are no universal USB cable testers, because there are no universal USB cables?
 
There is only 2 kind and thats because of cheap cell phone cables you have ones that charge only and ones that have the d+ and d- for data the good ones clearly say for charge and data and its easy to find out what you have it will show up on the computer.
 
Like this
driver.png

clearly show i have a CH340 on com 3 I don't have any charge only cables laying around no more i cut the end off them
us them for a easy way to use 5 volt power from my computer.
 
Thanks, OK, so there may only be two kinds of cable, but the "power-only" variety may not actually provide power to some devices, like the Sony action camera, because the data lines are used to determine the state of the connected device (powered on or off). So I shouldn't stop looking for a universal USB cable tester!
 
Sorry if I was unclear, but I have many USB charging cables, and the question was about failure to initialize a serial port when the Arduino Nano is inserted. Indeed, I used the FTDI trick to filter out USB charging cables, and focus on cables that have all four conductors. Indeed, this FTDI trick serves as a simple USB cable tester, because successful serial port configuration suggests that all four wires are in place without shorts. Of course, this does not explain the odd behavior I observed involving the CH340 driver.
 
Could it be the bootloader corrupt?

Mike.
Edit, have you tried the old bootloader option.
 
Tools / Board / Arduino Nano
Tools / Processor / ATmega328P (Old Bootloader)
I wasn't able to program NANOs with those settings. Then I found that they had an ATmega168 chip. Using ATmega168 setting, they work fine.
 
I have no problem programming my three Nano's, provided I used the "Old Bootloader" config option, and provided I use the micro USB cable with adapter plug. But when I use a mini USB cable they are not recognized under Windows, Linux, and MacOS (I tested with several mini USB cables). The really strange thing is that I was able to use the mini USB cables in the past.

How this came about is very interesting and quite mysterious. After two of my Nano's started behaving this way, I tested the third under Linux and it worked with a mini USB cable. Then I plugged this device into my Windows machine, and it was not recognized. Furthermore, it stopped working under Linux and MacOS! Thus plugging the Nano into the Windows machine somehow changed its electrical characteristics, causing it to not work with mini USB cables.
 
I did not purchase the mini/micro adapter until after the damage was done. At first I thought something wierd about my Windows machine burned out my Nano boards (but there was no smoke or other signs of burnout), and I later discovered by accident that using a micro USB cable with a mini/micro adapter brings them back to life. I suspect that there is some strange interaction between the CH340 driver and the mini USB cable, but I cannot explain why it worked in the past, and what changed.
 
I did not purchase the mini/micro adapter until after the damage was done. At first I thought something wierd about my Windows machine burned out my Nano boards (but there was no smoke or other signs of burnout), and I later discovered by accident that using a micro USB cable with a mini/micro adapter brings them back to life. I suspect that there is some strange interaction between the CH340 driver and the mini USB cable, but I cannot explain why it worked in the past, and what changed.

I have been following this and it makes no sense. I believe you, I am not saying that, I am just saying that it makes no sense that a straight-through adapter cable makes it work again. The first cable or the connector is flakey or there is something you have forgotten or have not considered.

Windows changes all the time. I used an Arduino 101 for more than 2 years and then one day it would no longer upload code, always timing out. Move it to another machine and the board would work. Spent 170,645 hours trying to figure it out and have concluded that the 1200 baud reset interval got changed/ignored by Windows at some point under some circumstances, somewhere. I finally stopped thinking about it (mostly) and suggest you do the same - it's fixed now...well with two cables anyways...add it to the list of the mysteries of life...that my 2 cents, anyways.
 
Yes, of course, the problem is fixed, and I'll move on. Just wanted to leave this puzzle here in case somebody wants to take a shot at explaining it. Here are the results of one final test. I select a mini USB cable that seems to be in good shape because when it is used to connect my FTDI adapter I get a Windows beep, and a serial port is created. Now I use the same cable to connect my Arduino Nano, and nothing happens (no beep, no serial port). Finally, I use a micro USB cable with the mini/micro adapter to connect my Arduino Nano, and there is a Windows beep and a serial port is created. I agree with you, it makes no sense.
 
The only thing that makes sense is a mechanical problem with the connectors. I have one Nodemcu board whith micro USB which only connects if I gently lift the USB plug.

Mike.
 
I suspect you are correct, but jiggling the connector doesn't help in my case. Since the mini USB cables used to work, perhaps the tiny leads are rusted, and the pull-up resistors are not properly detected. When the pull-ups are not detected "USB assumes there is nothing connected to the bus" according to https://www.beyondlogic.org/usbnutshell/usb2.shtml (see section Speed Identification). Perhaps the FTDI adapter works because it is less rusted compared with the Arduino Nano connector. Also, the mini/micro adapter seems to have more prominent contacts compared with the straight mini connector, and this may compensate for corrosion in the Nano connector. Now everything makes more sense!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top