Silicon Laboratories CP210x Serial Communications Guide

Application guide for developers using the CP210x USB to UART Bridge Controller, covering COM port setup and data transfer.


Silicon Laboratories CP210x Serial Communications Guide - cover page
Brand
Silicon Laboratories
Category
Other Electronics
Document type
Application Note
Language
English
Pages
13
File format
PDF
File size
1.4 MB
Published
30 November, 2026
Updated
30 November, 2026
MD5 checksum
06F915C952A22479937A40C823F944EF

About this manual

This application guide is for developers creating products based on the CP210x USB to UART Bridge Controller. It explains how to obtain the port number for a specific CP210x device and provides code samples for opening, closing, configuring, reading, and writing to a COM port.

The guide walks through opening a COM port with CreateFile(), purging it with PurgeComm(), saving and restoring its original state with GetCommState(), and configuring a DCB structure for baud rate, parity, byte size, and stop bits. It also covers writing data with WriteFile() and includes a GetPortNum function that determines the port number using the device's Vendor ID (VID), Product ID (PID), and serial number.

What's inside

  • Introduction
  • Opening a COM Port
  • Preparing an Open COM Port for Data Transmission
  • Purging the COM Port
  • Saving the COM Port's Original State
  • Setting up a DCB Structure to Set the New COM State
  • Transmitting Data Across the COM Port

Specifications

Baud rate57600 bps
ParityNOPARITY
Byte size8 data bits
Stop bitsONESTOPBIT
Supported devicesCP2101, CP2102, CP2103, CP2104, CP2105, CP2108

Frequently asked questions

Which CP210x devices does this guide apply to?

The guide applies to the CP2101, CP2102, CP2103, CP2104, CP2105, and CP2108 devices.

How can the port number of a CP210x device be determined?

A GetPortNum function is included that determines the port number using the device's Vendor ID (VID), Product ID (PID), and serial number.

What baud rate is used in the example configuration?

The example sets the baud rate to 57600 bps, though any baud rate supported by the CP210x can be used.

Download PDF (1.4 MB)

More Silicon Laboratories Manuals


View all Silicon Laboratories manuals →