DIY USB-COM adapter: diagram, device and recommendations. Null modem cable (RS232) wiring Selecting a device circuit and its computer modeling

Z-Duino assembly

So, let's begin. The assembly kit I won includes three bags.

One package contains connectors, a socket for the controller and the controller itself - ATmega328P, with a bootloader and the “Blink” sketch stitched into it. Another bag is filled with “loose”, among which there is a “bomb” button with a red pusher - for reset. In the third bag: a high-quality board and one of the LEDs. There are two of them in the set: green - for power supply, and yellow - for pin13. They are identical in appearance, and in order not to confuse them, the yellow one is packed together with the board, but nothing prevents us from soldering them the other way around.

The assembly took place in two stages. First I solder all SMD components

Then all output

I wanted the power selection jumper to be installed perpendicular to the board, so I bent the pins with pliers, soldered them and bit off the excess.

After assembling the board, I apply power: the green LED lights up, the yellow LED blinks. Okay, now we need an adapter for filling sketches. If there is a hardware COM port on the motherboard, then you can take a level converter on a MAX232 designed for this purpose or assemble it using transistors (as in Arduino Severino).

The transistor converter repeats the circuit from Arduino Severino, and for the adapter on the chip I chose MAX232CPE: instead of 10uF electrolytes, 100n ceramic ones are installed. Before mounting the microcircuit, you need to break off pins 7 and 10, or bend them to the side.

To use an adapter on transistors or on MAX, you need to apply 5V to the Z-duino board in any convenient way. I took it directly from USB and plugged it into the ICSP connector. The power selection jumper must be set to the 5V position.

Attention! If you burn something or cause any harm while implementing the ideas presented in this article, then you, and not the author of these ideas (that is, me), bear responsibility for the negative consequences. For example, in the example above, 5V from USB is supplied directly to the controller, bypassing the fuse and protective diode. Be aware of what you are doing, observe the polarity of the connection and do not exceed the maximum current that most USB connectors on the computer can produce, namely 500mA.

If there is no COM port, you can use a USB-COM adapter. I already wrote about an adapter for mega8 soldered on a homemade Arduino, there will be a photo and diagram of the adapter on a controller in DIP and in a TQFP package.

All signals provided by the converter are connected to the connector. In the diagram and drawings of the boards there are fuses of size 1206 in the 5V circuit from USB. I don’t have these, I don’t have SMD fuses at all, so I installed jumpers.

On two boards, RX and TX were swapped, I had to cut the tracks, solder jumpers, and the errors in the board drawings were corrected.

The implementation of a version of this adapter for ATtiny2313 is available on getchip.net.

In this topic, we will consider a selection of several amateur radio circuits that allow you to assemble a USB COM adapter, which is often used in measuring and medical equipment. An outdated but still relevant RS-232 serial port, also known as a COM port, is used to exchange information between a computer and a device. It is called sequential because data is exchanged bit by bit one at a time.


USB COM adapter to FT8U232BM

The base of the adapter is microassembly FT8U232BM. It supports all levels required by the COM port standard (DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI) according to the pinout.

To match the TTL levels of RS232 with FT8U232BM, 74HC00 microassemblies are used. The 93C46 chip is used to store the personal number (PID), manufacturer code (VID) and serial number of the device. Therefore, it can be excluded, but then only one device can be connected to the adapter, creating a virtual COM port. Computer driver reference documentation and drawing printed circuit board You can download it from the green link above.

Simplified version

It only supports signal circuits RX, TX, RTS, CTS. To match the levels, a fairly well-known MAX232 chip is used.

The PL2303HX is a nearly complete USB to RS232 converter. The design uses a MAX232 transceiver that converts the RX, TX levels.


There are two options for the USB COM chip adapter: new (var D 2012) and old (var A 2004). According to the reference book, their pinouts are different, so you need to check which version of the microassembly you have.

The PL2303 completely replaces the COM port, but most often only the Tx and Rx pins are used. To interface the levels between the USB and COM ports, I use the well-known MAX232 chip. It is needed because in a typical COM port the logical levels are 12 volts, while USB works with lower levels.

To work with the adapter, you need to install a driver for a virtual COM port in your computer's operating system; it can be downloaded from the link above.

To check the functionality of the circuit, you can close the contacts that convert the Rx Tx levels and send some data to the COM port, it should be returned. Excellent for port monitoring.

The Attiny2313 is powered by . The circuit only supports Rx and Tx control signals.


The firmware for the microcontroller, a drawing of the adapter printed circuit board, a terminal program for checking the device, a driver and fuses can be downloaded from the link above.

