Computer serial port. Computer ports and their purpose. Connecting or disconnecting peripheral devices

Description of the RS-232 interface, the format of the connectors used and the purpose of the pins, signal designations, data exchange protocol.

general description

The RS-232 interface, officially called "EIA/TIA-232-E", but better known as the "COM port" interface, was previously one of the most common interfaces in computer technology. It is still found on desktop computers, despite the advent of faster and smarter interfaces such as USB and FireWare. Its advantages from the point of view of radio amateurs include the low minimum speed and ease of implementation of the protocol in a homemade device.

The physical interface is implemented by one of two types of connectors: DB-9M or DB-25M, the latter is practically not found in currently produced computers.

Pin assignment of the 9-pin connector


DB-9M type 9-pin plug
Numbering of contacts on the pin side
The direction of the signals is indicated relative to the host (computer)
Contact Signal Direction Description
1 CD Entrance Carrier detected
2 RXD Entrance Received data
3 TXD Exit Transmitted data
4 DTR Exit Host ready
5 GND - Common wire
6 DSR Entrance Device is ready
7 RTS Exit The host is ready to transmit
8 CTS Entrance The device is ready to receive
9 R.I. Entrance Call detected

Pin assignment of the 25-pin connector

Contact Signal Direction Description
1 S.H.I.E.L.D. - Screen
2 TXD Exit Transmitted data
3 RXD Entrance Received data
4 RTS Exit The host is ready to transmit
5 CTS Entrance The device is ready to receive
6 DSR Entrance Device is ready
7 GND - Common wire
8 CD Entrance Carrier detected
9 - - Reserve
10 - - Reserve
11 - - Not used
12 SCD Entrance Carrier #2 detected
13 SCTS Entrance Device is ready to receive #2
Contact Signal Direction Description
14 STXD Exit Transmitted data #2
15 TRC Entrance Transmitter clocking
16 SRXD Entrance Received data #2
17 RCC Entrance Receiver clocking
18 LLOOP Exit Local loop
19 SRTS Exit Host ready to transmit #2
20 DTR Exit Host ready
21 RLOOP Exit External loop
22 R.I. Entrance Call detected
23 DRD Entrance Data speed determined
24 TRCO Exit External transmitter clocking
25 TEST Entrance Test mode

