Modification of the usb uart converter on the cp2102 chip. Using a usb-to-com adapter to connect a car's ECM controller to a PC

In an environment where modern computers are rapidly losing COM ports, a USB converter<->COM is a very useful and necessary thing for radio junk dealers. But also a USB converter<->UART is also a useful and necessary thing. Naturally, I wanted to have both, and something else, and not have it all be too expensive.

Buying or assembling any of these gizmos is not a problem today. There are a lot of schemes on the Internet, and a lot of devices in stores. However, as it turned out, you can only buy them separately from each other! And this despite the fact that all the USB converters I reviewed<->COM convert signal levels first to TTL, and only then to RS-232. Of course, none of these solutions suited me in terms of versatility. Why will I buy a USB converter separately?<->UART, if it is already included in USB<->COM? Thinking like this, I decided that I didn’t have any extra money and the best solution will make your own universal converter.

The well-known cp2102 microcircuit was taken as the basis. Firstly, it allows you to emulate a full-fledged COM port (all lines, not just Rx, Tx), secondly, it has a minimum body kit and allows you to make a board of minimal dimensions, and thirdly, it turned out to have the most attractive price . The converter circuit was taken practically unchanged from the datasheet for this microchip; I just cut it in half so that, if necessary, I could separate USB to UART from UART to RS-232.

USB to UART converter circuit:

UART to RS232 converter circuit:

In the end, it turned out not even two (as originally planned) but three devices in one. Both parts of the developed device can be used as independent USB converters<->UART and UART<->RS232 (it’s a pity that the latter requires external power). By connecting the two parts together, we get a USB converter<->COM. To interface the parts of the converter, I used IDC-14F and BH-14 connectors, which, with proper wiring, are very successfully soldered to double-sided boards (you can see exactly how in the photo below).

Photo of the finished device:

The only difficult moment is soldering the cp2102 microcircuit, since it is produced in a QFN package. You need to solder it with a hairdryer, having previously tinned the soldered contacts on the microcircuit and the pads on the board. In this case, it is not at all necessary to use any special expensive fluxes. Regular pine rosin is sufficient, but it needs to be dissolved in alcohol and then applied to the areas with a syringe or a special brush. If there is no alcohol, you can dissolve rosin in vodka, but in this case you will have to wait a little after applying the solution, since water evaporates much worse than alcohol.

The USB connector is specially connected to the board with a flexible wire, and not hard-soldered to it. As practice shows, such converters are very often used to connect various converters (COM to HART, COM to RS485, etc.) to a computer, and when a USB connector is hard-soldered, it is the connector that most often breaks off, unable to withstand the weight of all the equipment connected to the converter.

Separately, I would like to dwell on the issue of choosing capacitors. The datasheet shows power supply capacitor ratings of 4.7 µF and 1 µF. Often, to save space on the board or for some other reasons, smaller capacitors are installed instead. Again, as practice shows, this can lead to instability of the power supply of devices connected to the converter (which do not have external power and must be powered from the COM port) and, as a result, to their inoperability.

Review of USB to UART TTL converter on CP2102

Why is it needed?

Program various Arduino and non-Aduino controllers, receive information to the computer from everything that has a serial interface with TTL logic.
I use it in my projects with , and .

How is it different from other similar devices?

An additional DTR pin, which can be directly connected to the RESET input on controllers that do not have USB on the board. After this, there is no need to press the RESET button during programming. This is very convenient for me when the controller is hidden in the depths of my craft and access to the button can be very difficult.

Manufacturer support, compatibility with original drivers and software, unlike fake FTDI, which

Additional pins (holes for contacts) on the board, for example, allowing you to put USB into energy-saving mode.

An interesting opportunity is to change the VID, PID and text with which the board is recognized, to assemble your own driver with the required parameters, which is quite interesting in commercial projects. I will talk about this further.

For those who are interested, please click below

I ordered a lot of small things from Ebay for a reward for a review, including for $1.79

