
Introduction
This blog entry is just a summary of the most basic configurations of the CP2102N USB to TTL chip as well
as a description of a playground board design that exposes all pins of the CP2102N to the outside for evaluation
purposes and in addition provides functionality of a half duplex RS485 bridge. The CP2102N is one of the most robust
and simple to use (especially also on the software side) chip that I encountered up until now - and it provides all
features one would require for simple devices. Itâs a very versatile device that can be customized so the
described usage only represents a small subset of whatâs possible. The CP2102N supports USB 2.0 full-speed
which is sufficient for microcontroller applications under most circumstances. The device requires no external clocking,
supports data transfer at up to 3 MBaud, requires only small operating current and can be run either bus
powered or device powered depending on the application. In addition the CP2102N also supports chargers
with information about available bus current and presence to implement battery charging
in a simple way.
In addition the manufacturer provides a customization tool that allows one to change the VID/PID instead of
using the default one (the biggest drawback is then that you need to provide your own mappings in the devd
or devfs
configuration or even need to write your own signed device drivers on some more obscure operating
systems (like MS Windows)). In addition to standard UART operation the device also supports triggering an external
half duplex RS485 driver like the MAX485 by just setting a single bit so one can build a two component low cost
RS485 interface using the CP2102. Contrary to other cheap solutions each device has a unique serial number that
can also be customized using the manufacturer supplied tool which allows one to distinguish the devices when
assigning device links. On top of all that the device - when using a custom driver - offers 7 freely usable
GPIO pins; in the usual configuration they are used to drive TX/RD LEDs, the RS485 TX/RD switch and support the
transmission of a wake up signal to a suspended host via. The other 3 GPIOs are unassigned by default. Note
that the default configuration also does not enable the LEDs as well as the RS485 feature. You have to enable
those via the configuration utility!
In contrast to some chips like the famous FTDI USB to serial adapters the CP2102 are easier to use - also from
the software side since they are delivered as standard communication class device so there is no additional
driver installation required. One can still distinguish the devices (and assign them specific alias in the devd.conf
by identifying them by serial number which is unique for the CP2102).
The power supply and USB side
The first thing to consider when using the CP2102 is the way the device is powered. There are three main
paths one can take:
- Power the device and the CP2102 via the USB bus and use the internal 3.3V regulator to supply up to 100 mA
by the internal LDO to the application circuitâs 3.3V rail. In this case one has to connect the bus power
to the regulator input and use
VDD
(with a decoupling network) for the application circuit.
- Power the CP2102 and the application circuit by some other means (external power supply, etc.). In this case
the bus power supply only has to be attached to
VBUS
. REGIN
and VDD
have to be attached
to the application circuits 3.3V rail.
- In case one hasnât got any 3.3V rail available one can also supply the LDO with 3.6 to 5.25V via
the
REGIN
pin.
In any case the reset pin has to be pulled up with a $1k\Omega$ resistor to VDD
. Itâs also good practice
to connect the bus voltage to VBUS
via a voltage divider. Since VBUS
is used only to detect presence
of an USB host this still works but clamps the voltage seen by the CP2102 to stay within allowed absolute maximum
limits even when the device itself is not powered by the application circuit. This is of course not required
but not a problem anyways when powering the application directly from the LDO of the CP2102.
Often not mentioned one should add a proper TVS diode to each of the bus lines. A quad array like the TPD4E02B04DQA
might be a good idea. One usually forgets those but this provides additional protection against voltage surges
and static electricity. Iâve personally already lost 3 CP2021N by high voltage spikes in a lab when arcing occurred
on another power line. Adding TVS diodes prevented any further faults. They donât cost much and may safe your
whole device. Use them.
All power lines (REGIN
and VDD
) have to be properly decoupled. For REGIN
this could be
a $1 \mu F$ and $100 nF$ capacitor, for VDD
a $4.7 \mu F$ and $100 nF$ capacitor in parallel. One has
to adjust this to ones own needs of course.
Thatâs already the most basic way of using the CP2102:

In this circuit the GPIO pins 0 and 1 have also been attached to LEDs that indicate transmission and reception
of data. This might be nice especially in an experimental environment - but is entirely optional of course. One
can also reconfigure the GPIOs for other purposes or just leave them unconnected.
The two solder jumpers allow to select how the device should be powered.
JP1 1-2 |
JP1 2-3 |
JP2 |
Power mode |
CP2102 bus powered |
Application bus powered |
Open |
Open |
Open |
Wonât work, device and regulator not powered |
 |
 |
Open |
Open |
Closed |
Wonât work, not specified since the regulator input is floating |
 |
 |
Open |
Closed |
Open |
Wonât work, regulator input and VDD donât get power from anywhere |
 |
 |