When you connect the interface to your computer, the message “Found new hardware” should appear. We install the driver using the standard algorithm and the entire device is ready for use. To check the functionality, briefly short-circuit the Rx and Tx pins and use the terminal program to set the COM port number and send any message. If the adapter is working, a message should appear in the program window.

  • Tutorial

Instead of an introduction

As usual, I suggest doing something strange - try connecting several old RS232 devices through one USB port using blue electrical tape and ingenuity. The article will not be long, rather it will be a description of what to get where and why to do all this at all.

For what?

This happens when some special hardware complex, consisting of separate devices and which performs some single functionality, suddenly begins to be modified. Of course, you can try to find a newer set of equipment, but in real life this is very rarely done. They begin to modify what they have. Sometimes thoughtfully, but more often as it turns out.

As a rule, the “brains” of such a complex is a computer with 100,500 RS232 outputs. Examples include a cashier's position in a supermarket, ATMs, and the like. I encountered the first case.

These computers are not very powerful, but they are incredibly expensive. Naturally, it no longer meets the requirements of modern technologies and many people come up with the idea of ​​​​replacing them with a regular PC and getting decent power at an adequate price, but it quickly turns out that RS232 on new PCs has died out as a class. Now this interface has become highly specialized. Accordingly, you either need to screw in a bunch of RS232 yourself or look for a ready-made special solution.

Of course, you can replace the equipment itself, but if you look at how much a stationary laser scanner from a decent company costs and multiply this price by the number of them, you will change your mind.

People who are not initiated into the topic immediately joyfully buy a bunch of Chinese USBtoRS232 adapters, and then everything goes very sadly. It's better not to do this. The second option is to purchase a specialized expansion board with a bunch of RS232. This option is already better and has the right to life, but it also has its drawbacks. For example, cost and problems with firewood if you are not using Windows or the wrong version. Also not an unimportant factor is availability in the future, since something breaks down and the park may expand in the future. Then it turns out that a specific model is no longer produced or is not available in a specific area, etc. In general, tying yourself to a specific device is always dangerous, especially if you don’t have to do it.

Let's try to do something

It may seem strange that primitive RS232 devices are so difficult and expensive to connect normally if, in fact, they usually have simple protocols and a primitive physical layer. And all because such hardware systems are usually used in commercial profitable areas and the purchase of equipment at such prices is justified, and the equipment itself has already become special. Special equipment = special price issue.

However, all this does not prevent you from trying to assemble your own budget bike. As a bonus, we will have the opportunity to change the behavior of such a unique RS232 multiplexer and completely bypass the problem of writing USB drivers. HID profile is supported almost everywhere.

High level

The second part of the software is examples and tests collected in a chaotic project written in Java by IDE IDEA. It is assumed that working with the device is integrated into the software high level Using various wrappers for working with the USB stack, depending on the language on the court, this software is written. Nowadays it is difficult to find such a language that there are no such wrappers for it. Separately for the old believers, I would like to note that java and usb are compatible if prepared correctly, this has been proven in practice and is used in a commercial project.

During the testing process, it turned out that the work in Linux and Windows with USB HID is somewhat different; the work was debugged through two libraries usb4java and hid4java. Working through the latter is used in Linux (Raspberry Pi 3).

The difference is that in Windows you can directly access a USB device even if it is registered as an HID and write/read its endpoints. In Linux, you have to work with a hid device. That is, the standard hid driver is installed and that’s it, please work only with it. Working this way is a little slower than directly, but directly it is also possible if you convince the system not to install drivers. It's real.

As promised, I’m not extending the article and not citing it detailed description code, those couple of people who are interested can look at the projects and play live, but for the rest I think it will be more useful to take note that there is such a solution and resort to a deeper study if necessary.

Conclusion

The presented device is just one example of how you can quite easily join the process of creating native USB devices and finally stop using adapters.

Don't forget to upvote

In modern computers and laptops, manufacturers have stopped using the COM port, which was widely used in the past. If you have an old computer that you purchased about 7 years ago, you may find several of these ports on it. The COM port was intended for connecting various external equipment, such as a mouse, printer, modem and others special means. Nowadays there are problems connecting various outdated equipment to new laptops or computers. For example, it is now quite difficult to connect a receiver, since you need to use a COM port for this.

What to do in this case? Of course, there is a way out. You can make a USB-COM converter yourself. How to do it? In this article you will find answers to your questions.

DIY USB-COM adapter

Now we will look at how to make a USB-COM adapter that will work with RX and TX signals. It will not work with other types of modem signals, but this is quite enough to connect standard equipment.
To proceed to assembly, you will need to purchase the following parts:

  • Two 10 nF capacitors and one 1 µF capacitor.
  • Two resistors are 27 ohms and one is 1.5 kohms.
  • Mini-USB and DB-9 connectors, one each.
  • Quartz 12.00 MHz.
  • PL2303HX.
  • Foil PCB for board 48*22 mm.

