Finding A Cheaper USB To Serial Chips

FTDI-gate wasn’t great for anybody, and now with hardware hobbyists and technological tinkerers moving away from the most popular USB to serial adapter, some other chip has to fill the void. The cheapest USB to serial chip on the market appears to be the CH340G, available for 20-40 cents apiece from the usual retailers. There is, however, almost no English documentation, and the datasheet for the CH340 family doesn’t include this chip. [Ian]’s here to help you out. He got his mitts on a few of these chips and managed to figure out the pinout and a few reference schematics. He even made an Eagle part for you. Isn’t that nice?

The CH340 series of chips do exactly what you would expect them to do: a full-speed USB device that emulates a standard serial interface, with speeds from 50bps to 2Mpbs. The chip supports 5V and 3.3V, and all the weird modem lines are supported. This chip even has an IrDA mode, because wireless communication in the 90s was exactly as rad as you remember.

With [Ian]’s help, we now have a cheap source of USB to serial chips. If you need the datasheet, here you go. The driver is a bit more difficult to find, but what you’re looking for is the CH341 family of chips. That can be found with a little bit of Google fu.

90 thoughts on “Finding A Cheaper USB To Serial Chips

  1. I thought the Prolific series of chips nicely filled the bottom and somewhat ropey end of the market? Saying that though, most PL chips are cloanes and their drivers block off ones of them. Getting my Baofeng lead to work is like russian roulette so maybe this is a good idea, providing they pull a good driver out of the hat.

    1. Because CDC (supposedly) is outside the USB spec on low speed devices. And because using an AVR requires you to keep track of another software stack. But if you need something fast and have a AVRs in you bin, go for it :-)

    2. CDC on a lowspeed breaks USB specs (bulk endpoints are not allowed for low-speed), thus doesn’t work with some USB hosts properly. Besides, using interrupt-in ep for incoming data severely limits speed to something between 57600 and 115200.
      Last time I needed that – I ended up writing a custom protocol that used control transfers to transfer data over a vusb link, and a userspace libusb-based terminal app.

    3. It wont work reliably. it wont work correctly.

      Software (bit banged) USB is nice as a demonstration of what can be done in code, but to think that it can actually replace a real (hardware) USB device is delusional.

  2. The CH341 chip looks even more interesting: if I’m not mistaken, it’s also capable of EPP, I2C and SPI communication!
    Unfortunately, the current driver in Linux only supports the USB-to-serial capability.
    That would be fantastic to have a driver that supports all the features of the CH341, say to add more I/O to an embedded device running OpenWrt.

    1. Having user level I2C and SPI support is not just for tiny computers running OpenWrt, it’s also nice for servers with unusual sensors that don’t have kernel drivers, things like flow sensors and fluid level indicators for water cooling, external fan controllers, etc.

    2. Oh, now I know why that chip’s name sounded familiar… I have one of those… it’s an epoxy blob in a USB->LPT cable I got somewhere… can’t use it of course since I’m on Linux >.< Anyone want to expand that driver to parallel capability? ;) I'd do it myself if I wasn't still hooked on QuickBASIC… I am NOT a good programmer lol.

      It's IEEE-1284 (LPT), RS-232 (COM), and I2C compatible. I hadn't heard about any SPI capability tho…

          1. Really? Nobody in their right mind?

            If you develop hardware and software on Mac OS, it’s pretty much de rigeur.

            Unless you know of another way to get my software talking to my hardware?

      1. I am running Win 7 and i cant get the ch340g driver to install. I cant see a com port listed. when i plug in the LoLin NodeMcu V3. I just cant get to square 2. Square 1 was when i plugged the USB cable in and the blue lights flashed. But no driver load. What the heck is wrong. troy

    1. “Having” to install drivers for something is great. The Windows Update drivers for many things suck donkey kugels.

      Having a third party maintain the drivers for your hardware sucks anyhow because all they really do is introduce more unnecessary bureaucracy in the middle and then you get outdated buggy drivers and bad support. It’s the same whether it’s Windows Update or Linux repositories – it’s just unnecessary middlemen.

          1. — How do I download?
            — Click on this link
            — How do I click?
            — Click with your mouse
            — Computer mouse or animal mouse?
            — Computer mouse!
            — It does not click. What do I do?
            — Click ON the link
            — What’s next?
            — Install that thing
            — What is install?
            — Double-click on the file
            — It asks me something… Hold on, let me get the glasses on… Ehm… behm… Run… Save…
            — Just click “Run”
            — What’s next?
            — Now you should see the device working
            — What device?
            — Hm. I think I got a wrong number.

      1. It might be worth mentioning that Windows 10 Technical Preview (build 9860) loads Microsoft’s CDC serial driver (USBSER.SYS) automatically. Assuming they don’t revert or regress before release, Windows 10 will finally solve USB serial driver install for all class-compliant USB serial devices.

        http://www.dorkbotpdx.org/blog/paul/windows_10_preview_build_9860_finally_fixes_usb_serial

        As Windows users migrate to version 10, we’ll finally have a situation where USB serial devices work as well on Windows as they have for many years on Linux and Macintosh.

        Microsoft also fixed the long-standing surprise removal bug in the driver.

        https://www.youtube.com/watch?v=DRmvUsa2xuU

        1. So then what’s the cheapest compliant chip? Does anybody here know? Actually, that would make a great HaD post. How about a table, columns could be pre-soldered, dip and surface mount. The rows could be cheapest overall and cheapest compliant.

          1. It’s not just the price of the chip, they need other parts like resistors, capacitors, crystal oscillators, etc. You need to incorporate the prices of these parts in your comparison. And then you need to factor in availability, a cheap chip is irrelevant if you can’t get them (or the supporting parts!) in the quantities and timeline you need for your project. You also need to factor in board space, in three dimensions. Big capacitors can be really cheap but they are problematic if you have size constraints.

      1. Oh, and if you want to check beforehand:

        static const struct usb_device_id id_table[] = {
        { USB_DEVICE(0x4348, 0x5523) },
        { USB_DEVICE(0x1a86, 0x7523) },
        { USB_DEVICE(0x1a86, 0x5523) },
        { },
        };

  3. CH340G is a pretty OK chip.The cheapest Arduino clones I sell use it. While it does the job, drivers are indeed a bit tricky to install due to not being signed and the fact you have to actually download them. I gotta see the datasheet if I could write better drivers myself…

  4. The CH341 chip looks even more interesting: if I’m not mistaken, it’s also capable of EPP, I2C and SPI communication!
    Unfortunately, the current driver in Linux only supports the USB-to-serial capability.
    That would be fantastic to have a Linux driver that supports all the features of the CH341, say to add more I/O to an embedded device running OpenWrt.

  5. What about the CP2102? I have 2 Boards here with these chip, working flawless. But I can’t remeber anymore if I had to search for the driver, or if they where installed automatically.

  6. well in windows 8.1 they install automatically never had troubles with them

    I use Prolific (not in win 8), Ftdi, ch340, silabs cp2102 no problems, no ftdi gate since i use originals chips ….

  7. I like the Silicon Labs chips more. (CP210x). They are only slightly more expensive, you get a real datasheet, a signed driver, example code and support.
    Especially the CP2104 is nice, as it has four additional GPIOs.
    There’s a commercial product (relay board) that uses the CP2104, and the software for this board will run with every CP2104:
    http://www.conrad.de/ce/de/product/393905/Conrad-USB-4fach-Relaiskarte-Baustein-5-VDC-Ausgangsleistung-8-A24-VDC

    1. The SiLabs chips are really nice. I’ve used the CP2108 (4 UARTs and some GPIO), and the driver setup and chip config was really simple. The reference design is also pretty trivial, it doesn’t need an external oscillator like many FTDI chips and only needs a couple of caps to run.

      1. Really nice might be stretching it for me. The driver under Linux can be a bit quirky on older kernels, so you need to be a bit careful to make sure to be running a relatively recent kernel, especially for GPIO access, which I think you still need to get the driver from SiLabs.

        Definitely cheap and easy to use, though.

      2. I second this. I started using CP2102 boards for all TTL-level UART applications. I get them on eBay for around $2 each. They have great driver support, and the boards are teeny-tiny. For $2 they are cheap enough to just leave in a project.

  8. The datasheet referenced is only for the CH340T and CH340R, both 20-pin parts and NOT used on Arduino clones. The only datasheet I’ve seen that has the 16-pin CH340G is mostly in Chinese. However it is enough to be able to use the CH340G is a new design (your own Arduino clone maybe?). I am using it in a project where I put the equivalent of a clone Arduino Nano on my board.

    Here’s a ASCII version of the pin-out since I haven’t figured out how to post a picture yet:

    ————————
    1 | GND VCC | 16
    2 | TXD RS232 | 15
    3 | RXD RTS# | 14
    4 | V3 DTR# | 13
    5 | UD+ DCD# | 12
    6 | UD- RI# | 11
    7 | XI DSR# | 10
    8 | XO CTS# | 9
    ———————–

    The rest of the Chinese datasheet is the same as the English version. You can match up pins in the example schematics well enough to use it in a design. I created an Eagle library for this part (and only this part), but I’m not sure how to share on HAD yet.

    1. Thank you for the pinout!
      I ordered some Arduino Nano for $3.27 shipped. It is using the CH340G chip.
      http://www.banggood.com/ATmega328P-Nano-V3-Controller-Board-Compatible-Arduino-p-940937.html?currency=USD
      but I wasn’t able to find the schematic.

      The Driver directly from the chip manufacturer works fine on WIndows7 64 bit (seems to be the CH341 drivers, but work):
      http://www.winchiphead.com/download/CH341/CH341SER.ZIP

      Board is recognized as well on my PogoPlug running Debian with 3.12 kernel.
      For the price of a USB-Serial board you get an Arduino Nano clone with more GPIO etc.

  9. I’ve thrown my weight behind the Cypress Semi CY7C65213-28PVXI. It’s pin-for-pin compatible with the FT232RL, it’s supported by CDC drivers, so there isn’t a proprietary one for them to horse around with, and it’s about half the price.

    1. In fact, I designed a little USB-to-RS232 board to test it out. It works really nicely. I’d sell them, but I’d have to price them at around $10, and that’s just ridiculous.

    2. The Cypress UART chip also supports SPI and I2C. And the USB Battery Charging spec. You can change a couple of the GPIO pins to report what amount of current is available. (100mA for unenumerated, 500mA for enumerated or SDP, <800mA for CDP, DCP, or unenumerated on a USB 3.0 port). It's a pretty cool feature if you wanted to implement a battery charger. Plus you can configure the GPIOs as capacitive button sensors. It's kind of a kitchen-sink chip, but I don't think it's any more expensive than the SiLabs or FTDI chips that do all 3 serial protocols.

  10. If you are looking for ‘just the chip’, check out aliexpress.com and search on CH340G. They are mostly in lots of 50 and 100, but there are several with as few as 5. The larger lots have the parts for around $.50 USD and free shipping. They also list a lot of USB to serial boards (way cheap) and Arduino clones, Nano, Uno, and Mega that have the CH340G.

  11. great, replacing the worlds most popular one with slower, worse chips with various driver issues, if you’re doing low speed non bulk/non streaming they’re usually ok. but hit them with hi speed continuous traffic and watch them fall apart.

      1. Well thats really the results, they’ll work until you stream lots of data over long periods of time, I do automotive ecu’s (aftermarket and oem), data loggers and performance/tuning software and the customer support nightmare i went through, as well as just trying to get them to stream a consistent flow of data continuously overly long periods of time, they were just never stable at all. The drivers blue screen, they don’t bulk transfer well, stop responding, problems with multiple reconnect errors where you have to switch to a different usb port or reboot, the list goes on.

        one of the reasons i’ve stuck with FTDI

        1. These are the same sorts of problems I see with FTDI chips on OSX

          But I have great results with PL23203 and CP2102 chips

          So it’s not the hardware at all, but rather the quality of the driver

          1. To some extent, but mostly i’d disagree, there are definitely hardware side issues as well that cause some of these problems. Perhaps you could tell us what sort of work load you’re using it in OSX., I get considerably less issues with the FTDI on linux/osx/windows and other embedded OS’s than with the other chips, certainly not the PL2302 and definitely not the CP2102, that chip was a nightmare for me, but YMMV. It’s difficult to compare anecdotal notes and get much of use out of it thats for sure.

  12. I’ve got a lot of arudino clones of pretty good quality that have been using these chips for a while now. They work great on Windows and gave me a little trouble on OSX but overall they work just fine and even with the IDE.

  13. If I wanted to make a device that used USB for power ( And therefore, enumerate to get 1A ), I’m going to assume that I could care less about all this UART stuff and would want the cheapest IC possible. Would the CHG340G be a good choice?

  14. “…all the weird modem lines are supported.”

    Not knowing them is good! (For me.) Made a mint back in the day from people that just called them weird and mysterious. Paid for my hobby! $50 per cable back in the 80’s! Lot of useful things can be done with them weird lines, but yet again you don’t have to use them at all! None is more difficult to understand than what one should do when they hear a knock at the door. Heck even the ex was enthused enough to have me teach her how to make custom cables and handle a logic probe… she liked the $50 a pop that much that she bothered to learn it! Tons more profitable than her knitting and macrame! Paid for her hobby too! It wasn’t much of a leap for her at all… and she don’t know electronics even as far as a battery, light bulb, and two wires…. but she made nice looking cables!

    That folks still don’t know these weird modem lines means vendors will make much $$ with this chip.

    Thanks for the memory HAD!

  15. I’m glad someone commented on this to bring it into the recent comments list and back onto the front page.

    This weekend I was helping some students with a project. I was using a CRIUS USB->TTL module to configure an HC05 bluetooth module. The CRIUS module works great on my Linux laptop. Not so great on the Windows PC at school.

    FTDI is *still doing it* (June 2015). Bastards! My CRIUS module was bricked, so it was useless. I had to take it home and unbrick it. An afternoon wasted.

    Anyway, DealExtreme is listing CH340 devices, so I’ll buy them in future.

  16. Getting nuts ….. I have bought several CH340G boards – can’t get them to run. Well, on arduino it works, but not else. (Driver is installed and works correct – no fault).takes RXD-data when connected to arduino on TXD pin.
    Have a current cost energi-monitor with is suppose to run at 9600 N81 – it works fine on a PL2303HX in windows 8.1 but when I put the 2 lead on the CH340G – I get no output. (No doesn’t help to change RXD / TXD – and beside the receive LED i blinking on the CH340 ….. so there must be data inn!). Anybody has a clue???

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.