Open |
Closed |
Closed |
The device is powered by the application circuit at 3.3V, bus power is not used |
N |
N |
Closed |
Open |
Open |
The device is bus powered, the application is not powered by the bus |
Y |
N |
Closed |
Open |
Closed |
The device is bus powered, the application draws its supply from the 3.3V LDO of the CP2102 (bus powered) |
Y |
Y |
Closed |
Closed |
Open |
Wonât work, bad idea |
 |
 |
Closed |
Closed |
Closed |
Wonât work, bad idea |
 |
 |
The charge control pins
The CP2102 offers another nice feature. The pins CHREN
, CHR0
and CHR1
are especially interesting
when one wants to charge batteries via an external charge controller. After the CP2102N performed negotiation
on the USB bus they signal if and how much current a charger may draw.
- In case only
CHREN
goes high one may draw at most 100 mA from the bus
CHR0
signals capability of drawing up to 500 mA
- And when
CHR1
goes high one can draw up to 1.5A
More interesting features
- One can use the CP2102 as clock source up to $24 MHz$
- When enabled the remote wake up pin allows the device to wake up any host that allows waking up by an USB device
- The RS485 pin can drive an half duplex drivers receive enable / transmit enable pin (for example on an MAX485)
to build simple RS485 half duplex interfaces
- The suspend pins allow the host to perform power management on the application circuit. Whenever the device
should enter suspend mode the CP2102 asserts both suspend lines (they should use a $10 k\Omega$ pull-down to prevent
floating while powering on)
A simple USB to TTL and USB to RS485 board
As the most simple example lets take a look at a very simple USB to TTL and USB to half duplex RS485 board.
Of course boards just offering USB to TTL serial conversion can be bought very cheap on common
merchant platforms - but itâs a good learning exercise and supporting RS485 is less common
on such boards. This board has been designed around the CP2102N as well as the MAX485E - contrary
to the small boards sold on most platforms all I/O pins of the CP2102N have been exposed via a pin
header so the board is rather bulky. This has been done to provide a playground for GPIOs, provide
access to the flow control pins and allow access to the charge control pins during evaluation
of the chips. Itâs more of a playground than a practical implementation. The only assumptions
that have been made are:
- The device is bus powered
- GPIO0 and GPIO1 are used for RX and TX LEDs
- GPIO2 toggles the MAX485E between receive and transmit states.
The schematic
All design files are provided in a GitHub repository.
The schematic design is pretty simple:

- At the USB input side it uses an USB B socket (
J1
). On the board a USB 2.0 B
socket has been used since itâs compatible with most existing USB installations
and cabling out in the world as of today. Of course one could consider an USB 3.0 B
connector for new designs though the speeds utilized by the CP2102N do not reach
anywhere in the USB 3.0 regions.
- As recommended in the datasheet a TVS diode has been added. The used
TPD4E02B04DQA
has been used though this has been designed for USB-C devices. As one can see only
three of the diodes are in use, the forth is just tied to ground. This is also
the hardest part to solder due to the very small package size.
- The USB 5V rail is supplied to
REGIN
as for a bus powered device. Two
decoupling capacitors ($1 \mu F$ and $100 nF$ are provided as close to the chip
as possible).
- The 5V rail of the USB socket is also divided via a voltage divider before being
fed into
VBUS
. As mentioned above this is not required for a bus powered
device but keeps the device in absolute supported margins when providing power
via the application circuit. Even though this is not possible on this board adding
those resistors does not hurt (when oneâs not designing in industry scale
where every small saving in material cost helps).
- The reset pin is just pulled to the 3.3V rail via a $1 k\Omega$ (or on some
of my built boards using a $10 k\Omega$) resistor.
- The output of the on-chip 3.3V regulator is decoupled again via two
$1 \mu F$ and $100 nF$ capacitors.
- GPIO.0 and GPIO.1 are used as open collector outputs to drive the RX and
TX LEDs from the 3.3V rail. Since the LEDs have a voltage drop of around 1.2V
the remaining 2.1V determine the current - when using a $100 \Omega$ resistor
this yields a current of around $21 mA$ for the LEDs. One can also use larger
resistors (in my implementation I just used the $120 \Omega$ resistors since I
had a bunch of them at hand which did not really change the current in any
noticeable way - running at 17.5 mA doesnât yield a visible noticeable effect
for most cheap LEDs)
- The jumpers
JP1
and JP2
allow one to select between RS485 and
TTL operation.
- When set to position 1 the RX and TX of the CP2102N is fed into
the pins of the MAX485E. The output of the MAX485E is divided via a simple
voltage divider to reduce itâs voltage from the 5V domain down into the 3.3V
range. The voltage divider is sufficient for the speeds supported by the
two devices anyways.
- When set to position 2 the RX and TX pins are directly fed to the TTL screw
terminal
- The MAX485E is fed directly by the 5V rail of the USB connector. In addition
separate decoupling capacitors are used for the MAX485.
- To allow selection of bus termination for the RS485 network (which should usually
only be done at itâs edges) one can use the jumper
JP3
to add a $120 \Omega$
termination resistor between A and B line.
- Supply voltages are supplied also at the screw terminals.
- All other signals of the CP2102N are routed to a huge 16 pins pin header that is
of course optional.
Component list
The following table contains a list of all components Iâve personally used
to build such boards. Most of them (like resistors, capacitors and terminals) are
freely interchangeable. Capacitors are all metal film capacitors, resistors thick
film resistors - for them there had been no particular reason to choose them except
for a roll of them having already been kept on stock.
Identifier |
Mouser Nr. |
Manufacturer number |
Component Description |
U1 |
595-TPD4E02B04DQAR |
TPD4E02B04DQAR |
ESD suppressor / TVS diode array |
U3 |
700-MAX485ECSA |
MAX485ECSA+ |
MAX485E RS485 interface (half duplex) |
U2 |
634-CP2102NA02GQFN28 |
CP2102N-A02-GQFN28 |
CP2102N USB interface |
R1, R6 |
603-AC0805FR-0724KL |
AC0805FR-0724KL |
$24 k\Omega$ resistor, 0805 package (any type will do) |
R2, R7 |
603-AC0805FR-1047KL |
AC0805FR-1047KL |
$47 k\Omega$ resistor, 0805 package (any type will do) |
R4, R5, R8 |
603-AC0805FR-07120RL |
AC0805FR-07120RL |
$100 \Omega$ resistor in schematic, used $120 \Omega$ due to them being on local stock; R8 has to be $120 \Omega$ (any type is ok) |
C1, C3, C5 |
581-08055C105K4T4A |
08055C105K4T4A |
$1 \mu F$ capacitor, 0805 package (any type will do) |
C2, C4, C6 |
581-08055C104K |
08055C104KAT2A |
$100 nF$ capacitor, 0805 package (any type will do) |
D1, D2 |
593-LSM0805412V |
LSM0805412V |
Standard 0805 packaged LED. Any generic LED is usable. |
J1 |
710-61400416121 |
61400416121 |
USB B connector by Wurth |
J2 |
 |
 |
2.54mm pitch 2x8 pin pin header |
J3, J4 |
 |
 |
2.54mm pitch 4 pin screw terminal |
JP1, JP2 |
 |
 |
2.54mm pitch 3 pin pin header |
JP3 |
 |
 |
2.54mm pitch 2 pin pin header |
The PCB
The board layout is also rather simple.
- It has been decided to use simple 0805 parts for resistors and capacitors wherever
possible. Those parts can be soldered by hand. I personally prefer using reflow
paste since itâs used for other parts of the board anyways and yields nicer
looking boards and usually better solder connections when not exposed to mechanical
stress (like for connectors)
- The MAX485E has been used in a SOIC-8 package. Those packages can be soldered
by hand using a traditional solder iron with some practice though I personally
prefer using reflow for this kind of stuff.
- Connectors are through hole technology (THT) parts. Those should be soldered
either with traditional soldering iron and solder wire (which is more likely
for the hobbyist) or Gallium wave soldering (more likely in the professional
environment). Iâve chosen THT over SMD connectors due to the fact that the
boards are not automatically assembled via a pick and place machine and
due to their way higher tolerance to mechanical stress when connecting
and disconnecting (who hasnât ripped off SMD connectors before?)
- The CP2102N comes in a QFN-28 package. This is a surface mounted package that
has itâs pad completely hidden below the package. Though there are some tricks
with massive amounts of flux and traditional solder that require much skill
and investment of time. Iâd personally say this is the point where one really
wants to perform reflow soldering when not wanting to play around but achieving
good results.
- The
TPD4E02B04DQA
TVS diode array is the most challenging part to solder
on this board. The array is provided in a USON-10 DQA
package. This has
$500 \mu m$ pitch of pads hidden below the package of the device. Reflow soldering
this part is very simple. Soldering in any other way very tricky, nearly impossible
as well as error prone and time consuming. Of course the TVS diodes are optional
and can be left out - but one will loose ESD protection in this case.
As for any more complex board routing directions for top and bottom layer have been
chosen to be (nearly) orthogonal (horizontal routing on the back side, vertical routing
on the top side). Again the design goal was not the most compact board but a working
and simple to assembly playground.