The goods traveled for 54 days. Well, I’m already used to our mail, which can’t be said about the dollar to ruble exchange rate (((

Regular yellow package. Inside are the scarves in sealed transparent bags. Everything is as usual.

The board has additional holes where you can solder pins for additional modem control and switching USB to SUSPENDED mode

Characteristics

  • Chip CP2102 from
  • Data exchange rate via UART 300Bit/sec - 1Mbit/sec
  • Read buffer 576 bytes, writes 640 bytes
  • Support USB 2.0 12Mbps
  • SUSPENDED USB mode support
  • Built-in power regulator 3.3V 100mA
  • EEPROM with configuration parameters 1024 bytes
  • Supported OS Windows 8/7/Vista/Server 2003/XP/2000, Windows CE, Mac OS-X/OS-9, Linux, Android
  • Ability to customize board and driver parameters for your projects
  • Board dimensions 26.5 x 15.6 mm
The size of the board differs little from
The photo shows a comparison with other USB/UART converters



Before using the board, you must install

To connect to the controller you need 5 wires:
GND - GMD
VCC - V5.0 (V3.3) depending on the board used
TX - RX
RX - TX
RESET controller - DTE


Now the controller can be programmed without pressing the RESET button.

The board is recognized in the system as
Silicon Labs CP210X USB to UART Bridge (COM35)

Sometimes in commercial projects it is necessary for the device to have its own commercial name when programming. The CP2102 chip and the board on it provide great opportunities for this

First, download and run "> (to launch the utility I also needed to download Java Runtime)

You can now change the following settings:

  • Vendor ID (VID). Manufacturer ID. The default value is 10С4 (hexadecimal format). In this case, it belongs to SiLabs.
  • Product ID (PID). Product ID. The default value is EA60 (hexadecimal format). In this case it refers to all CP210x bridges. E
  • Max Power. The maximum current consumption requested by the bridge on the USB bus. The default value is 32 (hexadecimal format). Maximum value 500mA
  • Power use attributes. Diet. Bus-powered (USB bus power) or Self-Powered (power from an external source).
  • Release Version. Issue number. The default value is 1.0. Fields can take values ​​1-99 in whole and fractional parts.
  • Serial Number. Serial number. The default value is “0001” (text format). The field can accept any text value up to 64 characters long. Needed to connect multiple devices to a computer
  • Product string. The field can accept any text value up to 126 characters long. This identifier is displayed in the operating system when the CP210x bridge is first connected to the computer and helps the user in choosing the appropriate driver.
  • Custom Data Lock. Protecting configuration data.

When changing VID and PID, it is necessary to rebuild the drivers, since the standard driver is configured for VID and PID Silicon Labs

And after a simple dialog wizard we get a driver distribution with the required set of VID and PID and the desired name in the system

Bottom line

This board is one of the cheapest USB/UART converters that do not use counterfeit chips.
Has a DTR pin that allows you to automatically send RESET to load software into the controller
Allows you to customize VID, PID and drivers for your projects
I recommend to buy

The UART interface is supported by almost all microcontrollers and is very convenient when developing and debugging all kinds of microcontroller devices: upload the firmware via the bootloader, and view the debug logs of the device on the computer. But, alas, in modern computers the COM port is gradually disappearing from the list of available interfaces, being replaced by the USB bus, and even more so in laptops. This made me puzzled about the issue of making a USB -> COM adapter. Typically, such adapters are made on the basis of the popular FT232 series microcircuit, but it has a couple of disadvantages: 1) the cost of the microcircuit is ~150 rubles 2) microscopic dimensions with all the ensuing difficulties in soldering and manufacturing printed circuit board.

As an alternative to the FT232, the lesser-known CP2102 was discovered, which costs half as much, has half the size, and even has a QFN-28 body (5mm x 5mm). This chip is a completely ready-made USB-UART converter that does not require any external wiring (a pair of filter capacitors on the power bus does not count) and has the following capabilities:

  • Compliance with USB 2.0 specification, full-speed (12 Mbps)
  • integrated 1024 byte EEPROM for storing manufacturer ID, product ID, serial number, device descriptions, etc.
  • virtual RS232 speed from 300 bps to 1 Mbits
  • support for data transfer formats 5, 6, 7 and 8 bytes of data; 1, 1.5 and 2 stop bits, various parity checks
  • receiver buffer - 576 bytes, transmitter buffer - 640 bytes
  • built-in reference frequency sources, built-in 3.3V stabilizer
  • Drivers for Windows Vista/XP/Server 2003/2000, Linux, Mac OS-X / OS-9

Scheme

The adapter circuit is taken from the datasheet, the optional peripherals have been discarded and an LED has been added to indicate the presence of power.

The DB9 plug is wired similarly to the output of a computer's COM port, here is its wiring (the direction of the signals is indicated relative to the computer).

The main problem of designing the adapter - the problem of the printed circuit board and installation of QFN-28 was solved by gluing the microcircuit upside down to the printed circuit board and soldering its pins with 0.1mm PEV wire. Somewhat dreary, but miniature. Here's what happened as a result:


And in the DB-9 case everything looks like this:

Drivers

Now, having carefully checked the installation, you can test. The device was detected by the system but windows drivers I couldn't find it. I downloaded them. After which a new port appeared in my system - COM5 in Windows and /dev/ttyUSB0 in Linux. Now, by connecting RXD to TXD (2nd and 3rd pins of the adapter plug) and launching any COM terminal, you can make sure that bytes are sent.. and received.. and the latter coincide with the first..

One important point: the signal levels at the output of the adapter are TTL and differ from the signal levels of the standard RS232 interface, therefore, ordinary devices for the COM port cannot be connected directly to the adapter; moreover, this may damage the adapter. To connect standard COM devices, you need to add a level converter on the MAX232 family chip.

Below you can download the project in Eagle, as well as the finished PCB drawing for laser iron(to iron a double-sided printed circuit board, I recommend printing the design on tracing paper).

The RS232 port adapter for the universal serial bus (USB to UART Bridge) is a high-speed USB device designed for connecting peripheral devices that comply with the TIA/EIA232 standard.

The adapter is based on the Silicon Labs CP2102 controller and is intended for use in systems equipped with a USB bus. Connection of peripheral devices is carried out using a standard DB9 connector.

  • USB 2.0 specification support;
  • full set of RS232 interface signals;
  • RS232 signal amplitude is not worse than ±5.5V;
  • USB bus powered.

Installing and connecting the adapter

  1. Before installing and connecting the CP2102 adapter, make sure that external devices are de-energized and connected to the ground loop.
  2. Then, connect external device to the DB9 connector.
  3. Install the adapter into a free USB connector, visually checking the fit of the contact pads until they stop in the connector.
  4. supply voltage to the I/O device, the system is ready for operation.

When installing the CP2102 adapter, please note that the USB specification allows for hot plugging, but does not apply to peripherals Serial I/O. When working with the adapter, you must connect only de-energized peripheral equipment! Failure to follow these rules may result in failure of the computer system components!

Installing a driver based on Windows operating systems

After connecting the CP2102 adapter to the USB connector in an operating environment Windows systems 2K/XP it is detected as follows:

Now you need to download the CP210x USB to UART driver. Let's start installing it:

During the pre-installer operation, the user can specify the directory in which the device drivers will be stored CP210x:


If operating system will request information about the location of device drivers, the user will be required to specify the path to them. The software model of the CP2102 adapter consists of a composite device and a USB to UART bridge, each of which is described by its own inf-file.

Therefore, during the automatic detection process, the operating system requests both files sequentially.

Adapter drivers must be offered to the system for installation from the directory specified during the pre-installation process, unless otherwise provided by the user. Initially, the operating system installs drivers for the USB Composite Device:

If the current version USB drivers The Composite Device is not supported by a Microsoft digital certificate and the user is warned about this by the following message:

The path to the files necessary for the composite device is selected based on the pre-installation conditions:

The next stage of installation is the USB to UART bridge drivers. As in the previous step, automatic installation is recommended.

If the current version of the USB to UART Bridge Controller drivers is not confirmed by a Microsoft digital certificate, the user is warned about this with a message. The path to the necessary files is selected based on the pre-installation conditions:

After installation, the CP210x USB Composite Device universal serial bus controller and the COM3 serial port, implemented using the CP210x USB to UART Bridge Controller, appear in the system properties, and the list of devices takes the following form:

That's it, the driver is installed!