Serial Communication
lastmod 2025-02-26created 2014-04-2435 edits
In telecommunications and computer science, serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. The term contrasts with parallel communication, which sends several bits simultaneously over a link with several parallel channels.
Data processing in a computer is done in parallel, and doing parallel communication requires multiple channels. Considering distance and cost, parallel communication can become a problem in many cases. Ultimately, the problem can be solved by dividing the parallel-processed data by time and sending it sequentially when communicating.
When data is transmitted continuously in serial communication, a way to distinguish each bit is needed. From the digital circuit's point of view, it needs to know where in time each bit of the received data starts and ends. Ways of recovering data bits can thus be divided into sending a synchronization signal to indicate the temporal position of the data, and recovering the data bits from the signal itself without a synchronization signal.
- Synchronous : sends a synchronization signal together with, but separate from, the data signal.
- Asynchronous : sends only the data signal and finds the data bits according to each scheme.
Categories
- POSIX:termios - serial communication on Linux (POSIX)
- WindowsApi:SerialCommunications - serial communication on Windows
- pySerial (Python)
- pyserial-asyncio - asyncio extension package for pyserial
- pyparallel - Python parallel port access library
- pyserial-terminal - A more capable, modular terminal
Examples
- answerjet-relay
How to debugging
Debugging is possible in a Windows environment by combining RealTerm and Virtual Serial Port Emulator.
- RealTerm: creates virtual serial ports and allows Redirection between ports.
- Virtual Serial Port Emulator: can send data to a specific serial port.
Serial Terminal Basics
Linux
Windows
To see a list of all the available COM ports, type
Now create an instance of the port you want with this command
With that, you can now connect to and send data to or from that COM port.
Adding permissions on Linux
Check the serial group with the ls command.
It is probably the dialout group. Add the user to the group as follows,
reboot, and check with the following command:
Documentation
- ezTCP technical document - Serial Manager Protocol - document version 2.5
- https://www.sollae.co.kr/ko/download/pds_files/an_serial_manager_protocol_ko.pdf
-
An_serial_manager_protocol_ko.pdf - Good reference material when a sample serial communication protocol is requested
Troubleshooting
How to set timeouts using Win32
/dev/ttyUSB0 connection drops by itself on Ubuntu
See Universal Serial Bus#/dev/ttyUSB0 connection drops by itself on Ubuntu. Briefly, remove brltty with sudo apt purge brltty.
See also
- Universal asynchronous receiver-transmitter (UART)
- QextSerialPort
- System.IO.Ports.SerialPort: RS-232 communication in C#.
- Modbus
- RS-232 / RS-422 / RS-423 / RS-485
Favorite site
- Wikipedia (en) Serial communication
- Embedded: RS-485
- Serial communication RS232 , RS422, RS485
- What is RS232/RS422/RS485 communication?
- [Recommended] Serial communication basics (Serial Communication) 1
- [Recommended] KLDP - The Linux Serial Programming HOWTO
- Connecting to a serial port (COM) over the network | GeekNews
- [Original] RFC 2217 - Telnet Com Port Control Option
- One solution is to use telnet together with RFC2217 - Telnet COM Port Control Option
- Many software packages support Telnet+RFC2217 serial port forwarding (servers and clients supporting Windows and Linux)
References
-
Serial_Communication_-_Hard_Copy_Arduino.pdf ↩
- Bluetooth Low Energy
- COM
- POSIX:termios
- PySerial
- Pyserial-asyncio
- Python:Libraries
- RS-232
- RS-485
- Serial Peripheral Interface
- Software flow control
- System.IO.Ports.SerialPort
- Universal asynchronous receiver-transmitter
- Virtual Serial Port Emulator
- WindowsApi:COMMTIMEOUTS
- WindowsApi:GetCommTimeouts
- WindowsApi:SetCommTimeouts