The PCB has then been ordered at PCBWay. Note that
this board does usually not qualify for the cheapest option since the package
of the TVS diode array is not possible with $6/6 mil$ option. When leaving
out the TVS array the board is simple and cheap though. Just use default options,
choose a color for your silkscreen and upload the ZIP file provided in the GitHub
repository or ZIP up all exported Gerber files from KiCad (make sure to follow
the guidelines provided by PCBWay).
PCBWay manufactures your PCBs in around 24 hours and ships them very fast.
As usual for this manufacturer PCBs arrived pretty fast:

The PCBs have then been first reflow soldered with a heat gun - first the capacitors
and resistors, then the TVS diode array, the CP2102N and then the MAX485E. The
last element that has been added on the surface had been the LED. After that
the THT components have been added (first the screw clamps, then the pin headers
and jumpers and in the end the bulky USB connector).

At the end the PCBs have been cleaned in an ultrasonic Isopropyl alcohol bath
for 10-15 minutes to remove any residues of the reflow soldering paste. This is usually
a good idea for electronics devices (as long as theyâre not damaged by ultrasonic
sound like quartz resonators and some plastic parts for example)
First test
As the absolute first test the PCB has been attached to the USB port and the dmesg
output has been observed. Then one should see the attachment of an CP2102N
device
in the kernel log.
One can then directly use any terminal application or software to transmit and receive
data with arbitrary Baud rates via the TTL port when jumpering correctly. Neither the
LEDs nor the RS485 port will work (the latter one at least not bidirectionally - the MAX485E
will permanently drive the A/B line pair) at this point in time. This is caused by
missing configuration of the chip. To test the receive part one can simply connect
the center pin of both mode selection jumpers. This will echo any written data back
into the device.
Configuring the chip
To configure the chip one requires Simplicity Studio by
Silicon Labs. The old standalone configurator doesnât work for the N series of the CP2102.
You have to register for an account and download a pretty huge archive. After that
one has to log in into the application. The easiest way to download the correct
SDK is by attaching a device and letting the application figure out which components
to download. Then one can launch the new Xpress Configurator
from the menu.
The first thing to configure are the basic device configurations:

One can assign any product and vendor ID - keep in mind that then you have to
provide your own devd
or devfs
configuration or even own device
driver (for MS Windows using masochists). One can also freely choose the manufacturer
string and the serial as well as the announced required bus power. One might be
tempted to write a custom serial - the easiest way to guarantee a unique serial
is using the internal serial number though. In this case the serial exposed will
be calculated from a unique 128 bit number unique to the given chip. For this
board one should also announce that itâs bus powered and configure a proper maximum
power usage which depends on the application circuit upstream. When using more
power one should also use the charge control pins to trigger power supply to the
application circuit.

The next configuration group are the port settings for all I/O ports of the
CP2102N.:

Here one can decide on the modes as well as latching of the I/O pins. Usually
defaults are what one needs when one doesnât know better for a simple USB to
TTL conversion board. The GPIO configuration though will require some tweaking
to enable RX and TX LEDs as well as the driving of the RS485 half duplex transmission
enable pin on the MAX485E:

The last configuration option configures the virtual serial port. Here one
can configure the maximum allowed Baud rate, a set of supported Baud rates (when
selecting User Programmable any Baud rate up to the maximum rate can be used independent
of other selections)

Keep in mind that RS485 mode switching is only supported for Baud rates larger
or equal to 300 bps so itâs a good idea to limit the supported Baud rates
to default ones larger or equal to 300 bps. The supported set of data, stop and parity
bits depends on the particular application. Application software is only
capable of setting modes that are enabled on the device.

Now one can simply select Program To Device
- thatâs it for small series
of devices. When building a larger number of devices one can use the SDK provided
by Silicon Labs to write automatic configuration scripts that can program devices
while being transferred through the production line.
Second test
The last initial test carried out on the device has been RS485 mode. Simply jumper
the jumpers accordingly and start the data transfer. One will see that during
transmission the device always enables the RS485 line driver. After all data has
been transmitted the driver goes low again.
Note that all links in this section are Amazon affiliate links. This pages
author profits from qualified purchases
Which tools have been used in construction of this board? Since the board contains
reflow solder parts it has been convenient to use:
- A cheap heat gun like the 858D where you can reduce
the airflow and temperature low enough. Donât try to use your hardware stores
heat gun - they just provide way too much airflow to solder effectively.
- Reflow solder paste like the EO-FLP-005 which
reflows at low temperatures (the EO-FLP-005 flows at around 138 Celsius).
- Some anti statics ESD pliers
- Some ultrasonic cleaning bath to remove any residue
of flux or solder paste
- Isopropyl alcohol for cleaning in the ultrasonic
bath. You might want to use Nitril gloves when
handling alcohol especially when using larger amounts.
This article is tagged: Tutorial, Basics, Electronics, DIY, RS485