Before we delve into the technicalities of serial communication protocols, let’s talk about communication in general. We already know that communication involves the exchange of information between two or more individuals. Communication can take place in various ways – through written documents, spoken words, audio tapes, video lessons and more.
However, what does “communication” mean in embedded systems? Well, the answer is fairly easy! It is simply an exchange of data between two microcontrollers (embedded devices) in the form of bits. The exchange of data (bits) in embedded systems is governed by a set of rules known as communication protocols.
In digital communication, there are two types of data transfer:
To keep things simple, we will focus this article on the basics of serial communication protocols.
Serial CommunicationIn serial communication, the data bits are transmitted one at a time in a sequential manner over the data bus or communication channel. In order to understand this properly, let us consider this situation:
Imagine you are shooting at a target with a bow and arrow. How do the arrows fly from the bow? One at a time, right? This is exactly the case with serial communication; the data bits travel from one embedded device to another one at a time, serially.
Now that we’ve covered the basics of serial communication in embedded systems, let’s move ahead and discuss the various types of serial communication protocols.
CAN ProtocolThe CAN or Controller Area Network protocol was conceived by Robert Bosch (of GmbH) in the 1980s. Previously during the late 70’s, manufacturers started using advanced features in their automobiles, such as anti-lock braking systems, air conditioners, central door locks, airbags, gear control, engine management systems and so on.
Even though drivers (consumers) loved these new features, they came with some downsides too. These advancements required the addition of heavy and bulky wires, expensive mechanical parts and complex designs, which led to a rise in both the costs and complexity of the in-vehicle electrical and mechanical systems. Fortunately, Robert Bosch made life easier for the engineers by introducing the CAN protocol. The CAN protocol changed the management of electronic sub-systems and the communication between intelligent sensors– a simpler, cheaper method that did all that with a single cable
The widespread popularity of the CAN protocol led to its standardization as the ISO 11898 in 1993. Today, the application of CAN protocol spans the embedded systems spectrum from industrial automation to commercial restaurant fryers and beyond.
The development of these CAN applications ranges from fairly simple to extremely complex. The devices that rely on this protocol are substantial. If not designed, developed, and tested properly can cause severe damage. It is very important to make sure development is well monitored and tested. One easy and important development and test tool for CAN applications is the protocol analyzer.
Uses of the CAN Protocol:
I2C (pronounced “I two C”) or Inter-Integrated Circuits protocol was originally invented by Philips Semiconductor. It is also known as IIC (pronounced I-I-C) and I2C (pronounced I-squared-C). Although this technology is over three decades old, the I2C protocol is widely used today. In fact, it supports a vast number of embedded systems.
The I2C protocol allows embedded engineers to connect multiple slave devices with one or more master. Similar to the SPI protocol, it is intended primarily for short-distance communication within two ICs (Integrated Circuits) on the same printer circuit board (PCB).
It requires only two bi-directional wires for transmitting and receiving data bits. In terms of data rates, the I2C protocol supports speed up to 3.4 Mbps - which is pretty fast.
Here are some of the important advantages of using the I2C protocol:
However, there are some limitations. For example, it takes up much more real estate on a PCB as it uses pull-up resistors.
Uses of the I2C Protocol:
Serial Peripheral Interface, which is commonly known as S-P-I or “spy” is one of the most popular interface specifications used in embedded systems. Since its introduction in the late 1980’s by Motorola, the SPI protocol has been widely used for short distance communication in embedded systems.
Through the SPI protocol, devices communicate with each other using master-slave architecture. Although multiple slave devices can be supported by SPI, the number of master devices is limited to one. SPI is known as four-wire serial bus because it consists of four signals:
In full duplex mode, data rates over 1Mbps can be achieved - this is one of the main advantages of the SPI bus. Compared to I2C, SPI also supports using simple hardware interfacing and provides a higher throughput.
However, the SPI protocol also has some drawbacks – the lack of error-checking mechanism and slave acknowledgment feature are some of the major disadvantages.
Uses of the SPI Protocol:
It isn’t a secret that USB, the Universal Serial Bus protocol, is by far the most common protocol in use. You can probably find a dozen USB cables and connectors lying around in your home. Originally developed in the 1990s, it was intended to standardize the connection of a number of peripheral devices to a computer. Today, you can connect almost anything from external hard drives to printers to your laptop/computer through USB cables.
USB protocol was designed for two specific purposes:
There are many variations of USB connectors - the standard USB that you find on keyboards, mice, and printers. Micro USB and USB Type-C are used mostly with cell phones - however, their popularity in other devices is growing.
When a device communicates with another device through USB protocol, data travels in the form of packets. All the data packets are composed of 8-bit bytes (or multiples of 8-bit bytes, depending on the supported bitrate), where the LSB or Least Significant Bit is transmitted first. If you are building an embedded system that involves USB, make sure you use a USB protocol analyzer to monitor the data on the bus.
Uses of the USB Protocol:
eSPI was developed by the Intel Corporation as the successor to the Low Pin Count (LPC) bus. eSPI stands for Enhanced Serial Peripheral Bus Interface - its primary function is to reduce the number of pins as compared to LPC.
Uses of the eSPI Protocol:
Total Phases offers products that support all of the above listed protocols. Our range of protocol analyzers and host adapters help with the test and development of almost any embedded device using CAN, I2C, SPI, USB and/or eSPI. Click below if you would like to learn more, or have a personal demo designed to specifically address your needs.