Skip to content
Search

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

Examples

  • answerjet-relay

How to debugging

Debugging is possible in a Windows environment by combining RealTerm and Virtual Serial Port Emulator.

Serial Terminal Basics

Linux

Use minicom or screen.

Windows

To see a list of all the available COM ports, type

[System.IO.Ports.SerialPort]::getportnames()

Now create an instance of the port you want with this command

$port= new-Object System.IO.Ports.SerialPort COM#,Baudrate,None,8,one

With that, you can now connect to and send data to or from that COM port.

$port.open()
$port.WriteLine("some string")
$port.ReadLine()
$port.Close()

Adding permissions on Linux

Check the serial group with the ls command.

$ ls -la /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Aug 10 17:56 /dev/ttyUSB0

It is probably the dialout group. Add the user to the group as follows,

sudo adduser $USER dialout

reboot, and check with the following command:

$ id -Gn
yourname adm dialout cdrom sudo dip plugdev lpadmin lxd sambashare docker

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

See COMMTIMEOUTS (Structure).

/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

Favorite site

References


  1. Serial_Communication_-_Hard_Copy_Arduino.pdf ↩

author Zer0 sitemap