From the tables it can be seen that the 25-pin interface is distinguished by the presence of a full-fledged second transmit-receive channel (signals designated “#2”), as well as numerous additional control and control signals. However, often, despite the presence of a “wide” connector in the computer, additional signals are simply not connected to it.

Electrical characteristics

Transmitter logic levels:"0" - from +5 to +15 Volts, "1" - from -5 to -15 Volts.

Receiver logic levels:"0" - above +3 Volts, "1" - below -3 Volts.

The receiver input impedance is at least 3 kOhm.

These characteristics are defined by the standard as minimal, guaranteeing the compatibility of devices, however, the real characteristics are usually much better, which allows, on the one hand, to power low-power devices from the port (for example, numerous homemade data cables for cell phones are designed this way), and, on the other hand, to supply to the port input inverted TTL level instead of bipolar signal.

Description of the main interface signals

CD- The device sets this signal when it detects a carrier in the received signal. Typically, this signal is used by modems, which thus inform the host that they have detected a working modem at the other end of the line.

RXD- Line for the host to receive data from the device. Described in detail in the "Data exchange protocol" section.

TXD- Data line from the host to the device. Described in detail in the "Data exchange protocol" section.

DTR- The host sets this signal when it is ready to exchange data. In fact, the signal is set when the port is opened by the communications program and remains in this state as long as the port is open.

DSR- The device sets this signal when it is turned on and ready to communicate with the host. This and the previous (DTR) signals must be set for data exchange.

RTS- The host sets this signal before starting to transmit data to the device, and also signals that it is ready to receive data from the device. Used for hardware control of data exchange.

CTS- The device sets this signal in response to the host setting the previous one (RTS) when it is ready to receive data (for example, when the previous data sent by the host is transferred by the modem to the line or there is free space in the intermediate buffer).

R.I.- The device (usually a modem) sets this tone when it receives a call from a remote system, for example when receiving a telephone call if the modem is configured to receive calls.

Communication protocol

In the RS-232 protocol, there are two methods for controlling data exchange: hardware and software, as well as two transmission modes: synchronous and asynchronous. The protocol allows you to use any of the control methods in conjunction with any transmission mode. It is also possible to operate without flow control, which means that the host and device are always ready to receive data when communication is established (DTR and DSR signals are established).

Hardware control method implemented using RTS and CTS signals. To transmit data, the host (computer) sets the RTS signal and waits for the device to set the CTS signal, and then begins transmitting data as long as the CTS signal is set. The CTS signal is checked by the host immediately before the next byte begins to be transmitted, so a byte that has already begun to be transmitted will be transmitted in full, regardless of the CTS value. In half-duplex data exchange mode (the device and the host transmit data in turn, in full-duplex mode they can do this simultaneously), the removal of the RTS signal by the host means it switches to receive mode.

Software control method consists of the receiving side transmitting special stop (character with code 0x13, called XOFF) and resume (character with code 0x11, called XON) transmissions. When these characters are received, the sending party must stop the transmission or resume it accordingly (if there is data waiting to be transmitted). This method is simpler in terms of hardware implementation, but provides a slower response and, accordingly, requires advance notification of the transmitter when the free space in the receive buffer is reduced to a certain limit.

Synchronous transmission mode implies continuous data exchange when bits follow one after another without additional pauses at a given speed. This mode is COM port not supported.

Asynchronous transfer mode consists in the fact that each byte of data (and parity bit, if present) is “wrapped” with a synchronizing sequence of one zero start bit and one or more one stop bits. The data flow diagram in asynchronous mode is shown in the figure.

One of the possible receiver operation algorithms next:

  1. Wait for the receive signal level "0" (RXD in the case of a host, TXD in the case of a device).
  2. Count half the bit duration and check that the signal level is still "0"
  3. Count the full duration of the bit and write the current signal level to the least significant bit of data (bit 0)
  4. Repeat previous step for all remaining data bits
  5. Count the full duration of the bit and the current signal level, use it to check correct reception using parity check (see below)
  6. Count the full duration of the bit and make sure that the current signal level is “1”.

Greetings, friends. We continue to study the system unit. Today I’ll talk about computer ports. What it is? With the rapid development of Internet technologies, the concept of “port” or “socket” is familiar to many. This is another branch, and we will not talk about it today. The topic of this article contains information about purely “hard”, “real” connectors (or ports), which are designed to connect various devices to the system unit.

Hardware is also improving, and with each generation we discover new types of connectors (or ports) on purchased system units. Various so-called peripheral devices are connected to them. System unit + monitor = computer. Everything that is connected to them (printers, scanners, programmers, video cards, monitors, and so on) is a peripheral.

There are many ports on a computer. They are located on the motherboard of the system unit and are connectors (most of them are on the back). Some of the connectors are also displayed on the front panel and they are also connected to the motherboard.

You can also install additional devices on it through special expansion slots. Such devices include discrete video cards, network cards, Wi-Fi adapters, USB hubs, card readers, electronic locks, video cards and much more.

The presence of expansion slots allows you to independently assemble a computer like a construction set, based on your preferences, without spending an extra day. Because the developers have long standardized the equipment they produce. If necessary, you can update it. This is the main reason that IBM-PC compatible computers (as such a platform is called) once ousted the Apple Macintosh from the market.

Their system units were initially non-separable, and the equipment was not replaceable. It is impossible to upgrade such a device, and the maintainability of such a device is reduced.

A short list of computer ports

You need to be able to distinguish connectors from one another visually. The manufacturer does not always indicate their names. Since the connectors are grouped on the rear panel of the system unit, we’ll start there. All ports have an English name, nothing can be done about it. They can be briefly divided:

  1. Serial ports;
  2. Parallel port;
  3. Ports for computer and mouse;
  4. USB ports;
  5. SCSI ports;
  6. Video ports;
  7. Network cable connectors;
  8. Audio connectors;
  9. Card readers;

Some of these varieties have already sunk into oblivion and can no longer be found on modern motherboards. Other varieties, on the contrary, expand their functionality and there are motherboards for gourmets - lovers of good quality audio or video.


Such boards can also support audio or video formats from third-party manufacturers (Sony, Philips), and then you can find a corresponding connector on such a computer. Audio and video ports today boast a particular variety.

Computer ports for connecting peripheral devices

Serial port- today it is already a morally outdated thing. But for specialists who repair electronic devices, they are valuable. Initially, this port was used to connect a modem. Typical data transfer rates range from 110 to 115,200 bits per second. There were usually two of them with connectors DB 9 type "dad":

The speed is quite enough for the programmer to flash a microcontroller or mobile phone. Or to exchange data with an uninterruptible power supply. These ports are called COM1 And COM2.

Parallel port- is familiar to many, because it was mainly intended for connecting a printer. Also an almost extinct species. It was also used to connect hardware security keys.


The connector is used for connection DB25 like "mom". The data transfer speed is low - but quite enough for a programmer or an old laser printer. Most old computers always had two serial ports and one parallel port.

Keyboard and mouse ports familiar to all users. In modern computers they are purple and green. The plugs on the mouse and keyboard are the same color. It's difficult to confuse. The connectors are six-pin (mini-Din) female type. They were invented in Germany and it became the standard. Another name for IBM/PC2

since they were first used on the already mentioned IBM PC platform. If the connectors are mixed up when connecting, the devices will not work. A definite plus is that USB ports save money. Minus - you must restart the computer if it is connected incorrectly. By the way, it is also an endangered species. On many modern computers, this port is left only one - and it is also painted purple-green. You can connect only one device or mouse or keyboard to it.

USB ports. Universal Serial Bus, ( Universal Serial Bus). Since 1998, it has been displacing other ports; Even on car radios and video cameras today you will find this connector. The first generations had a data transfer speed of about 12 MB/sec. - mind-blowing for those times. Today we use USB 3, which has a speed of 5 Gbps

These ports have not changed in appearance. The computer has type A connectors. The connector on any connected device is usually called “B”. It has four contacts, two for current, two for data transmission. Accordingly, there are twice as many pins on USB 3.0 ports.

SCSI ports(Small Computer Systems Interface) . Quite a specific and rare thing for us; I think that even abroad you will no longer find it among the average user. I believe that devices with such interfaces were made to order - for corporate use. This is a network interface for data exchange at speeds up to 160 Mbit/s.


I once came across a laptop brought from America, manufactured in 1999, from Dell. It had one of those multi-pin ports. It was located in such a way that it could only be used by placing the laptop on the table. The connector itself is closed with curtains on springs. Consequently, somewhere in America there were tables in which this connector was built in... You bring it, put it on the table, and it is connected to the corporate network.

The interface varieties are already familiar to us DB-25, as well as 50-High-Density, 68-pin -High-Density, 80-pin SCA, Centronics. It was also possible to connect hard drives to this interface. A special board, the host adapter, is responsible for the connection.


Video ports. They also cannot be confused with others. The standard video port is a 15-pin VGA blue D-type female connector. Used to connect a monitor. This is an old standard, adopted in 1987. Not all motherboards have it. If you don’t have it “on board”, then it can be found at the bottom of the system unit. A video card is installed in the expansion slot:

If you decide to install a video card in addition to the one you already have (“on board”), then the latter will no longer work. This is fine. The monitor will only work when connected to an installed one.

On modern video cards, the VGA port has become difficult to find; they are being replaced by another type - DVI. On a transition type motherboard it looks something like this:

Very often there are cases when a VGA video card fails. After purchasing a new one, it turns out that it only has DVI ports. In this case, you need to purchase an adapter and install it on the DVI connector:

Pay attention to the type of adapter. The fact is that the DVI connectors are different - new expensive video cards have DVI-D or DVI-I ports. The adapters are not interchangeable, check this point with the seller.

In this case, you will not need to buy a new monitor. New monitors also come with two types of connectors - VGA and DVI.

HDMI port. Where would we be without him in the 21st century? The multimedia interface is designed to transmit high-definition video and audio with copy protection. At the same time, it replaces both the above video and some audio ports (SCART, VGA, YPbPr, RCA, S-Video.). This interface will probably replace everything else over time. It can be found on any digital technology - from a camera to a computer (or laptop).

The size is comparable to a USB port, and the data transfer speed is enormous compared to those listed above - up to 48 Gbps. Data transmission is carried out via a cable with good interference protection. The cable can be connected to a laptop and to a TV and watch videos. The cable length should not exceed 10 meters, otherwise a signal amplifier/repeater is needed.

About audio connectors I won't go into detail. Everything looks about the same as on a home DVD player, if we are talking about something special. An example of this is the SPDiF connector, which could be installed on an expansion slot:

Audio standard from SONY and PHILIPS, this card is connected to the motherboard using a connector to the corresponding connector. Standard jacks for connecting a microphone, speakers, and headphones look like this:

If you want HD audio, you may have to connect the appropriate adapter here. Read the documentation for your motherboard:

Network ports. There is no way we can do without them these days. We receive the Internet through a network interface via cable or radio. Motherboards have a standard built-in connector RJ 45 to connect the internet cable:

On old computers, the speed standard was 100 Mbit/s; modern network cards provide 1000 Mbit/s. If one network card is not enough for you, you can buy an additional one and insert it into the expansion slot:

This card is suitable for a PCI slot. There are smaller options for PCI-express:

Check the data transfer speed of a particular card when purchasing. For fans of wireless networks, there is also a wide selection of Wi-Fi adapters:

They can also be connected to PCI or PCI - express expansion slots. However, if you don’t want to tinker with the system unit, you can also buy a USB version of this card:

You insert it into the port and enter the WIFI password. And you have another peripheral device connected. Many home printer models also have a WIi-Fi adapter, and with this setup you can print wirelessly. Fortunately, today there is a wide choice of network cards and printers.

How to disable USB ports when turning off the computer?

Finally, I’ll tell you how to solve one problem. I have a headset with a microphone for recording video and chatting on Skype. The Chinese have fallen in love with shoving LEDs wherever they need them for beauty. When the computer turns off, the backlight still remains on, since it is powered through the USB port.

The keyboard also glows, which is not entirely convenient at night, although not bad (if you type in the dark). To turn off power to the ports permanently, try typing the keyboard shortcut Win+R and in the “Run” line paste the command powercfg /h off.

After which you need to turn off the computer. The symptoms will likely go away. This command disables sleep mode and the computer shuts down completely. You can look at the power settings in the “Power Plan” in the control panel. But, there are board models where this setting is disabled through the BIOS. But on the most advanced ones this function is not disabled or is hidden very deeply. This is supposed to be convenient for charging gadgets at night.

In difficult cases, the motherboard documentation can help. Find the desired jumper (jumper) and manually turn off the power. But it's too difficult. And the easiest way is to buy a USB hub with switches and connect the necessary peripherals to it. And don't suffer. Bye, see you again!

So we got to the COM port. But with it everything is not as simple as with LPT, and its full use will require much more effort. The main problem is also its main advantage - serial data transfer. If in LPT a byte of data is transmitted along 8 lines, a bit per line, and the state of each line could be easily viewed, then in the COM port a byte of data is transmitted bit by bit along one line (relative to ground, of course) and see what is transmitted there with LEDs alone won't do it. To do this, you need a special device - a converter of a serial data stream into a parallel one, the so-called. USART (Universal Synchronous/Asynchronous Receiver Transmitter). For example, it is included in the motherboard of a computer equipped with a COM port, or in any more serious microcontroller.


I hope you are still discouraged in mastering the COM port. It's not all doom and gloom. Some results can be obtained without USART. Let us formulate a task that we will implement at the initial stage of working with the COM port:


"I would like an LED to be connected to the computer via the COM port. I launch the program. I perform some action in this program, the LED lights up, I do something else - the LED goes out."


The task is quite specific (taking into account the fact that USART is not used) and is a pure “do-it-yourself” task, but it is quite feasible and workable. Let's start implementing it.


1.COM port

Again, take the system unit of your PC and look at the rear. We note there is a 9-pin connector - this is the COM port. In reality there may be several of them (up to 4). My PC has two COM ports (see photo).


2. COM port extension


3. Hardware

We will also have to “tinker” with the hardware, in the sense that it will be more complicated than with the first device for the LPT port. The fact is that the RS-232 protocol, through which data is exchanged in the COM port, has a slightly different logical state-voltage relationship. If usually this is logical 0 0 V, logical 1 +5 V, then in RS-232 this relationship is as follows: logical 0 +12 V, logical 1 -12 V.

And for example, having received -12 V, it is not immediately clear what to do with this voltage. Typically, RS-232 levels are converted to TTL (0.5 V). The simplest option is zener diodes. But I propose to make this converter on a special chip. It's called MAX232.

Now let's see what signals from the COM port can we see on the LEDs? In fact, there are as many as 6 independent lines in the COM port that are of interest to the developer of interface devices. Two of them are not yet available to us - serial data lines. But the remaining 4 are designed to control and indicate the data transfer process and we can “transfer” them to suit our needs. Two of them are intended for control from an external device and we will not touch them for now, but we will now use the last two remaining lines. They're called:

  • RTS- Transfer request. An interaction line that indicates that the computer is ready to receive data.
  • DTR- The computer is ready. An interaction line that indicates that the computer is turned on and ready to communicate.

Now we transfer their purpose a little, and the LEDs connected to them will either go out or light up, depending on the actions in our own program.

So, let's put together a diagram that will allow us to carry out our intended actions.

And here is its practical implementation. I think you will forgive me that I made it in such a dumb breadboard version, because I don’t want to make a board for such a “highly productive” circuit.


4. Software part

Everything is simpler here. Let's create a Windows application in Microsoft Visual C++ 6.0 based on MFC to manage two lines of COM port communication. To do this, create a new MFC project and give it a name, for example, TestCOM. Next, select the option of constructing based on dialogue.

Give the appearance of our program's dialog window as in Fig. below, namely add four buttons, two for each of the lines. One of them is respectively necessary to “extinguish” the line, the other to “set” it to one.

Class CTestCOMDlg: public CDialog ( // Construction public: CTestCOMDlg(CWnd* pParent = NULL); // standard constructor HANDLE hFile;

In order for our program to control the lines of a COM port, it must first be opened. Let's write the code responsible for opening the port when loading the program.

HFile = CreateFile("COM2", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,NULL); if(hFile==INVALID_HANDLE_VALUE) ( MessageBox("The port could not be opened!", "Error", MB_ICONERROR); ) else ( MessageBox("The port was successfully opened", "Ok", MB_OK); )

Using the standard Win API function CreateFile() open the COM port COM2. Next, we check the success of the opening and display an information message. Here we need to make an important note: COM2 is on my computer, but on your computer you could connect it to another COM port. Accordingly, its name needs to be changed to whatever port you are using. You can see what port numbers are present on your computer like this: Start -> Settings -> Control Panel -> System -> Hardware -> Device Manager -> Ports (COM and LPT).

As a result, the function CTestCOMDlg::OnInitDialog(), located in the file TestCOMDlg.cpp, our dialogue class should take the form:

BOOL CTestCOMDlg::OnInitDialog() ( CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); ) ) // Set the icon for this dialog. The framework does this automatically // when the application"s main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here hFile = CreateFile("COM2", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,NULL); if(hFile==INVALID_HANDLE_VALUE) ( MessageBox("Could not open port!", "Ostbk", MB_ICONERROR); ) else ( MessageBox("Port successfully opened", "Ok", MB_OK); ) return TRUE; // return TRUE unless you set the focus to a control )

