This is an old revision of the document!


Nanjing QinHeng Electronics CH340

ch340g.jpg

ch340-485.jpg

ch340usb.jpg

Top: ch340g Bottom: fake

These are cheap USB UARTs available is various configurations.

These devices are becoming popular, so much so that fake ch340 chips exist. The fakes have the ch340 USB identity but are not genuine (bottom photo).

Pinout

    CH340G              CH340T              CH340R
    +------+            +------+            +------+
GND 1     16 VCC   CKO  1     20 NOS#  NC   1     20 NOS#
TXD 2     15 R232  ACT# 2     19 VCC   ACT# 2     19 VCC
RXD 3     14 RTS#  TXD  3     18 R232  TXD  3     18 R232
V3  4     13 DTR#  RXD  4     17 NC    RXD  4     17 IR#
VD+ 5     12 DCD#  V3   5     16 RTS#  V3   5     16 RTS#
VD- 6     11 RI#   VD+  6     15 DTR#  VD+  6     15 DTR#
XI  7     10 DSR#  VD-  7     14 DCD#  VD-  7     14 DCD#
XO  8      9 CTS#  GND  8     13 RI#   GND  8     13 RI#
    +------+       XI   9     12 DSR#  XI   9     12 DSR#
                   XO   10    11 CTS#  XO   10    11 CTS#
                        +------+            +------+

Linux

Identity
ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
udev /dev/ttyCH340
KERNEL=="ttyUSB*",\
    ATTRS{idVendor}=="1a86",\
    ATTRS{idProduct}=="7523",\
    GROUP="dialout",\
    MODE="0660",\
    RUN+="/bin/ln -sf %k /dev/ttyCH340"
udev by-id
/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0

udev by-id is not supported by Pickle Microchip PIC ICSP.

Pickle Microchip PIC ICSP

Velleman K8048 Configuration
DEVICE=/dev/ttyUSB0
SLEEP=600
BITRULES=0x001F

RS485

Cheap RS485 adapters exist using both this chip and a fake version of this chip (bottom picture above).

The real chip is a CH340G with 16 pins and the fake chip has 24 pins in an unmarked package. The top 20 pins of the fake match those of a genuine CH340R or CH340T device which is only available as a 20-pin SSOP.

The RS485 I/O stage varies slightly between the real and fake adapters and is constructed like this for the CH340G device.

Resources

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies