Questions tagged [serial-communication]

Serial communication is the process of sending and receiving data via communication channel bit by bit sequentially, one bit at a time.

Serial communication is used for all long-haul communication and most computer networks, where the cost of cable and synchronization difficulties make parallel communication impractical.

Main advantages of serial communications:

  • fewer interconnecting cables (e.g. wires/fibers) and hence occupies less space. The extra space allows for better isolation of the channel from its surroundings;
  • less crosstalk, because there are fewer conductors in proximity.

Data sent serially this way. When 8-bit data set D0..D7 is transferred into the output buffer to be transmitted, usually it is still in parallel form. This output buffer converts this data into Serial data (PISO) (Parallel In Serial Out), MSB (Most Significant Bit) first or LSB (Least Significant Bit) first as according to the protocol. And than data is transmitted in Serial mode via communication channel (cable, radio etc.). When this data is received by recipient in its receiver buffer, the receiver buffer converts it back into parallel data (SIPO) (Serial In Parallel Out) for further processing:

Serial transfer

Generally, all serial protocols can be divided into two groups: synchronous and asynchronous.

A synchronous serial communication is always coupled with a CLOCK signal, so that all devices on the serial bus share a common clock. This particular configuration allows a simpler and often faster data transfer, but also requires an additional channel to communicate. I²C and SPI are two synchronous serial communication protocols.

An asynchronous serial communication, on the other hand, does not use an external CLOCK signal and therefore requires less I/O channels for communication. At the expense of this, a reliable system for transmitting and receiving data must be implemented. The most common serial protocols are Bluetooth, Xbee, GPS module.

More information:

https://en.wikipedia.org/wiki/Serial_communication

Asynchronous serial communication

Universal asynchronous receiver-transmitter

Synchronous serial communication

Universal synchronous and asynchronous receiver-transmitter

RS-232

Inter-Integrated Circuit (I²C)

Serial Peripheral Interface (SPI)

920 questions
6
votes
1 answer

Java: Using RxTx Libararies

I am new to Java , and trying to write a serial communication application. I am using Windows 7 (32 bit) D:\Glaswegian\Java\RXTX\Test>java -version java version "1.7.0_13" Java(TM) SE Runtime Environment (build 1.7.0_13-b20) Java HotSpot(TM) Client…
Gaurav K
  • 2,864
  • 9
  • 39
  • 68
6
votes
2 answers

UART ISR Tx Rx Architecture

Am I complicating things? I'm architecting my code to talk from a 8051 micro to a peripheral device over UART. The peripheral responds to commands from the host and can only respond to one command at a time. It's a simple send and receive…
Jonathan
  • 1,498
  • 2
  • 20
  • 41
5
votes
2 answers

C# Serial Communication with multiple devices on one port

I only briefly started working in C# and I'm currently using RS-485 to communicate with some other devices but I don't seem being able to actually get the other devices to respond. I was wondering if there were any way to write to a specific device…
Cvr
  • 71
  • 1
  • 6
5
votes
5 answers

Set DCB Fails When Attempting to Configure COM Port

I'm trying to write a C++ MFC application that uses the serial port (e.g. COM8). Every time I try to set the DCB it fails. If someone can point out what I'm doing wrong, I'd really appreciate it. DCB dcb = {0}; dcb.DCBlength =…
Jim Fell
  • 13,750
  • 36
  • 127
  • 202
5
votes
1 answer

CreateFile() Serial Communication Issue

I am trying to do some serial communication through my usb port (named COM15), and I am getting an error. This is the code where the error is occurring: HANDLE myPortHandle = CreateFile("COM15", GENERIC_READ |…
CodeBlocks
  • 233
  • 3
  • 5
  • 14
5
votes
3 answers

Serial port communication initialization

At the time we are trying to create an interface for serial communication, to be able to communicate with a microprocessor. Actually - everything works fine. Almost! To be able to communicate with our controller, we need to sync up with it. To do…
Benjamin Larsen
  • 560
  • 1
  • 7
  • 21
5
votes
1 answer

What are the advantage and disadvantages of right justified I2S mode over Left justified I2S mode and Basic I2S mode?

I2S specifications provide different modes of operation. I tried looking for advantages of one mode over the other but could not find any good literature. Can anyone provide or explain the advantage of one mode over the other ?
Trickmaster
  • 187
  • 2
  • 5
5
votes
2 answers

Should I keep a SerialPort connection open?

I am working with serial communication and I'm wondering whether I should keep the SerialPort open or not? I'm creating a queue of commands and only one will be running at a time. Should I create a SerialPort and open/close it in each command, or…
Max Schmeling
  • 12,363
  • 14
  • 66
  • 109
5
votes
1 answer

Serial communication C/C++ Linux thread safe?

My question is quite simple. Is reading and writing from and to a serial port under Linux thread-safe? Can I read and write at the same time from different threads? Is it even possible to do 2 writes simultaneously? I'm not planning on doing so but…
Silver
  • 1,075
  • 3
  • 12
  • 37
5
votes
1 answer

How to solve error java.io.IOException: Input/output error in nativeavailable for Serial Communication?

I have Arm processor which is AllWinner A13 ,RAM- 512mb, and OS- Linaro 13.01 Ubuntu (means debian). Now i m making Serial Communication program for /dev/ttyS0. i made simple program for Two Way Serial Communication in java with netbeans. In my…
Jay
  • 1,235
  • 10
  • 28
  • 49
5
votes
1 answer

Java SerialPortEvent issue: DATA_AVAILABLE calls faster then incoming data

I'm posting for the first time so I hope that I write everything according to the format. Currently I'm working on a project using Serial Communication with RXTX between a java application and a measuring device. This works great, but now I want to…
Skillcoil
  • 184
  • 2
  • 16
5
votes
1 answer

In C#, how do you communicate via Kermit over a serial port?

I am about to start on a project where I have to communicate with (extract data from) a medical device via serial port. The documentation for the device says that it communicates via the Kermit protocol. It's been 10 years since I even thought about…
Byron Sommardahl
  • 12,743
  • 15
  • 74
  • 131
5
votes
1 answer

Serial communication with Arduino UNO and Mac using bluetooth mate

I'm trying to set up serial communication between Arduino and Mac via Bluetooth and have a problem. My environment is that: Arduino UNO Bluetooth Mate from sparkfun MacBook, OS X 10.7 First, I programmed arduino like below, as it shown in this…
chihiroms
  • 51
  • 1
  • 5
5
votes
3 answers

Arduino Serial Interrupts

I am working on an Arduino Mega 2560 project. At a Windows 7 PC I am using the Arduino1.0 IDE. I need to establish a serial Bluetooth communication with a baud rate of 115200. I need to receive an interrupt when data is available at RX. Every piece…
4
votes
1 answer

Calculate Block Check Character (BCC) for serial communication

I am communicating with a device via serial via the SerialPort class of .NET and based on third-party device specification requirements I need to calculate a "block check character". The only information I am told is that it is an exclusive OR…
GONeale
  • 26,302
  • 21
  • 106
  • 149
1 2
3
61 62