CH340 Drivers and Serial Port

When using a computer to program the controller (avrdude, pymcuprog) with a CH340 for UPDI controllers, the software must use a serial port to communicate with the programmer. While this is also true of Android (zflasher), on Android the app locates the port automatically.

Updating on a computer can be done from Windows, Linux, or macOS. Requirements vary by platform.

The first step is to plug the USB device in and let the OS detect it and install drivers.

Note

The drivers are built into most current operating system versions so there should be no need for manually installing drivers. If for some reason the drivers are not present, download and install the drivers by hand.

After the device is detected the OS will assign it a serial port device. The exact name and location of the device depends on the operating system:

Windows

On Windows:

  • Right click the Start/Windows button

  • Click Device Manager

  • Expand Ports (COM & LPT)

  • Locate the port named for the device, likely “USB-SERIAL CH340”, and note the port listed afterward.

    For example COM7.

If there is a ! and the same port is in the list twice:

  • Double click the “USB-SERIAL CH340” device

  • Click the Port Settings tab

  • Click Advanced

  • Change the device to a different (unused) COM port number

Linux

On Linux, the device will be /dev/ttyUSB<id> for example, /dev/ttyUSB0. If there are multiple devices, the correct device is likely the highest one or one with the newest timestamp.

macOS

On macOS, the device will be /dev/cu.usbserial-<id> , the ID will vary by hardware. If there are multiple devices, the correct device is likely the one with the newest timestamp.