Table of Contents
COM port and GPIO header Compression
Compression
COM ports are mostly used to connect to a controller/device and then use the integrated functions of this device.
GPIO Header are used to connect direct to sensors or to send directly the control signals.
Protocols like I2C,SPI or UART have own dedicated pins on a GPIO header. On COM port connections, the communication runs over the RXC and TRX pins.
This means directly I2C communication over a COM port is not feasible due to the different nature of the protocols. However, you can bridge I2C communication to a COM port using an intermediary device or software that translates between the two protocols. This approach allows you to interface I2C devices with a host computer using a COM port.
In theorie, a COM port can process higher baud rates than a Raspberry Pi GPIO header (115.200 should be enough any way.). How high the baud rate of the COM port connected device is, is depending on the devices that connect over the cable.
COM port that use the RS232 standard have voltage ranges from 3+/- to 15+/- volts. Often are 12 volts used. The Raspberry Pi 3.3 or 5 volts. Because of higher voltage and special shielded cables, COM port cable can be a lot longer. (Not a complete fitting compression, but think about the VGA cable of the past.)
COM ports/ Serial Connections
COM ports, or Communication Ports, operate on the principle of serial communication, where data is transmitted one bit at a time. This method allows for straightforward data transfer between a computer and peripheral devices. The RS-232 standard defines the electrical characteristics and signal timing for serial communication via COM ports. This contrasts with parallel communication, where multiple bits are sent simultaneously over multiple channels.
The communication can be Synchronous or asynchronous.
Asynchronous
Data transmission is happening without a synchronized clock signal. Instead, start and stop bits are used to signal the beginning and end of a transmission. This method is more flexible and commonly used in applications like RS-232 and UART.
Synchronous
Data transmission is done synchronized, with a clock signal, allowing for higher data rates and more precise timing. This method is used in protocols like SPI (Serial Peripheral Interface) and I2C (Inter-Integrated Circuit).
In the past, COM ports (Communication Ports) were extensively used for serial communication between computers and a variety of peripheral devices: Mice, Joysticks, Keyboards and so on.
COM ports are nowadays predominantly used in industrial automation. For example, are PLCs and CNC machines often connected over COM connectors. A lot of newly produced medical equipment still uses COM connectors, one example are ultrasonic devices which can see in almost every doctor’s office.
One area where these connectors are wildly used are electronic hardware tester and developing companies, they control their test equipment over the COM port or directly use the pins to interface to the devices which are getting tested.
Software
For COM port a lot of software exists since 20 years and longer, some of the software is not replaceable anymore since the source code was getting lost or the programmer how developed the program was getting retired. That said, still every day people use mostly C++, C# or Python to write and read from the COM ports.
Most of the time D-Sub9 connectors are used nowadays.
D-Sub9 Pinout:
RXD and TXD are the most import one for the communication.
TX (Transmit): Pin used to send data.
RX (Receive): Pin used to receive data.
Additional Pins: May include RTS (Request to Send), CTS (Clear to Send), DTR (Data Terminal Ready), and DSR (Data Set Ready) for flow control and handshaking.
To do a handshake in a situation where the loop back is bypassed, connect CTS to RTS and DTR to DSR. On this example, you see it is a complete and mature system.
Pinout:
1: Data Carrier Detect (DCD)
2: Receive Data (RXD)
3: Transmit Data (TXD)
4: Data Terminal Ready (DTR)
5: Ground (GND)
6: Data Set Ready (DSR)
7: Request to Send (RTS)
8: Clear to Send (CTS)
9: Ring Indicator (RI)
Raspberry Pi GPIO
Some RaspberryPi’s are used in industrial applications, often without the use of the full GPIO layout.
Some GPIO pins can be used for digital signals, others may also support analog functions, such as ADC (Analog-to-Digital Converter) or DAC (Digital-to-Analog Converter).
Not all pins on the „GPIO Header“ are GPIO pins.
Additional to the GPIO functionality, some pins serve specific purposes such as providing power (3.3V or 5V), ground connections, or supporting various communication protocols like I2C, SPI, UART, JTAG,PWM,GPCLK.
Pinout:
Set Up the GPIO on a Pine64 A64