Now let's add handlers for line control buttons. I gave them appropriate names: the function that sets one on the DTR line is OnDTR1(), 0 is OnDTR0(). For the RTS line, in the same way. Let me remind you that the handler is created when you double click on the button. As a result, these four functions should look like:

Void CTestCOMDlg::OnDTR1() ( // TODO: Add your control notification handler code here EscapeCommFunction(hFile, 6); ) void CTestCOMDlg::OnDTR0() ( // TODO: Add your control notification handler code here EscapeCommFunction(hFile, 5); ) void CTestCOMDlg::OnRTS1() ( // TODO: Add your control notification handler code here EscapeCommFunction(hFile, 4); ) void CTestCOMDlg::OnRTS0() ( // TODO: Add your control notification handler code here EscapeCommFunction(hFile, 3);

Let me explain a little how they work. As you can see, inside they contain a call to the same Win API function EscapeCommFunction() with two parameters. The first of them is a handle (HANDLE) to an open port, the second is a special action code corresponding to the required state of the line.

That's it, we compile and launch. If everything is fine, you should see a message about the successful opening of the port. Next, by pressing the corresponding buttons, we blink the LEDs connected to the COM port.

© Ivanov Dmitry
December 2006

Initially, when they appeared personal computers, with them came several not-so-sophisticated, but quite successfully working in combination with all the other filling, ports or circuit interfaces. The word port denotes the method of data transfer. It's like a memory cell. Only information is written into RAM and remains there as long as some program needs it, until the program processes it (or the program itself is still needed by someone on the computer).

Port and memory

That is, the program will read the data from memory into the processor, do something with it, maybe receive some new data from this information, which it will write to another location. Or the given itself will simply be rewritten to another place. In any case, in memory, information that has once been recorded can either be read or erased. The cell looks like a chest standing against the wall. And all memory consists of a cell, each cell has its own address. Just like the chests standing in a row against the wall in the basement of a stingy knight.

Well, you can also imagine a port as a cell. Only such a cell at the back there is a window leading somewhere behind the wall. You can write information into it, and the information will take it and fly out of the window, although for some time it will remain in the cell in the same way as in a regular cell random access memory.

Or vice versa, information can “fly” into the port cell from the window. The processor will see this and read this new information that appears. And he will put it to work - he will rewrite it somewhere, recalculate it along with some other data. It can even write it to another cell. Or to another cell-port, then this information received via the first port can “fly away” into the window of the second port - well, that’s how the processor decides. More precisely, the program that at this moment commands the processor and processes the data recorded in memory and coming from the ports.

Simple and beautiful. These ports were immediately called - input-output ports. Through some of them, data is sent somewhere, through others, it is received from somewhere.

Well, then the movement begins in a circle. There is one device, and there is another. And now there is a chain of characters, each of which consists of individual binary bits, and this chain needs to be transmitted. How to transfer? You can immediately transmit a whole character along a line of 8 wires - one wire = one bit, then the code of another, then a third, and so on until you transmit the entire chain.

And it was possible to unfold each bit not in space (via wires), but in time: first transmit one bit of the symbol, then the second, and so on eight times. It is clear that in the second case some additional means are needed to unfold the symbols in this way in time.

Parallel and serial

And the transmission speed will be different:

It turns out that each option has its advantages, but also its disadvantages.

  1. It’s faster to transmit eight bits at a time (that is, byte by byte), but you need eight times more wires
  2. Transmitting one bit at a time requires only one information transmission, but it will be 8 times slower.

So in the first case they called the transmission parallel, and in the second case - serial.

Port Interface

And the whole system of such transmission - in one case this way, in another - like that, called interface. One interface is parallel, the other is serial. Almost the same thing, ports, one parallel, the other serial.

How does the concept of port differ from the concept of “interface”? In modern technology, words not only appear, they grow and receive “education.” And just like with people, they can become narrow specialists, or they can become “amateurs.” This is a typical amateur word - “interface”. Because it is “a plug for every hole.” The interfaces are:

And the meaning of the word is something between something. Inter - between, face - face. It turned out beautifully, that’s why it’s used everywhere. For example, the user interface of the Windows system is the on-screen face of the system, designed to communicate with a person.

And it consists of a picture drawn on the screen + rules for the operation of each element of the picture (for example, click on a button on the screen with the mouse - it will be pressed) + rules for the response of each element and the entire system as a whole + all hardware participating in the dialogue (mouse, keyboard, screen) + all programs that provide dialogue both from the side of the entire system and from the side of individual devices (drivers).

They didn’t mention the person, but since he is also part of the interaction, he must have knowledge and skills to work in the system, and for this there are training programs, help systems... And from all this a beautiful and capacious word arises: interface.

In our theme, interface means things a little more simple.

These are hardware + software transfer means + transfer rules. Hardware - understandable. But software on computers and in modern communications is always and everywhere present. It even happens: first, something functional is created on some hardware base, which is not executed immediately, but using specially written programs. And the programs are all customizable.

And gradually, as the new function (or functional block) works, the programs that “make” it - and they differ from hardware in that they can be easily configured - are brought to some state of optimal configuration. That there is no need to configure anymore. And then the program in the new version of the functional block can be replaced with a hardware-based substitute for the software part. For example, “sew up” an optimally working well-tuned program into permanent memory. Or come up with a special logical circuit that will do exactly the same thing that an optimally configured program did - without shying away and sometimes forgetting all its useful settings.

That's why the interface is often called this - software and hardware.

Transmission rules are needed to ensure that the same things are understood (and processed) in the same way at both ends of the interaction. Are we talking about impulse transmission? This means that the impulses must be strictly identical.

For example, so that 1 bit comes in the form of +12 or +15 volts of voltage drop from zero. And so that it is in the form of a rectangle, or a sharp burst - the peak of which must be no less than, well, + 5 volts, and it is not really necessary to introduce an upper limit, for example. This is because when transmitting impulses over some distance, electrical signals tend to weaken and “smear.”

If strictly 12 volts are sent from one end, then 3 volts may reach the other, and this may be interpreted by the receiving system simply as noise on the line, and the transmitted information will be lost.

The meaning of impulses should also be understood in the same way. And impulses can be informational, service, synchronizing. And in general, for example, not impulses, but simply constant voltage. Which can be used at the other end to power a small device.

And the wires themselves that were discussed at the very beginning should also be understood equally. Here it must be said right away that it never happens that there is only one wire. Even the telephone has two wires in the cable, but normally the cable is supposed to have four. And data interfaces always have several conductors. Some of them are informational, some are service. And this is what should be recognized equally on both ends of the interaction. And the wires are recognized as? By color, if in the cable and by location, if in the connection contacts.

Port is a simple word and also not entirely unambiguous. But the meaning is similar: that something is loaded onto something and sent somewhere. Or vice versa, something that accepts something and unloads something from it. The meaning is almost the same as the hardware-software interface, but somehow more concise. And stricter, like in the navy (“They will tell you - don’t argue... but we don’t argue...”). Only our signals travel not by sea, but by cable.

Pinout of COM port connectors

The pinout has no connection with crucification, although, like wires running freely in one cable sheath, they are disassembled into sides and hard soldered to their pins, similar to crucification. Pin, in English “pin”, pin, therefore pinout, the word is already a computer-communications “pro-English” jargon. It means wiring the wires to the pins on the connector.

The shape of the connector, the order of the wiring (pins) in it, the purpose of each pin, as well as the voltage ratings and the meaning of the signals in each - this is part of the interface. Typically all this information is compiled into a separate document called a port specification. Such a simple and clear one-page sign. In other types of interfaces, something like this might be called a “protocol.” And here they simply call it “pinout”.

Serial COM ports

COM ports of a computer are a long-range connection between a computer complex. Unlike parallel ports and cables that led to “heavy” devices - printers, scanners, Com ports connected “light” units to the computer - a mouse, a modem. The first computer-to-computer interfaces (via a “null modem”). Further, when did local networks spread, and mice began to be connected via the same connector as the keyboard - port ps/2 (pe-es-in half) - the com port was somehow forgotten.

The revival came with the advent of the USB serial interface. So it turned out to be a movement in a circle. Now on USB you can find, in addition to flash drives, USB mice and USB keyboards. Printers, scanners, modems - all the peripherals are now on USB, I have already forgotten about thick and solid parallel LTP cables, which had to be screwed on each side with 2 bolts. And there are two signal wires in these USBs (actually, there is one channel, one direct signal, the other the same - inverse) and two - power supply and housing.

There were several previous serial COM ports. The smallest - and the most popular A 9-pin port (D9), to which most devices were connected: mice, modems, null-modem cables. The contacts were arranged in two rows, 5 and 4 in a row, creating a trapezoid. Hence the name D9. On the “mother” the numbering went from left to right and from top to bottom:

1 2 3 4 5

COM port wiring, port RS232, 9 pins.

Designation Type Description
1 DCD Entrance High level from the modem when it receives the carrier modem partner
2 RxD Entrance Incoming data pulses
3 TxD Exit Outgoing data pulses
4 DTR Exit A high level (+12V) indicates the computer is ready to receive data. The connected mouse used this pin as a power source
5 GND General Earth
6 DSR Entrance The device is ready to transmit data
7 RTS Exit Response readiness of the partner device
8 CTS Entrance Readiness to receive data from a partner
9 R.I. Entrance A signal informing the computer about an incoming call received by the modem from the communication line