Maker.io main logo

What is Serial Communication, and How Does it Compare to Parallel?

2023-04-05 | By Maker.io Staff

Using single electronic components in isolation quickly gets boring, and a project consisting of only one device might not always feel too exciting. For lots of people, the fun in electronics comes from connecting multiple devices - so that’s what we want to start thinking about here today!

Once you start working with multiple devices, they’ll need to communicate somehow, and there are typically two approaches to making multiple devices exchange data: serial or parallel communication. This article discusses the differences between the two methods and focuses on general aspects of serial communication methods.

What’s the Difference Between Serial and Parallel Communication?

In simple terms, serial communication transmits one bit at a time using a single (logical) data line. On the other hand, parallel transmission can shift multiple bits simultaneously, increasing the throughput of data that can be transferred. However, the added benefit of multiple data lines also means that parallel communication methods utilize more I/O lines of the devices involved in exchanging data, which might be a problem for some applications. Additionally, serial protocols may either use a single data line for sending and receiving bits or a separate line for reading and writing data.

What is Serial Communication, and How Does it Compare to Parallel? This image illustrates the difference between synchronous serial and synchronous parallel communication.

Think of serial communication as a single checkout line in a small convenience store versus multiple checkout lines in a supermarket. While the single checkout line may be slower, it requires less physical space. In contrast, the larger store has more room to accommodate multiple checkout lines, which increases the number of customers it can serve simultaneously. However, running multiple lines in parallel is more costly, requiring several employees and more physical space.

Serial Communication Modes: Synchronous vs. Asynchronous

Apart from distinguishing communication methods by the number of data lines they use, serial communication protocols can further be categorized by whether they utilize a clock signal to tell all participants when to send or expect data. First, synchronous serial communication requires a shared clock signal that orchestrates participant data exchange on the data lines. In contrast, asynchronous protocols don’t rely on a clock signal and can thus save one more I/O line for other tasks.

While synchronous serial communication requires an additional clock signal, it makes many things more manageable when exchanging data, as all participants know when to send and receive bits. In contrast, asynchronous protocols call for more elaborate methods to ensure proper transmission of information between communication partners.

Asynchronous Serial Protocol Design Decisions

The step of omitting the clock signal, which usually orchestrates all communicating parties on the network, introduces the challenge of ensuring that all devices know when messages start and end and how they are built. There are a few configuration options when choosing an asynchronous serial communication protocol. However, regardless of the choices, all devices on the network must ultimately implement and follow the same protocol to ensure correct and robust data transmission.

First, the baud rate specifies how many bits per second are sent over the serial data line, effectively determining the network's transmission rate. This value influences how long the sender holds the data line high or low, depending on the value to send and how frequently the receiver samples the data line to read input bits. Lower baud rates mean slower transmission speeds. However, simple, cost-effective hardware can often not handle high baud rates, which leads to data transmission errors.

Next, the communicating devices must agree on a data format for exchanging messages. Like old-fashioned letters, each transmission must have a clear, distinct beginning and end so that the receiver knows that it got a complete message. Typically, messages - also referred to as data frames in this context - comprise four main components: the start bit (or header), the data bits, the parity bit, and the stop bit(s):

What is Serial Communication, and How Does it Compare to Parallel? Serial data frames contain a start condition, the data itself, a parity bit, and a distinct stop sequence.

The single start and (potentially multiple) stop bit(s) tell the receiver when to expect incoming data and when the transmission is complete. Depending on the protocol, the data line remains in either a high or low state when no data is on the line. Then, the sender pulls the data line to the opposite state to start a transmission, which happens during that start portion of the frame.

Next, the sender transmits a fixed number of data bits with a predetermined baud rate. Both parties must interpret the data bits in the same order to share information correctly, as D0 may be the first or last bit of each message. The parity bit then serves as an optional error-correcting measure, and it may be set to even or odd, depending on the number of high bits in the data. The parity bit is set if the number of set bits is odd; if, on the other hand, the data contains an even number of high bits, the parity is zero. Finally, the stop bit pulls the data line back to its resting state, indicating the end of a frame.

Communication Lines and Modes

Finally, there’s one more thing to communication: agreeing when one party needs to talk while the other listens. In simplex serial communication - the simplest form possible - data travels only one way, from the sender to the receiver. This mode only requires a single data line, and the receiver never answers. In half-duplex mode, both parties take turns in sending and receiving data. Both devices can simultaneously send data over the bus in full-duplex mode, thereby increasing information exchange. However, this increase also asks for more complex hardware and software implementations.

While the half-duplex mode doesn’t require two communication lines, the devices still often use dedicated RX and TX pins for receiving and sending data, respectively. Note that these labels reference the role of the device itself, meaning that all devices will send out data using their respective TX pin while utilizing their RX pin to read incoming bits. Therefore, the RX and TX lines must be crossed between devices:

What is Serial Communication, and How Does it Compare to Parallel? This image illustrates the difference between simplex and duplex communication modes.

Summary

Serial communication is one of two forms of data exchange between electronic devices, the other being parallel transmission. Serial communication requires fewer data lines and can, thus, save precious physical space on PCBs. However, a single data line typically doesn’t yield the same data throughput that could be achieved using multiple parallel lines.

When communication happens synchronously, a global clock tells all parties when to send or expect data. In asynchronous communication, special bits mark the beginning and end of data frames. In addition, all parties must agree on a predetermined data frame format and baud rate.

In simplex communication mode, a single sender broadcasts data to one or multiple receivers without receiving an answer. In duplex mode, the devices exchange data both ways, either in turns (half-duplex) or simultaneously (full duplex).

TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum