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
86
votes
14 answers

What is the difference between baud rate and bit rate?

I am really having hard time understanding the difference. Some say they are same, while others say there is a slight difference. What's the difference, exactly? I would like it if you explained with some analogy.
dimSutar
  • 1,425
  • 2
  • 13
  • 17
22
votes
4 answers

Listening to Serial Com Ports that are In use

I'm dealing with some legacy systems that are using RS232 to communicate with peripherals. I'm not very experienced with COM interfacing. I have some code that can open and use COM ports, but it can't open ports that are used by other applications.…
Daniel
  • 10,864
  • 22
  • 84
  • 115
17
votes
1 answer

Choosing between /dev/tty.usbserial vs /dev/cu.usbserial

A PL2303 serial-over-USB device is configured to receive-only data. There is an explanation of tty vs. cu here: MacOS: what's the difference between /dev/tty.* and /dev/cu.*? That being said, when configuring data collection software, one has to…
gatorback
  • 1,351
  • 4
  • 19
  • 44
16
votes
1 answer

Android USB Host Communication

I'm working on a project that utilizes the USB Host capabilities in Android 3.2. I'm suffering from a deplorable lack of knowledge and talent regarding USB/Serial communication in general. I'm also unable to find any good example code for what I…
K.R.
  • 477
  • 1
  • 4
  • 13
16
votes
3 answers

Accessing the SerialPort class using .Net Core 3.0

I'm starting a new .NET Core 3.0 project in which I need to access the System.IO.Ports.SerialPort class. The documentation I'm reading on the class shows that it is applicable to .NET Core 3 ( see the bottom of…
Joel
  • 2,230
  • 1
  • 20
  • 28
13
votes
3 answers

How can i Open Serial Port of Dock connector in iOS 5.0.1

I can successfully open the serial port of iPhone/iPad in lower version than iOs 5. with the use of open("/dev/tty.iap", O_RDWR | O_NOCTTY | O_ASYNC)) but i got error "Operation not permitted" in iOS 5 . (I used the Serial Programming for…
Raj
  • 1,213
  • 2
  • 16
  • 34
13
votes
1 answer

Create a simple Client/Server using Modbus in C

I am currently working on a project which will allow different automates to communicate. To do so, I would like to create a client and a server that will talk using the modbus protocol. I am not sure if I want to be using ModBus/TCP, ModBus/RTU or…
13
votes
2 answers

How to send a message from Android to Windows using USB

I am a complete noob at Android, only at the level of basic (1 or 2 line) Activities activated by buttons, but I would like to create a really simple app that, when I tap the app icon, it fires and forgets a message to a listening server on my…
ProfK
  • 49,207
  • 121
  • 399
  • 775
13
votes
2 answers

Calculating modbus RTU 3.5 character time

am new to Modbus and developing an application using Modbus RTU. I would like to know how to find out the RTU message frame separation time. In the Modbus RTU specification, It mentions 3.5 chars time, but there is no more data about how i can…
user3128453
  • 131
  • 1
  • 1
  • 4
11
votes
3 answers

Serial programming RS485

I have been tasked with the implementation of the ModBus protocol over a RS485 2-wire system. (Actually it's three wires, A/B and GND). ModBus is not the point though, but the step before that...simple I/O over the interface. I am using the FTDI…
ATaylor
  • 2,598
  • 2
  • 17
  • 25
10
votes
2 answers

Change SerialPort's BaudRate while connection is open

I am using SerialPort class to communicate with an external device. I start the communication at 300 Baud per second however after the initial "handshake" I have to switch to a Baud rate specified by the device (usually 9600 Bps). I have been…
David Božjak
  • 16,887
  • 18
  • 67
  • 98
10
votes
1 answer

"DSR is on; Don't send DTR on" error

When I connect my laptop to my Android phone, the computer aways shows me this error : 1827 Data Router usb connection is true 1827 Data Router DSR is on Don't send DTR on My phone is galaxy II with Android…
user504909
  • 9,119
  • 12
  • 60
  • 109
9
votes
2 answers

NACK and ACK responses on I2c bus

My recent project requires the use of i2c communication using a single master with multiple slaves. I know that with each data byte (actual data) sent by master,the slave responds with Nack\Ack(1,0). I am confused that how this Nack and ACK are…
amit kr
  • 117
  • 1
  • 1
  • 7
9
votes
0 answers

How to correctly stream data via Bluetooth to Android

I'm in the process of developing an application which reads data from a DAQ that streams its data over Bluetooth. The packet sizes can change, as can the sampling rate (1Hz - 512Hz), and I'm able to loop through and read the data off the device…
ritchie888
  • 583
  • 3
  • 12
  • 27
8
votes
1 answer

What type of framing to use in serial communication

In a serial communication link, what is the prefered message framing/sync method? framing with SOF and escaping sequences, like in HDLC? relying on using a header with length info and CRC? It's an embedded system using DMA transfers of data from…
user2479653
  • 509
  • 5
  • 14
1
2 3
61 62