An Arduino Compatible Using CP2102

Standard Arduino boards use FTDI’s FT232RL to interface with computer’s USB port. Since FT232R is just a USB to UART converter, it is possible to build an Arduino compatible USB interface using other USB to UART chips.

One such alternative is Silicon LabsCP2102. I particularly like this USB to UART transceiver because very few extra components are required for it to work. As an added benefit, this chip is also cheaper than the ubiquitous FT232R. Of course, there are also a few trade offs. First of all, CP2102 does not provide a bit bang interface (the X3 pins on the Arduino board on the other hand can be used for bit bang operations, but the X3 pins are not soldered with header pins by default and thus for the average users no bit bang support should not be an issue). Secondly, CP2102 does not have the configurable general purpose I/O pins to drive the TX/RX LEDs. There are other minor differences as well (for instance the maximum transmission speed for FT232R is 3Mbps while CP2102 tops at 1Mbps. Both chips are more than adequate for the maximum 115,200 baud rate supported in Arduino environment), but they do not affect the performance in our application of interfacing with Arduino.

Here is the schematics for using CP2102 with ATmega328p (the circuit below is compatible with the Arduino IDE):

Arduino using CP2102

Arduino using CP2102

if you compare the above circuit with the official Arduino Duemilanove board you will see that the interfacing portions (RXD, TXD and TDR) are virtually identical.

Since CP2102 comes only in QFN-28 packaging, some people might find it slightly harder to deal with than TSSOP. Using the prototyping method I mentioned a few months back though, it is fairly straightforward to use the chip on a standard perf-board nevertheless. No special tools or stencils are needed. The following picture shows the USB to UART converter portion of the Arduino, which can be used to replace the FT232 break out board. I chose to break out the converter so that I could use it in other projects that require serial connections.

USB to Serial Board based on CP2102

USB to Serial Board based on CP2102

If you are running Linux, you do not need any third-party device drivers. All recent Linux kernels support CP210x via the usbserial kernel module. Once connected, you should be able to use dmesg and see these messages:

[ 8333.572512] usb 8-2: new full speed USB device using uhci_hcd and address 3
[ 8333.744748] usb 8-2: configuration #1 chosen from 1 choice
[ 8333.785114] usbcore: registered new interface driver usbserial
[ 8333.785161] USB Serial support registered for generic
[ 8333.785221] usbcore: registered new interface driver usbserial_generic
[ 8333.785222] usbserial: USB Serial Driver core
[ 8333.792419] USB Serial support registered for cp210x
[ 8333.792460] cp210x 8-2:1.0: cp210x converter detected
[ 8333.920011] usb 8-2: reset full speed USB device using uhci_hcd and address 3
[ 8334.076745] usb 8-2: cp210x converter now attached to ttyUSB0
[ 8334.076760] usbcore: registered new interface driver cp210x
[ 8334.076762] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver

If you are running Windows, you will need to install the royalty-free driver from Silicon Labs directly.

Under Linux, CP210x shows up as a a ttyUSB device. You can use the Arduino IDE to program your ATmega328p’s just as you would with an official Arduino. Serial communication via the serial monitor works the same way as well. Like the official Arduino, the above circuit also automatically resets whenever you upload a program.

The following picture shows this Arduino compatible circuit in action.

An Arduino Compatible Using CP2102

An Arduino Compatible Using CP2102

Be Sociable, Share!