After purchasing these parts, you can proceed directly to assembly. First, we will need to look at the USB-COM adapter circuit (you can see the image below).

Assembling and setting up the adapter

There is nothing complicated about installation. First you need to take or make the board yourself. After this we drill four holes. Next, we need to solder all the parts, the location of which will correspond to the diagram. This completes the assembly.

To prevent the board from oxidizing, it must be covered with polyurethane varnish. If this is not available, you can use any other quick-drying car varnish.

It's time to move on to configuration. We connect our board to the computer. If everything is assembled correctly, it will determine the device on which you need to install drivers.

We install Prolific drivers for such a port on the computer. By going to the "Task Manager", you can see that it has been defined and is now fully functional.

Examination

To check the functionality of our adapter, you need to close the contacts near the COM port with some thin object (see the image below where this needs to be done).

Go to the “Connection Settings” section, where you need to select a COM port. In the new window you should configure the following parameters for our port:

  • signal transmission speed - 115200;
  • data bits - 8;
  • parity - no;
  • stop bits - 1;
  • flow control is not.

Next, confirm the changes by clicking on the OK button. After this, the connection should be started. Let's switch to the English layout and type any words in the program. All the symbols you clicked will appear on a white background.

If this does not work, that is, the words are not displayed, you need to change the installation. We configure it until the symbols are displayed.

That's all. You can release the contacts that you were pinching and start using the USB-COM adapter.

USB RS232 DB9 COM adapter cable

If you can't make your own adapter, you can purchase USB RS232 DB9 COM. Its price varies within 1000 rubles, and it has quite good technical characteristics. Probably the main thing is a good connection speed. It is also supported by almost all operating systems. Unfortunately, it only works with USB 2.0.

Connecting to a computer

To connect the USB RS232 DB9 COM adapter to your computer, you need to find drivers on the Internet that are suitable for your operating system. Download and unpack them. We connect the adapter to the computer, and then indicate where the drivers are located. If everything was done correctly, the LED on the device will light up, indicating it is ready for use.

Possible problems

Unfortunately, even if you use a purchased USB-COM adapter cable, problems may arise. It is necessary to fight them, and this is not difficult to do.


Alternative solution to the problem

If you need to install additional equipment that requires a COM port, you can also use a module with this connector. It simply installs directly into the computer and connects to the motherboard. After installing a COM port card or PIC-COM (second name), it is also assigned a number. As in previous cases, this number can be changed if problems arise. If you are not sure that you can install this board correctly in your computer, it is better to use the help of professionals so as not to harm other equipment.

Unfortunately, this solution can only be used on computers. In laptops, installing an additional card is quite difficult, and this requires additional costs. Firstly, the case itself will not allow you to install an additional module, and secondly, it may not be supported by your model. Therefore, in the case of a laptop, you should use a USB-COM adapter.

Conclusion

If you need to connect older equipment that requires a COM port, you can make your own adapter. It's pretty simple. If you don't want to do this, you can purchase a USB-COM adapter. Its price is about 1000 rubles. Remember that you will still have to install drivers and check the functionality of this hardware. It is quite easy to install a USB-COM adapter on Windows 7, since all drivers for this operating system can be found on the Internet.

A null modem cable is a very necessary thing in the satellite industry. Primarily for flashing satellite receivers. But you can’t always buy it, so you have to make it yourself.

As I already said 0-modem cable It will be useful to us primarily for flashing the firmware of satellite receivers. And if for this you can use a short one, which is easier to buy, then for cardsharing through a computer you almost always need a long or very long one (I’ve done it up to 15 m). And it’s better to solder this one yourself. And it is done quite easily.

How to do it yourself null modem cable (RS232) cord for do-it-yourself tuner firmware?

We will need two DB-9F connectors, a soldering iron, solder, a twisted-pair cable, which for me is just right (you can also use another telephone you have on hand), circuits and skillful hands.

There are several connection options, but most often you need a three-pin cable. Well, if this doesn’t work, then we make a complete one for all contacts in accordance with the pictures below.

A non-zero modem cable is almost always suitable. But he also has variations when his contacts go

Contacts 2 – 2 and 3 – 3, 5 -5 direct

Contacts 2 – 3 and 3 – 2, 5 – 5 not direct

It is the latter, indirect, that is most often suitable.

The wiring of the rs-232 com port in satellite receivers can look like both “father” and “mother”.

“Mothers” are much more common, so I advise you to do it with two “mothers” at the ends.

Precisely indirect null modem cable with two mothers, and with a right-to-left calculation, suitable for flashing the firmware of most satellite receivers, or for sharing.



Read also: