What is a COM port? Device controlling COM port

The COM port, or serial port, is a bi-directional serial interface that is designed to exchange byte data. At first, this port was used to connect the terminal, and then for the modem and mouse. Now it is customary to use it to connect an uninterruptible power supply, as well as to communicate with the hardware of processing embedded computer systems.

Using

So, before you talk more about what a COM port is, you need to look into the past to understand its meaning. Just 15 years ago, a method was used to connect devices to a computer using a special standard connector located on the back of the system unit using a special serial RS-232 cable. This method has many disadvantages. Such a cable, by modern standards, provides an extremely low data transfer rate of about a hundred kilobits per second. In addition, when the physical connection of the connectors was made, it was necessary to turn off the equipment, and they themselves were attached to each other with screws that provide reliability, while their dimensions were considerable.

COM port

A bit of history

The COM port on computers of that time traditionally bore the number 1 or 2, since usually there were no more than two of them. It was possible to install additional ports, if necessary. When the user set up the software, it was necessary not to confuse and correctly install the one to which the necessary equipment was connected. Each COM port required the correct setting of the data transfer speed , as well as a number of other mysterious parameters, which were known only to a narrow circle of specialists. For the equipment connection to be successful, all the necessary parameters needed to be found out somewhere or experimentally selected, since in this case there was no automatic configuration. In addition, the connection via the COM port allowed the connection of any software with arbitrary external equipment, even completely incompatible, which caused a huge number of errors during the configuration process.

Modernity

Now the connection through the COM port is completely superseded by a more modern method, which does not require special knowledge for implementation, namely through the USB port. This method does not have all the drawbacks mentioned earlier. However, modern compatibility standards for connecting all kinds of GPS equipment and very heterogeneous software have been formed for a long time around the concept of COM ports, which have now become archaic.

COM port operation

This is due to the fact that initially almost any equipment, including GPS, was external, and its connection to the computer was carried out using a serial cable connected to one of the hardware ports. During the setup process, the user was required to select the correct port number and data transmission speed through it. At that time, the main standard for transmitting data from a GPS receiver to a program, now called NMEA-0183, arose. In fact, this standard requires all developers of even the most advanced hardware and software to communicate via COM ports. And all this in the context of the fact that on modern computers, as well as on PDAs, the USB standard has long been the main thing. And another feature is that in recent years, GPS receivers have increasingly been installed directly inside the device’s body, that is, there is no connection cable between it and the main device.

COM port management

Virtual COM ports

The way out was invented, namely, “virtual” COM ports were developed. It turns out that the internal device of the PDA, for example, a GPS-receiver, is simulated by software in the form of a COM port, while in terms of hardware it is not. In this program, which is designed to pair through a similar standard, there is no difference how it is implemented. Here virtual simulation is allowed, but not the mandatory presence of a hardware implementation. And it is possible to ensure compatibility of old-style GPS programs with modern equipment.

What is a COM port?

Changes made

At the same time, the control of the COM port has not changed significantly. The old-fashioned user must perform complex configuration almost manually. However, the modern COM-port is no longer that bulky device located on the rear panel of the system unit, but a completely different device. And here the whole point is that from a software point of view, all their implementations look faceless, that is, there is no difference between virtual and real ports. For software, the ports differ only in numbers that are assigned to them by PDA manufacturers on a completely random basis. For example, the receiver from ASUS is usually located on COM5, and PocketLOOX 560 shows the receiver on COM8. It turns out that the program that wants to receive data from the GPS receiver does not initially have any reliable information about the conditional number, under which appears the port registered for the receiver on this PDA.

COM port anatomy

How does it all work?

Despite the fact that among all available COM-ports you can automatically search for a suitable one, the procedure for such a survey is rather unreliable and rather cumbersome. This is due to the fact that the devices displayed as COM ports in the system can be quite diverse and not related to GPS, they can completely unpredictably answer such a survey. For example, on the PDA there are ports that are paired with an internal cellular modem, with USB, with an infrared port, as well as with other elements. Turning to them a program designed to work with a specific device can lead to a completely unpredictable reaction, as well as to various malfunctions, which often causes the PDA to freeze. That is why an attempt to open the COM port can lead to unexpected situations up to the inclusion of Bluetooth or infrared port. And there may be more incomprehensible cases.

Open COM Port

COM port operation

For COM ports, the asynchronous universal transceiver chip is used as the basis. This chip exists in several varieties: Intel 16550A, 16550, 16450, 8250. For each COM port, it contains the receiver and transmitter registers, as well as a number of control registers that can be accessed through BIOS, Windows and MS DOS programs. The latest versions of the chip have a set of buffers for temporary storage of transmitted and received data. Due to this possibility, it is possible to interrupt the operation of the central processor less often, as well as to coordinate the speed of data transmission.

Main settings

The COM port device assumes the presence of such characteristic features:

- the base address of the port for input and output information;

- hardware interrupt numbers;

- the size of one block of information;

- the speed at which data is transmitted;

- honesty detection mode;

- a way to control the flow of information;

- the number of stop bits.

COM port device

How to check computer COM port? What to look for?

As mentioned earlier, this type of port is a bi-directional interface for transmitting information at the bit level in a sequential manner. A distinctive feature in comparison with the parallel port here is the transfer of data bit by bit. The anatomy of a COM port is such that it isn’t the only one on the computer that uses a serial data transfer method. For example, interfaces such as Ethernet or USB also use a similar principle, but it so happened historically that it is customary to call the RS232 standard port serial.

Very often you need to open the COM port for repair and diagnostics of the computer, while it also needs to be checked for operability. It’s very easy to burn an element. Most often this happens due to the fault of the user who disconnects the device incorrectly by pulling out the connector when the interface is connected. The simplest way to check the operability of an interface is to connect a mouse to it. However, it is so difficult to get the whole picture, since the manipulator uses only half of the eight signal lines available. Only the use of a special stub and program will allow a performance check. For these purposes, specially developed software already exists.


All Articles