Not long ago a serial port communication was one of the most common ways to connect peripherals and equipment to computers. For decades serial ports have been serving for transmitting data between PCs, serial devices (modems, mice, printers) and computers.
The technologies have improved and today people have faster solutions for data transfer. However, despite the introduction of USB and FireWire that are meant to replace a good old COM port, serial communication is still going strong in many spheres of our life. It seems that the classic serial port would never fade in any way, as COM interfaces are the backbone of a wide range of industrial equipment, lab instruments, embedded computer boards, POS hardware, and multiple other devices widely used nowadays.
- What is meant by serial communication?
- What is RS232 standard?
- Serial port programming
What is meant by serial communication?
Serial communication is a communication established via serial interfaces which transmit data over one wire one bit at a time. As a comparison, parallel ports transfer all the 8 bits of a byte in parallel, all in one go, over a cable with 8 wires. Hence, a parallel port transmits data faster while a serial port is used for communications with relatively slow data rates. At the same time, the price and size of the cable used in a serial communication are real advantages of a serial port connection.
What is serial communication interface?
Now let's see what exactly a serial interface is. As we already know, a serial port is an interface used to communicate data one bit at a time. If you see a D-shaped male connector with 9 or 25 pins on the back side of your old PC, be sure it’s a COM port.
However, if you are a lucky owner of an up-to-date computer, to find a serial interface will be a bit harder. In modern consumer-grade PCs, a serial port can be present on the motherboard but not connected to the back panel of the machine. The same cannot be said about industrial equipment though. A vast number of current industrial instruments still use COM ports as the main method of connection to a computer.
In any events, if your machine or device lacks a serial port, you can create an unlimited number of virtual COM interfaces with the help of Virtual Serial Port Driver - a dedicated serial port communication software.
As you may have heard, serial ports are bi-directional interfaces. Bi-directional communications are those where each device can receive and send data at the same time. To achieve this, a device uses different pins of a serial connector. Here’s how it works:
- Before establishing the communication, the sender and receiver must agree on the signaling parameters.
- To start the data exchange, a serial port sends a start bit (a single bit with a value of 0). After this, actual data bits are sent serially.
- Upon finishing, the transmitter sends a stop bit which signals that the data transfer is complete.
Serial port pinout and signals
DB9 is a standard 9 pin connector used by a serial port. Below you'll find the pinout of the connector with names and short descriptions of each signal.
|1||Indicates that the modem is connected to another modem.|
|2||Shows that data sent by the modem is received by the computer.|
|3||Signals that data is transmitted from the computer to the modem.|
|4||Indicates that the computer's serial port is open and ready to talk.|
|5||Provides a reference voltage for the other signals.|
|6||The modem tells the computer that it's ready for use.|
|7||The computer tells the modem that it's ready to receive data.|
|8||The modem tells the computer that it can send data.||9||Indicates that your phone receives an incoming call.|
What is RS232 standard?
As a rule, IBM-compatible machines provide serial communication based on the standard communication protocol - RS-232. The protocol defines the voltage for the path used for data exchange between serial devices. However, being one of the most commonly used serial protocols, RS-232 has its limitations. For instance, you'll be able to create a point-to-point connection between a computer and device located no more than 50 feet apart.
RS-422 and RS-485 connections
The RS232 standard allows communicating serial data over three wires (the transmitting, receiving, and common ground lines). However, referenced to ground, RS-232 signals are rather unbalanced. To overcome this problem, RS-422 has been invented. The RS-422 standard is based on the differential electrical signals which ensure greater noise immunity and make it possible to connect devices over longer distances.
RS-422 was followed by RS-485 standard that allowed creating networks of devices connected to a single RS-485 COM port. RS-485 protocol is widely used by industrial applications which need to work with a big number of serial devices at a time. Thanks to RS-485, multiple instruments can be networked to a controller or machine working as a single data center.
Serial port programming
COM interfaces serve for connecting computers to serial hardware and software of different kinds. Therefore, specialists often need to program the required COM port so that it can easily talk to a particular RS-232 communication software or device. For this end, developers resort to Windows serial port programming or object-oriented programming like C#, Visual Basic, or
It will be interesting to know how to program a virtual COM port using Visual Basic and Visual C ++ for communication between AVR and PC using Virtual Serial Port Driver.
Virtual Serial Port Driver
Version 9.0.575 (23rd May, 2019) Release notes
Category: Serial Port Software