Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
interfaces:ch340g [2015/02/22 02:52]
darron [RS485]
interfaces:ch340g [2021/08/11 11:08] (current)
darron [Resources]
Line 1: Line 1:
 ==== Nanjing QinHeng Electronics CH340 ==== ==== Nanjing QinHeng Electronics CH340 ====
 <wrap right> <wrap right>
-{{:interfaces:ch340g.jpg?100}}+{{:interfaces:ch340usb.jpg?150}}
 \\ \\ \\ \\
-{{:interfaces:ch340-485.jpg?100}} +{{:interfaces:ch340-min.jpg?150}}
-\\ \\ +
-{{:interfaces:ch340usb.jpg?100}} +
-\\ \\ +
-{{:interfaces:ch340g-fake.jpg?100|Top: ch340g Bottom: fake}}+
 </wrap> </wrap>
  
Line 13: Line 9:
  
 These devices are becoming popular, so much so that fake ch340 chips exist. 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).+The fakes have the ch340 USB identity and can be found in RS485 adatpers 
 +(see below)
 + 
 +As well as being found on general purpose serial interfaces they are 
 +often found on Arduino clones and ESP8266 bridges.
  
 === Pinout === === Pinout ===
Line 31: Line 31:
                         +------+            +------+                         +------+            +------+
 </code> </code>
 +
 === Linux === === Linux ===
 +<wrap right>
 +{{:interfaces:ch340-esp.jpg?200|ESP8266 bridge}}
 +</wrap>
  
 == Identity == == Identity ==
Line 52: Line 56:
 /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0 /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
 </code> </code>
-udev by-id is not supported by Pickle Microchip PIC ICSP.+
  
 === Pickle Microchip PIC ICSP === === Pickle Microchip PIC ICSP ===
 +<wrap right>
 +{{:interfaces:ch340g.jpg?200}}
 +</wrap>
 +
 +Pickle ICSP supports RS232 for programming boards such as the Velleman K8048 kit.
  
 == Velleman K8048 Configuration == == Velleman K8048 Configuration ==
 +
 +The K8048 kit has an RS232 interface which is used in a bit-bang mode of operation. USB UARTS
 +are not ideal for this purpose but can operate, albeit slowly.
 +
 +The .pickle configuration for the CH340 is this.
 <code> <code>
-DEVICE=/dev/ttyUSB0+DEVICE=TTY 
 +IFACE=/dev/ttyUSB0
 SLEEP=600 SLEEP=600
 BITRULES=0x001F BITRULES=0x001F
 </code> </code>
 +
 +The SLEEP value affects both the speed of programming and the reliability of operation.
  
 === RS485 === === RS485 ===
-Cheap RS485 adapters exist using both this chip and a fake version of this chip (bottom picture above).+<wrap right> 
 +{{:interfaces:ch340-485.jpg?150}} 
 +\\ \\ 
 +{{:interfaces:ch340g-fake.jpg?150|Top: ch340g Bottom: fake}} 
 +</wrap> 
 + 
 +Cheap RS485 adapters exist using both this chip and a fake version of this chip.
  
-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 that only come in a a 20-pin SSOP.+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 in 20-pin packages.
  
 The RS485 I/O stage varies slightly between the real and fake adapters and is constructed like this for the CH340G device. The RS485 I/O stage varies slightly between the real and fake adapters and is constructed like this for the CH340G device.
Line 73: Line 96:
  
 === Resources === === Resources ===
-[[http://www.wch-ic.com/product/usb/ch340.asp|CH340 product page]]\\ 
-[[http://www.wch.cn/downloads/downfile.php?id=65|Driver for Cygwin]] 
  
 +[[http://www.wch-ic.com/download/CH340DS1_PDF.html|Data-sheet]]
  
 +[[http://www.wch-ic.com/downloads/CH341SER_EXE.html|Windows driver]]