The Principle of Serial Communication

2023-05-08 usr News
The Principle of Serial Communication,USR-N580

The concept of serial communication is very simple. The serial port sends and receives bytes by bit. Although slower than byte-by-byte parallel communication, a serial port can send data on one wire while receiving data on another. It is simple and enables long-distance communication. For example, when IEEE488 defines the parallel traffic state, it stipulates that the total length of equipment lines shall not exceed 20 meters, and the length between any two devices shall not exceed 2 meters. For serial ports, the length can be up to 1200 meters.

Typically, a serial port is used for the transmission of ASCII characters. Communication is accomplished using 3 wires: (1) ground, (2) transmit, and (3) receive. Because serial communication is asynchronous, a port can send data on one wire while receiving data on another. Other lines are used for handshaking but are not required. The most important parameters for serial communication are baud rate, data bits, stop bits and parity. For two ports to pass, these parameters must match:


A. Baud rate: This is a parameter to measure communication speed. It represents the number of bits transmitted per second. For example, 300 baud means that 300 bits are transmitted per second. When we say clock cycle, we mean baud rate. For example, if the protocol requires a 4800 baud rate, then the clock is 4800 Hz. This means that the serial communication has a sampling rate of 4800 Hz on the data line. Typical telephone line baud rates are 14400, 28800, and 36600. The baud rate can be much larger than these values, but the baud rate is inversely proportional to the distance. High baud rates are often used for communication between instruments placed in close proximity, a typical example being communication with GPIB devices.


B. Data bit: This is a parameter that measures the actual data bit in the communication. When the computer sends a packet, the actual data is not 8 bits. The standard values are 5, 7, and 8 bits. How you set it up depends on the information you want to send. For example, the standard ASCII code is 0 to 127 (7 bits). The extended ASCII code is 0 to 255 (8 bits). If the data uses simple text (standard ASCII), then 7 bits of data are used per packet. Each packet is one byte and includes start/stop bits, data bits, and parity bits. Since the actual data bits depending on the choice of communication protocol, the term "packet" refers to any instance of communication.


C. Stop bit: used to represent the last bit of a single packet. Typical values are 1, 1.5, and 2 bits. Since the data is clocked on the transmission line and each device has its own clock, it is likely that there will be a small asynchrony between the two devices in the communication. The stop bit thus not only indicates the end of the transmission but also provides an opportunity for the computer to correct the clock synchronization. The greater the number of bits available for stop bits, the greater the tolerance for different clock synchronizations, but the slower the data transfer rate at the same time.


D. Parity bit: a simple error detection method in serial communication. There are four types of error detection: even, odd, high, and low. Of course, no check bit is also possible. For even and odd parity, the serial port sets the check bit (the bit following the data bit) with a value that ensures that the transmitted data has either an even or odd number of logic high bits. For example, if the data is 011, then for an even parity, the parity bit is 0, and the number of bits guaranteed to be logic high is an even number. If it is odd parity, the parity bit is set to 1, so there are three logic high bits. The high and low bits do not actually check the data, but simply set the logic high or logic low check. This allows the receiving device to know the state of a bit and has the opportunity to determine if noise is interfering with the communication or if the transmitted and received data are out of sync.

  • +1 Like
  • Add to Favorites

Recommend

This document is provided by Sekorm Platform for VIP exclusive service. The copyright is owned by Sekorm. Without authorization, any medias, websites or individual are not allowed to reprint. When authorizing the reprint, the link of www.sekorm.com must be indicated.

Contact Us

Email: