USB Serial: What Is Ch340? - Latest Open Tech From Seeed

You might be thinking of getting the extremely popular FTDI, but they are probably over your budget. So what’s the cheaper alternative? Try out Ch340, a USB to Serial adapter!

USB Serial: What is Ch340?

However, before we can jump right into our main dish, we have to first understand these concepts:

  • Serial Communication: RS232 vs TTL: Beginner Guide to Serial Communication
  • Arduino: Introduction to the Arduino – What is Arduino?

Once you’ve understood those concepts, we can then tackle all the questions you might have with regards to the Ch340. Let’s move on to what will be covered:

  • Overview of Ch340
  • Example of Ch340 in Boards
  • How to install Ch340 Drivers?
  • Serial Projects

Overview of Ch340

What is Ch340?

To put simply, Ch340 is basically a USB bus convert chip. It allows the USB to be converted to serial interface, serial signals to USB etc. You can even think of Ch340 as a trader of some sort!

Ref: ezbuyExample of CH340G Chip

Specifications

  • Full speed USB device interface conforms to USB Specification Version 2.0, requires crystal and capacitance external.
  • Emulate standard serial interface, used to upgrade the former peripheral device, or add excess serial interface through USB.
  • Totally compatible with the serial application program in computer endpoint Windows operating system.
  • Supports common MODEM liaison signal RTS, DTR, DCD, RI, DSR and CTS.
  • Supports IrDA criterion SIR infrared communication, supports baud rate varies from 2400bps to 115200bps.
  • Hardware full duplex serial interface, set transceiver buffer, supports communication baud rate varies from 50bps to 2Mbps.
  • Software compatible with CH341, using the drive of CH341 directly.
  • Support 5V and 3.3V source voltage.
  • Supply SSOP-20 package without lead, compatible with RoHS.

Variants of Ch340

Ch340C

This is the most common and versatile variant of Ch340 out of the rest, it is compatible with many hardware as well.

Ref: yoycartExample of Ch340C

Ch340G

This variant of Ch340 is pretty similar to Ch340C, except for its oscillator. Thus, they are often used in replacement of the other.

Ref: ezbuyExample of CH340G Chip

If by any chance you’re interested to learn more about CH340G, check out ch340g and its application!

Do note that there are many more Ch340 variants such as Ch340B, Ch340T, Ch340R, Ch340E etc. The pinouts of each Ch340 variants are as shown below:

Ref: AndyBrown

Example of Ch340 in Boards

USB To Uart 5V&3V3 ($7.95)

USB to Serial Adapter

Seeed’s USB To Uart 5V/3V3 is a USB to serial adapter, that is base on CH340. It is compatible with 5V and 3V3, and it can be used to upload codes or communicating with MCUs!

Features:

  • Full speed USB device interface conforms to USB Specification Version 2.0.
  • Supports baud rate varies from 2400bps to 115200bps.
  • Hardware full duplex serial interface, set transceiver buffer.
  • 3.3V and 5V compatible I/Os.
  • LED Indicator

Interface:

  1. Power Indicator
  2. Micro USB
  3. TX Indicator
  4. RX Indicator
  5. Uart Breakout
  6. VCC Switch: Choice 5V or 3V3

CH340G USB to Serial (TTL) Module&Adapter ($1.95)

The CH340G USB to Serial (TTL) Module&Adapter is a small USB to TTL serial tool, which uses the CH340G chip. You can use it to connect a serial device to your PC via USB port.

Features:

  • Compatible with 32-bit & 64-bit Windows, Mac OS 8 to OS X, Linux and Android.
  • 3.3V and 5.0V outputs.
  • Use the shunt to connect TX and RX (loopback test) to test the unit.

How to install Ch340 Drivers

To demonstrate this, we will be using our USB To Uart 5V&3V3. But before we can install the drivers, here are some things you need to prepare:

  • USB 3.1 Type C to A Cable 1 Meter – 3.1A: To connect your computer to a serial adapter.
  • 6 pin dual-female jumper wire – 300mm: To connect your serial adapter to Arduino, Raspberry Pi etc.

Driver Install

Windows/Linux

For Windows and Linux, the USB To Uart 5V&3V3 is compatible with the serial application program in computer endpoint Windows operating system. So technically you don’t have to download driver, you can follow these steps instead:

  1. Plugin the USB serial adapter using a USB cable.
  2. Wait for it to be connected and find “USB-Serial Ch340 (COM9)” in Device Manager:

In the case where you cannot find it, click here to download the driver.

Mac OS

For Mac, you’ll have to install the driver here before you can proceed. Then you can follow the steps below.

On Mac OS Yosemite:

  1. Install the CH340 driver
  2. Open Terminal program (located in /Applications/Utilities/)
  3. Type command: sudo nvram boot-args=”debug=0x146 kext-dev-mode=1″
  4. Type password
  5. Restart your computer

To restore your mac’s setting, simply exit developer mode by redefining the boot-arg to your previous settings, or clear your boot-args as follows: sudo nvram -d boot-args.

Serial Projects

Now that we know how to install Ch340 drivers, we can explore some fun projects with it!

i2c LC1602 display driven by STM32F103

IF you have i2c background and would like to incorporate Ch340 in your project, this project is the one for you. It allows you to control the LED module to display whatever you like!

What you’ll need:

  • LCD Display Module
  • Seeeduino Nano
  • Solderless Breadboard
  • Jumper Wire
  • Arduino Mini USB serial adapter (or USB To Uart 5V&3V3)

Interested? Check it out here!

Use Python to Access a SIM Module

Wanted to build something that allows you to access SIM Module? This project allows you to send, receive texts and control phone calls!

What you’ll need:

  • SIMCom Wireless Solutions SIM800L GSM Module
  • Arduino Mini USB serial adapter (or USB To Uart 5V&3V3)
  • Mobile SIM Card (instruction states US Mobile SIM Card, so I’m not sure if this is applicable to SIM Cards from other countries)

If this is right up your alley, click here for more!

Summary

And that’s it on Ch340! Did you learn something new? Today we discussed CH340, its usage, how to set up its driver and some projects you can do with it. Should you require more resources to help you, check out the links below!

Resources

  • CH340 Datasheet
  • CH340 Schematics

About Author

Gigi

See author's posts

Tags: Arduino, CH340, open hardware, serial communication, USB to Serial

Continue Reading

Previous Getting Started with nRF52833Next what is electricity

Từ khóa » Ch340