What is a communication Protocol?
Forming the basis of device interaction, Communication Protocols are the foundation to consistent connectivity. A Two-way communication exchange is controlled by a system of rules that enable data to be transmitted between devices to send and receive messages.
In Embedded Systems Communication Protocols are vital in the function of devices. Like Wireless devices, Embedded devices need to talk to each other in order to share useful data. The functionality of such communication typically follows Master-Slave exchange, where Microprocessors (Masters) command data transmission to and from the sensor/ (Slaves).
Today, there are a range of Protocols that Embedded Engineers can consider integrating to assist device-to-device communications. From basic to specialised, each has its own merits and Application usage. Knowing the functions of each Protocol calls for more informed decisions when building Embedded Systems.
Universal Asynchronous Receiver Transmitter (UART) is perhaps the most simplified and oldest form of device communication. They are considered more of a physical circuit (IC) than Protocol, typically integrated Microcontroller chips (Inter-System). Following Serial Communication, UARTs core principle is to transmit and receive data through the use of two-wire interaction. This makes UART easy to implement at reduced costs.
Unlike the majority of protocols, data transmission follows TX-RX pin communication connected through GND common ground. So, UART operates Asynchronous transmission where no clock signal is needed for the receiver to synchronise data. This means that data interruptions may manifest, a consideration when integrating.
Instead, UART aids stop and start bits to detect incoming data. Here device communication speed must follow the same baud rate configuration (bps) to send and receive data transmission packets.
UART can be configured in three distinct ways:
- Simplex: One- way data Communication
- Half-Duplex: Data transmission in both directions but not at the same time
- Full-Duplex: Simultaneous data transmission in both directions at the same time
Famous within the Embedded world, Serial Peripheral Interface (SPI) is a highly used Protocol across a range of chipsets. Its essential function as an interface Bus is to send/receive data across Microcontrollers (Master) and Peripherals- like sensors, SDs (Slaves) to assist device communication.
Following a Serial Communication Protocol with a Full-Duplex configuration, data bits can be transmitted continuously in both directions at the same time through Master-Slave MOSI/MISO exchange. This holds an advantage over stop/start bit communication as devices can function without interruption.
The overall operation of SPI involves four signals. The Serial Clock (SCLK) assists a synchronous interface, allowing faster data transfer. The Master node commands Master In Slave Out (MISO) or Maser Out Slave In (MOSI) communication. The Slave Select lines (SS) indicate activity, when a line goes low communication is present between the Master and a Slave Node. This enables higher speeds-16Mhz-32Mhz- of data transmission than other Protocols.
Though, SPI holds a higher transfer rate than other multi Slave systems, the one Master to multiple Slave nature of SPI means it is not scalable as multiple wire interfaces are needed to establish Master/Slave transmission amongst the Bus. This should be held as a consideration when contemplating the complexity of a system.
Created by Phillips, to power electrical lightening, Intern- Integrated Circuit (I2C) communication is popular due to its Multi-Master- Multi-Slave structure- known as an I2C Bus. Such structure is valuable when registering multiple Micro-Controllers data to power a device system. I2C has varying use case Applications, particularly in IC circuits like LCD Modules, Temperatures Sensors, and Data Acquisition, etc. making it a common Protocol among the Embedded landscape
Following a Half-Duplex configuration, data can be transferred bit by bit via two-way communication at a single time. This is a consideration when considering integration as data communication happens at a lower rate. Like SPI and UART, I2C follows a Serial Communication Protocol enabling two-wire interface communication between masters and slaves. Having a less complex pin structure, I2C is attractive to integrate.
In an I2C Bus, Multiple Master and Salve device communication works via Synchronous Communication, where a clock signal controlled by the master is distributed amongst the salve nodes across two-wire interfaces, the Serial Clock Line (SCL) and Serial Data Line (SDA). When integrating I2C use case needs to be evaluated as it is more complex than most other Protocols.
USB refers to Universal Serial Bus, following an Inter-System Protocol USB communicates between two devices. Prominent in the Computer electronic device world, USB has become prominent over UART Protocols.
USB follows an Asynchronous Serial Protocol where no clock signal is needed, making it a low-cost device. When the Host device is sent communication, data transmission is relayed to a receiving endpoint device via data packets. USB can entail a range of speeds depending on the use case, from 1.5MBS to 10GBS.
If any Embedded Engineers would like to engage in these Protocols or discuss my thoughts further contact me at firstname.lastname@example.org