≡222
![Driver Driver](http://www.dnatechindia.com/image/catalog/ch340g_install_window.jpg)
Screenshot of Window 10 Device Manager with Serial Basic on COM42. Click to enlarge.
Screenshot of Mac OSX terminal with Serial Basic on cu.wchusbserialfd1410. Click to enlarge.
Screenshot of Raspberry Pi CLI with Serial Basic on ttyUSB0. Click to enlarge
Windows CH340 Driver Installation
Mac OSX CH340 Driver Installation File
CH340 driver for Windows 8.1 x64 & x86. CH340 Windows 8 driver installation step 2. In fact my copy of Windows 10 already had the older driver.
PagesFavoritedFavorite1Introduction
The latest iteration of the SparkFun Serial Basic Breakout takes advantage of USB-C and is an easy-to-use USB-to-Serial adapter based on the CH340C IC from WCH. With USB-C you can get up to three times the power delivery over the previous USB generation and has the convenient feature of being reversible. The product works with 5V and 3.3V systems and should auto install on most operating systems without the need for additional drivers. The Serial Basic uses the CH340C IC to quickly and easily convert serial signals to USB. It’s a great lower-cost alternative to the extremely popular FTDI Basic.
SparkFun Serial Basic Breakout - CH340C and USB-C
DEV-15096FavoritedFavorite8
Required Materials
At a minimum, you will need the following materials to follow along with the tutorial. You may not need everything though depending on what you have and your setup. Add it to your cart, read through the guide, and adjust the cart as necessary.
Jumper Wires - Connected 6' (M/M, 20 pack)
PRT-12795FavoritedFavorite17
USB 3.1 Cable A to C - 3 Foot
CAB-14743FavoritedFavorite2
Suggested Reading
Before you begin it may be worth looking at the basics of Serial Communication. Do you have a favorite terminal program yet? No? Take a look at the Serial Terminal Basics tutorial which will give you a brief introduction to popular Terminal programs.
Serial Communication
Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!
Serial Terminal Basics
This tutorial will show you how to communicate with your serial devices using a variety of terminal emulator applications.
How to Work with Jumper Pads and PCB Traces
Handling PCB jumper pads and traces is an essential skill. Learn how to cut a PCB trace, add a solder jumper between pads to reroute connections, and repair a trace with the green wire method if a trace is damaged.
Serial Basic Overview
The pinout of the Serial Basic mimics the common DTR/RX/TX/VCC/CTS/GND pinout found on hundreds of FTDI-to-USB derivatives.
Pin Label | Input/Output | Description |
---|---|---|
DTR | Output | Data Terminal Ready, Active Low |
RXI | Input | Serial Receive |
TXO | Output | Serial Transmit |
VCC | Supply Output | Power supply 3.3V (Default) or 5V |
CTS | Input | Clear To Send, Active Low |
GND | Supply Output | Ground (0V) supply |
USB-C
USB-C gives you the potential of more power than the previous generation of USB. USB-C is used to power everything from laptops to low powered micro controllers and has the amazing capability of being reversible.
LEDs
The two LEDs on the board are connected to TX (Green) and RX (Yellow) and are correctly aligned to the silk header labels:
RXI
and TXO
. This is a quick and handy way to see the serial traffic.Alignment Markers
The
GRN
and BLK
silk in the corners opposite of the USB-C connector, is there to help you align the board properly with products that use these same orientation indicators.The Serial Basic mates seamlessly with products that use the standard serial connection. If you see a board with the
BLK
and GRN
labels, then you know it will be compatible with the Serial Basic.See the GRN and BLK labels on this nRF52832 Breakout?
Where did GRN and BLK come from? Way back in 2008, when we created the Arduino Pro Mini, we needed to have a pinout to allow serial bootloading. At the time, the best USB to TTL Serial device was the FT232 Cable. Its unpolarized connector could be flipped either way so we added the words GRN and BLK to the PCB to let folks know how to line up the colored wires. The practice stuck! Now, many boards use this standard.
The cable with colored wires
Voltage Selection Jumper
There is a jumper on the underside of the board that controls the output voltage on the VCC pin. By default, the board outputs 3.3V and has 3.3V signals.
There is a small trace connecting the middle pad and the top pad labeled
3.3V
.When the jumper is set to 3.3V, the board uses an on board 3.3V regulator capable of sourcing 600mA. If you attempt to pull more than 600mA, the regulator will go into short-circuit shutdown where it will only output 150mA.
You can change the board's output and signal to 5V by cutting the trace between the center and
3.3V
labeled pad and putting solder on the center and 5V
labeled pad. This will change the board's output to 5V on the VCC pin with 5V signals.When the jumper is set to 5V, the board will source as much power as your USB port will provide. With USB-C this can be up to 1.5Amps but depending on what is providing the power and the capabilities of your cable, you can get up to 3 Amps.
Hardware Test
To connect the board to a computer, you will need a USB-C cable. Plug the USB-C cable into a USB port on your computer and the other end into the Serial Basic. Your computer should automatically install the necessary drivers and create a COM port on your computer. If you are prompted for drivers, please see the Drivers section.
The quickest and easiest way to make sure everything is working is to do a TX/RX loop-back. To do this, insert a jumper wire between TX and RX as shown below. Anything that is transmitted from the TX pin will be echoed back to the RX pin.
Now that you've got that plugged in, open your favorite terminal program. Select the COM port that the Serial Basic is assigned to, and connect. When you type a character, you should see each character you type echoed back in the terminal and the RX and TX LEDs will flash as you type.
Which COM Port Do I Need?
![Driver Driver](http://www.dnatechindia.com/image/catalog/ch340g_install_window.jpg)
Most programs will show you a description of the USB device that created the port. To verify that your driver is working, you can use a serial terminal, Arduino IDE, device manager, or command line.
Serial Terminal
Look for the port associated with CH340C. The image below shows the Serial Basic enumerating on a COM port within a serial terminal.
Arduino IDE Ports
If you're using the Arduino IDE, figuring out which COM port is the one you want is more difficult. Here's the quick way to figure it out: attach the Serial Basic to your computer, and check which COM ports are listed. In the image below, we have two ports. Now close the Tools menu by clicking on the main Arduino IDE window.
Unplug the Serial Basic, and re-open the Tools ->Ports submenu. You will see one of the serial ports is missing. That's the one you want! Plug your Serial Basic back in, and use that COM port.
Note: You need to close and re-open the tools menu before Arduino will refresh the port list. If you have the tool menu open simply click on the main window, then click back on Tools ->Port.
Windows: Device Manager
You can also verify that the board is installed if it shows up in your device manager. You can click the Start or ⊞ (Windows) button and type 'device' to quickly search for the application. (*On Windows 10, the quick search function is picky on the spelling of the application you are searching for. For example, you may get results using '_devi_' and none for '_device_'.)
Screenshot of Window 10 Device Manager with Serial Basic on COM42. Click to enlarge.
Mac OSX: Command Line
To verify on a Mac via the command line. To open a command line window, head to your Applications folder, Utilities folder, then double-click on Terminal. Otherwise, press ⌘ (Command) + space bar (Space Bar) to launch Spotlight and type 'Terminal,' then double-click the search result.
Run the following command '
ls /dev/cu*
' in a Terminal and check for the following changes (your board may show up under a different device name).You should get something similar as shown in the image below.
Screenshot of Mac OSX terminal with Serial Basic on cu.wchusbserialfd1410. Click to enlarge.
Note: If you are still unsure of how to access the Terminal, watch this video or read this Apple support article.
Raspbian: Command Line
Run the following command '
ls /dev/ttyUSB*
' in the CLI/Terminal and check for the following changes (your board may show up under a different device name).You should get something similar as shown in the image below.
Screenshot of Raspberry Pi CLI with Serial Basic on ttyUSB0. Click to enlarge
Drivers (If You Need Them)
The CH340C has been tested on Windows 7, Windows 10, OSX High Sierra, and Raspbian Stretch (11-13-2018 release) for the Raspberry Pi. These operating systems have the CDC drivers pre-installed, which means you shouldn't need to install any extra software. However, there are a wide range of operating systems out there, so, if you run into driver problems, you can get drivers here.
- Windows (EXE) -- Driver executable
- Windows (ZIP) : Driver version 3.4 (2016-09-27)
- Linux (ZIP) : Driver v1.5 (2018-03-18)
- Mac (ZIP) : Driver v1.5 (2018-07-04)
The CH340G is made by WCH. You can find the latest version of their drivers here, but most of their pages are in Mandarin. If you use a Chrome web browser, you should have the option to have the web page translated.
Updating Drivers
If you have the older CH340 drivers installed, you may need to update them. Below are the instructions for doing so on each of the tested operating systems:
Windows 7/10
Download and run the executable. Click the 'Uninstall' button first, followed by the 'Install' button.
Windows CH340 Driver Installation
Mac OSX
Run the following commands in the CLI/Terminal before installing the new drivers:
Note: To open the Terminal, open your Applications folder, Utilities folder, then double-click on Terminal. Otherwise, press ⌘ (Command) + space bar (Space Bar) to launch Spotlight and type 'Terminal,' then double-click the search result.
If you are still unsure of how to access the Terminal, watch this video or read this Apple support article.
If you are still unsure of how to access the Terminal, watch this video or read this Apple support article.
Download and extract the folder. Then, open the '*.pkg' file from the unzipped folder.
Mac OSX CH340 Driver Installation File
Raspbian
Run the following commands in the CLI/Terminal:
Other Linux Distributions
Here is a downloadable .zip of standard CH340 drivers for Linux.
There are some reported cases of serial communication failure when using the factory drivers in Linux. If you encounter this problem you can try installing patched drivers as exlained in this post. Here are the steps (to run in the command line):
- Type
dmesg
- Expected output: (Shows 'ch341'):
- Download the patched drivers repository (https://github.com/juliagoda/CH341SER) and
cd
into the directory make clean
make
sudo make load
sudo rmmod ch341
lsmod | grep ch34
dmesg
- Expected output: (Should show 'ch34x' now):
Resources and Going Further
Once you've got serial communication working, you're ready to start playing with serial projects. Consider connecting to a GPS module like the GP-20U7, taking a look at our tutorial on GPS and watching the serial strings roll by. Or, you can use the Serial Basic to program and debug devices like the Arduino Pro Mini. There are tons of devices that use serial to communicate, so go explore!
The Serial Basic programming an Arduino Pro Mini
Heads up! The image shows the Serial Basic connected to an Arduino Pro Mini 3.3V/8MHz. If you are using an Arduino Pro Mini 5V/16MHz, make sure to adjust the jumper pad for the voltage selection on the back of the Serial Basic.
Check out these other resources for the Serial Basic.
- Datasheet (PDF) (CH340C)
- WCH: CH340 Drivers
- Windows (EXE) -- Driver executable
- Windows (ZIP) -- Driver version 3.4 (2016-09-27)
- Linux (ZIP) -- Driver v1.5 (2018-03-18)
- Mac (ZIP) -- Driver v1.5 (2018-07-04)
Check out these other great SparkFun tutorials.
Binary
Binary is the numeral system of electronics and programming...so it must be important to learn. But, what is binary? How does it translate to other numeral systems like decimal?
Serial Terminal Basics
This tutorial will show you how to communicate with your serial devices using a variety of terminal emulator applications.
Simultaneous RFID Tag Reader Hookup Guide
A basic guide to getting started with the RFID Tag Reader breakout and how to read and write multiple RFID tags over multiple feet!
Roshamglo Project: TV-B-Gone
Turn your Roshamglo board into a (nearly) universal TV power button.
Need some inspiration for your next project? Check out some of these related tutorials:
Serial Communication
Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!
GPS Basics
The Global Positioning System (GPS) is an engineering marvel that we all have access to for a relatively low cost and no subscription fee. With the correct hardware and minimal effort, you can determine your position and time almost anywhere on the globe.
Using the Arduino Pro Mini 3.3V
This tutorial is your guide to all things Arduino Pro Mini. It explains what it is, what it's not, and how to get started using it.
Serial Terminal Basics
This tutorial will show you how to communicate with your serial devices using a variety of terminal emulator applications.
Posted byThe loop must flow6 months ago
Archived
Here's a scenario:
Have got the Arduino IDE 1.6.12 with the CH340 drivers installed and working on my Windows 10 desktop with my clone Nano's. Works like a charm.
Then there's my laptops (ASUS M50VM-A1 and MSI GX640), where I get get 'stk500_recv(): programmer is not responding' when trying to upload the sketch to those same Nano's.
Laptop1: Previous install of Windows 10 1809, downloaded/installed CH340 drivers from the Chinese manufacturer, downloaded and installed Arduino IDE 1.8.8 and then rebooted and ran the IDE.
Laptop1: Grabbed a blank hard drive and installed a fresh copy of Windows 10 1809 on the new drive, . . . (same install process).
Laptop2: A previous install of Windows 10 1809, . . . (same install process).
Plugged in a Nano on all 3 machines and device manager reports the CH340 as showing up under the Com ports every time. In the IDE, I selected the correct com port, as well as the Nano board (have been doing this for years on my desktop).
I can program the Nano's on my desktop, but NOT on either laptop, I get stk500_recv(): programmer is not responding. Again, these Nano's can be programmed on my desktop, so I know the bootloader is fine.
Tried more 3 Nano's, 3 cables as well as different USB port on the laptops and with (relatively) consistent results. Always works on desktop, but not either laptop.
Note: I use CH340 drivers from the manufacturer web site at http://www.wch.cn/download/CH341SER_EXE.html
Edit: Yep, I tried new and old bootloader on the laptops with no success. Will load up a serial print sketch on the desktop and see what happens in the monitor on the laptops.
Resolution: Turns out that I had to select 'Old Bootloader' in the updated IDE. Didn't help that I had a faulty cable as well as a faulty Nano in the mix, which made troubleshooting much more challenging.
12 comments