29 Comments

  1. Fernando says:

    Can the digital pins 0 and 1 (RX and TX) of the arduino be used or must they be reserved for cp2102? I have read some people complaining about this chip when connected to the arduino…

    • kwong says:

      RX/TX pins (digital pin 0 and 1) should not be used for other purposes if you need to use the USB capability. This is similar to the situations with the official Arduino board.

      As far as Linux is concerned, I don’t believe there’s any issue. I did read about issues some people had while running under MacOS though. But if you are using Linux (or Windows), you should be all set.

  2. Brian says:

    Hi!

    Which ATmega328p bootloader were you using with this CP2102 interface, and do you happen to have an Eagle schematic for the circuit above?

    Thanks!

    • kwong says:

      I used the bootloader for Duemilanove. But I am pretty sure any bootloader should work.

      Sorry, I don’t have the schematic file…. I created the schematics for illustration purpose only and I did not design any board layout for this project.

  3. Hi,
    for using building the cp2102, the capacitors which you have used is enough? (when I saw some images on ebay, there was more components then these two)

    And what is the input voltage you are giving 5v or 3.3V?

  4. jagadeshwaran says:

    HI
    what is a boot loader and how to load the boot loader in atmega328p.I bought atmega328p ic from sparkfun without the arduino boot loader now i want to load the boot loader please help me im breking my heads
    .

  5. […] паяльная станция Lukey 702 » An Arduino Compatible Using CP2102 An Arduino Compatible Using CP2102 An Arduino Compatible Using CP2102 Апрель 3rd, 2012 | Category: […]

  6. Pieter says:

    Hi Kerry, I always love reading your articles =)

    I want to get started with Arduino and found the following project board I’m thinking of buying or clone-ing (http://www.mantech.co.za/datasheets/products/PC14-006-01.pdf).

    I was wondering if you can do a similar thread to this one, but showing how to interface the FT232R with the ATMega328 instead of CP2102…?

    Thanx in advance and keep up the good work!

    • kwong says:

      Hi Pieter,

      Thanks for your comment. I don’t have an FT232RL chip right now, but if you take a look at the schematic for Arduino Duemilanove (http://arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf) you will see that the FT232RL portion of the circuit.

      Basically, you will need C4, C8, C10, RTS, C13 as a bare minimum. Pin 1 and Pin 5 (Rx, Tx) of FT232RL along with the reset signal (via R2, C13 to ATmega328’s reset pin) will be used to communicate with Arduino’s UART port (D0, D1). Hopefully this helps.

      • Pieter says:

        I’m thinking of designing a minimum breakout board for the FT232RL that will plug into an ATMega328 Project Board like a small “shield” (stil have to design that part).

        Looking at the Duemilanove Schematic (http://arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf), Which of the Capacitors on the USB side (C4, C8, C10) needs to be on the breakout board and close to their respective pins on the FT232RL chip? …does Capacitor C13 need to be close to the FT232RL chip or the Microcontroller chip? (or neither?)

        • kwong says:

          Hi Pieter,

          C4 is the USB power bypassing cap, it needs to be placed as close to the USB connector as possible. C8 is the FT232RL 3V3 bypassing cap, and needs to be placed as close to pin 17 of the chip as possible. C10 and C13 are not as critical (C10 is to provide power reset timing delay and C13 is used to generate the reset signal required by the ATmega328P).

  7. Pieter says:

    Thanx, that clears it up. Don’t know if I’m ready to solder a SSOP-28 yet though…

    Will the following board work in the mean time? (http://www.mantech.co.za/datasheets/products/PMOD-USBUART_D.pdf) …or will the 3.3V be a problem?

  8. Daniel says:

    Your page is the best source I can find regarding a CP2102.

    When I built my diy 328p board it seems it came with the blink sketch already. Tried to update the blink sketch, the chip resets and the L.E.D blinks fast a few times, but the sketch doesn’t update…

    Have you tried with Xp? Do you know settings for sketch to make the CP2102 work?

    Thanks! great page!!

    • kwong says:

      Hi Daniel,

      I have been using the CP2102 board for a while now (both with Linux and Windows) and it has been working really well. Since it is just a USB to UART converter, no special software is needed Linux. For Windows, you will need the driver from silab (http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx).

      If you built the circuit according to what I have, then it should work (The 100nf cap to the RESET pin on the ATmega328 is essential as ATmega328 needs to be reset right before the upload begins, according to the Arduino bootloader design). The Arduino bootloader I used is the standard Duemilanove bootloader if this helps.

  9. INVINCI says:

    I am using arduino Duemilanove with cp210 i.c..
    its working fine with arduino platform but as i started working with different platforms such avr programer and robot c, i was not able to perform it…
    in robot c its even not detecting the device..
    will u please guide me if ther is any solution.

    • kwong says:

      CP2102 is just a USB to UART bridge, so whether or not it works with other platforms depending on whether the other platforms support UART. AVR programmers usually use the ICSP interface. I am not familiar with robot c, but if it works with an Arduino with FT232RL it should work with CP2102 as both are USB to UART converters.

  10. Paul Rowan says:

    I was having problems with a cloned MiniPro and a Cheap CP2102.
    I’d done the DTR to rst pin rewire to allow auto restart.
    RXD to RX1(on MiniPro) i.e. not swapped like FT232RL boards.
    Windows 7 Silicon Labs driver was installed as part of a professional project a while back although it worked fine as a USB to TTL board I had to load the 64bit 2013 driver for it to work with the Arduino IDE.

  11. veeru says:

    Hello Kerry,
    Very nice info regarding CP2102.
    I want to use arduino usbhost shield to grab data from a usb device with CP210x and send it via bluetooth. Will you be able to guide me to a solution regarding the same ?
    https://www.circuitsathome.com/mcu/hid-support-for-usb-host-shield-library-2-0-released
    thanks,
    Veeru

  12. rick says:

    Hi, thx for ur amazing diagram. but i’m confused about the polarity of the capacitor for the 100nF. im using an electrolytic capacitor. But i’m confused about the polarity….thx for reply!!

  13. […] in QFN-28 packaging, some people might find it slightly harder to deal with than TSSOP. Using the prototyping method I mentioned a few months back though, it is fairly straightforward to use the chip on a standard […]

  14. bill says:

    Hey, I was wondering, what is the ICSP?

    Thanks in advance.

Leave a Reply