KEMBAR78
Communication Protocols | PDF | Computer Engineering | Physical Layer Protocols
0% found this document useful (0 votes)
61 views24 pages

Communication Protocols

The document discusses various communication protocols including I2C, SPI, and UART, which are used for data transfer between microcontrollers and peripheral devices. I2C supports multi-master and multi-slave configurations, while SPI is faster but requires more wiring for multiple slaves. UART is a universal asynchronous protocol that transmits data over a two-wire interface without a clock signal.

Uploaded by

Niharika Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views24 pages

Communication Protocols

The document discusses various communication protocols including I2C, SPI, and UART, which are used for data transfer between microcontrollers and peripheral devices. I2C supports multi-master and multi-slave configurations, while SPI is faster but requires more wiring for multiple slaves. UART is a universal asynchronous protocol that transmits data over a two-wire interface without a clock signal.

Uploaded by

Niharika Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

‭Communication Protocols‬

I‭2C, SPI, UART, and similar protocols are communication protocols used to enable data transfer‬
‭between microcontrollers, sensors, displays, and other peripheral devices. These are‬‭serial‬
‭communication protocols‬‭, meaning data is sent one‬‭bit at a time over a single wire or channel,‬
‭as opposed to parallel communication where multiple bits are sent simultaneously.‬

‭1. I2C (Inter integrated circuit bus protocol):‬

‭‬
● ‭ sed for‬‭serial‬‭communication‬
U
‭●‬ ‭With just‬‭2 lines‬‭we can interface‬‭128 devices (2^7)‬
‭●‬ ‭Used in general for low BW communication‬
‭●‬ ‭2 lines:‬
‭○‬ ‭SCL‬‭: serial clock line, provided for‬‭synchronous‬‭communication‬
‭○‬ ‭SDA‬‭: serial data line‬
‭●‬ ‭Supports‬‭Multi master Multi slave‬‭configuration‬
‭ ‬ ‭Both SCL and SDA should be‬‭hold up‬‭, like we can place‬‭5V connection through register‬

‭●‬ ‭Not necessary as many masters have internal pull up‬

‭‬ T
● ‭ ype:‬‭Synchronous,‬‭multi-master, multi-slave.‬
‭●‬ ‭Number of Wires:‬‭2 (SDA for data, SCL for clock).‬
‭●‬ ‭Addressing:‬‭Each device on the bus has a unique address,‬‭7 bit addressing‬‭to comm‬
‭with 128 devices obv‬

‭●‬
‭●‬

‭Majority times, data from master is sent to slave‬

‭Clock stretching‬

‭ lock stretching‬‭when‬‭master is transferring data‬‭to slave‬‭and if there is some imp task‬


C
‭that slave needs to do, then‬‭slave will do‬‭clock stretching‬

‭ lock stretching is a mechanism used in the‬‭I²C (Inter-Integrated‬‭Circuit) protocol‬‭that‬


C
‭allows a‬‭slave device‬‭to hold the clock line (SCL)‬‭low‬‭to slow down communication‬
‭when it needs more time to process data.‬
‭ o,‬‭Slave makes‬‭this clock signal SCL‬‭low‬‭till it‬‭is ready to continue‬
S
‭Once slave releases low signal, then master is allowed to send data to slave‬

I‭2C supports multi master multi slave config, but Mostly we do single master multiple‬
‭slave‬

‭Data Transmission in I2C Protocol‬

‭How It Works:‬

‭‬ O
● ‭ ne device acts as a‬‭master and controls the clock‬‭(SCL).‬
‭●‬ ‭Multiple devices (masters/slaves) can share the same bus.‬
‭●‬ ‭Communication starts when the‬‭master sends a start‬‭condition followed by the address‬
‭of the target device.‬
‭●‬ ‭Data is sent/received in‬‭8-bit frames,‬‭followed by‬‭an ACK/NACK from the receiver.‬

‭When master wants to initiated Data write or read:‬

‭ .‬ M
1 ‭ aster first sends the‬‭start bit‬
‭2.‬ ‭Now master should have‬‭unique address of the slave‬‭from which it wants to‬
‭read/write‬
‭So‬‭master‬‭will have to send this‬‭address on SDA line‬
‭3.‬ ‭After this‬‭master will tell whether it wants to read‬‭or write data,‬
‭For‬‭write:0, read:1‬
‭4.‬ ‭After this, Slave will‬‭acknowledgement‬‭:‬
‭a.‬ ‭0 if slave is ready‬
‭b.‬ ‭1 if not ready‬

‭5.‬ ‭In case of‬


‭a.‬ ‭Writing: Master will‬‭send data‬‭to slave : say 01101100‬‭,8 bit‬
‭b.‬ ‭Reading: Slave will send data to master: say 01101100 ,8 bit‬
‭6.‬ ‭After receiving data‬
‭a.‬ ‭Writing: Slave‬‭sends acknowledgement‬‭to master :‬‭ACK‬‭=0‬
‭b.‬ ‭Reading: Master sends acknowledgement to slave:‬‭ACK‬‭=1‬
‭7.‬ ‭At the end, Master sends‬‭stop bit‬

‭2‬‭.‬‭SPI Protocol:‬

‭‬
● ‭ erial‬‭peripheral interface‬‭bus‬
S
‭●‬ ‭Used for serial communication‬
‭●‬ ‭Needs‬‭4 wires‬
‭●‬ ‭Synchronous comm‬‭(as we provide clock along with data)‬
‭●‬ ‭Supports‬‭half and full duplex‬‭communication‬
‭‬ U
● ‭ sed for on board short range comm only (like interfacing a microcontroller with display)‬
‭●‬ ‭Max‬‭speed‬‭is 10Mbps, far‬‭better than I2C‬‭, so better‬‭bandwidth‬
‭●‬ ‭Master provides cock for synchronous.‬

‭Key Features:‬

‭‬ T
● ‭ ype:‬‭Synchronous,‬‭master-slave.‬
‭●‬ ‭Only Single master, Multi slave allowed‬
‭●‬ ‭Number of Wires:‬‭4 (‬‭SCLK, MOSI, MISO, and SS).‬
‭○‬ ‭SCLK:‬‭Clock signal.‬
‭○‬ ‭MOSI:‬‭Master Out Slave In (data from master to slave).‬
‭○‬ ‭MISO:‬‭Master In Slave Out (data from slave to master).‬
‭○‬ ‭SS:‬‭Slave Select (used to enable/disable a specific‬‭slave device).‬
‭●‬ ‭Data Rate:‬‭Typically faster than I2C (up to tens of‬‭Mbps).‬
‭How to configure 2 devices having spi protocol?‬
‭‬
● ‭ S/CS : We have slave select/ chip select line to select slave‬
S
‭●‬ ‭SCLK : Master will provide serial clock to slave‬
‭●‬ ‭MOSI : Master sends data to slave‬
‭●‬ ‭MISO : Master will read data from slave‬

‭How protocol is providing Half duplex comm?‬


‭ alf duplex : one direction comm possible, so when master reads , it cannot write and‬
H
‭vice versa‬
‭So when master has finished sending data MOSI, only then slave can send data MISO‬

‭Protocol also supports Full duplex, how?‬


‭ aster and slave can send data at the same time simultaneously‬
M
‭Inside Master and slave there will be‬‭shift registers‬

‭ oth shift reg connected with clock generator‬


B
‭Clock provided by master‬

‭ sing them, we can swap data from master to slave‬


U
‭Say i have‬
‭40H and 60H‬
‭Then after 8 clock cycles, we get‬
‭60H and 40H‬

‭How It Works:‬

‭‬
● ‭ ne device is the‬‭master‬‭, and the others are slaves.‬
O
‭●‬ ‭Master generates the clock signal (SCLK).‬
‭●‬ ‭Data is exchanged simultaneously in both directions (full-duplex) via MOSI and MISO.‬
‭●‬ ‭Each slave device has its own‬‭Slave Select (SS)‬‭pin,‬‭which the master uses to enable‬
‭or disable communication with a specific device.‬

‭Communication happens wrt 4 different modes:‬

‭ POL =0, CPHA(clock phase)=0 → data read happening at rising edge‬


C
‭CPOL =1,CPHA(clock phase)=0→ data read happening at falling edge‬
‭ POL =0,CPHA(clock phase)=1→ data read happening after 180 phase of clock‬
C
‭CPOL =1,CPHA(clock phase)=1→ data read happening after 180 phase of clock‬

‭ ne of disadvantage is that it requires 4 wires for 2 device communication, so if we‬


O
‭increase no. of slaves, more no. of wires required for slave select, remaining 3 lines‬
‭common for other slaves‬

‭Advantages:‬

‭‬ H
● ‭ igh-speed communication.‬
‭●‬ ‭Full-duplex transmission.‬
‭●‬ ‭No need for addressing.‬

‭Disadvantages:‬
‭‬ M
● ‭ ore wires compared to I2C.‬
‭●‬ ‭Limited scalability (each slave needs a separate SS line).‬

‭Applications:‬

‭●‬ ‭High-speed data transfer for sensors, SD cards, flash memory, and display modules.‬

‭Q) Multi-Master & Multi-Slave Configurations in I²C and SPI‬

‭ oth‬‭I²C (Inter-Integrated Circuit)‬‭and‬‭SPI (Serial‬‭Peripheral Interface)‬‭support multiple‬


B
‭devices, but their handling of‬‭multi-master‬‭and‬‭multi-slave‬‭configurations differs.‬

‭I²C: Supports Multi-Master & Multi-Slave ✅‬


‭1. Multi-Slave I²C‬

I‭²C is designed for multi-slave communication. Each slave has a‬‭unique 7-bit or 10-bit‬
‭address‬‭, and the master selects which slave to communicate‬‭with.‬

‭‬ W
● ‭ iring:‬‭All devices share two lines (‬‭SDA - Data, SCL‬‭- Clock‬‭).‬
‭●‬ ‭Communication:‬‭Master sends the‬‭address‬‭, and only‬‭the matching slave responds.‬
‭●‬ ‭Example:‬‭A microcontroller communicating with multiple‬‭sensors like temperature and‬
‭pressure sensors.‬

‭2. Multi-Master I²C‬

‭I²C allows multiple masters, but‬‭only one can control‬‭the bus at a time‬‭.‬

‭●‬ A ‭ rbitration:‬‭If two masters try to communicate simultaneously,‬‭arbitration (bitwise‬


‭comparison) determines which one continues.‬
‭●‬ ‭Clock Synchronization:‬‭If two masters provide different‬‭SCL speeds, the bus slows‬
‭down to the lowest speed.‬
‭●‬ ‭Example:‬‭Multiple microcontrollers managing the same‬‭peripheral devices.‬

‭SPI: Multi-Slave Supported, Multi-Master is Complex 🚫‬


‭1. Multi-Slave SPI ✅‬
‭SPI naturally supports multiple slaves using‬‭chip select (CS/SS) lines‬‭.‬

‭‬ E
● ‭ ach slave needs a separate SS (Slave Select) line‬‭controlled by the master.‬
‭●‬ ‭Wiring:‬
‭○‬ ‭MOSI (Master Out Slave In)‬
‭○‬ ‭MISO (Master In Slave Out)‬
‭○‬ ‭SCK (Serial Clock)‬
‭○‬ ‭SS (Slave Select) – One per slave‬
‭●‬ ‭Example:‬‭A microcontroller communicating with an SD‬‭card and a display.‬

‭2. Multi-Master SPI 🚫 (Difficult to Implement)‬

‭SPI does‬‭not natively support‬‭multiple masters because:‬

‭‬ T
● ‭ here is‬‭no built-in‬‭arbitration‬‭like in I²C.‬
‭●‬ ‭Masters could drive the‬‭clock (SCK) and chip select‬‭(SS) lines‬‭at the same time,‬
‭causing conflicts.‬
‭●‬ ‭Workarounds exist using‬‭external arbitration‬‭circuits‬‭or‬‭bus contention handling‬‭, but‬
‭they are complex.‬

‭Comparison Table‬

‭Conclusion‬

‭ ‬ I‭²C is better for multi-master systems‬‭because of‬‭built-in arbitration.‬



‭●‬ ‭SPI is better for speed‬‭but needs extra lines for‬‭each slave and does not support‬
‭multiple masters easily.‬
‭3‬‭.‬‭I2C V/S SPI Protocol:‬

‭ PI is faster‬
S
‭No need of acknowledgement in SPI as dedicated lines are provided‬
‭I2C has redundancy in bits→ start, Stop, Acknowledgement, address‬
‭I2C is slower‬
‭For high BW, Full duplex → SPI‬
‭Multiple masters devices → I2C better‬

‭4‬‭.‬‭UART Protocol:‬

‭‬
● ‭ erial‬‭protocol‬
S
‭●‬ ‭U : universal, means we can apply this protocol to any transmitter and receiver‬
‭●‬ ‭A :‬‭Asynchronous, we‬‭don't use clock signa‬‭l for comm‬‭of data‬
‭●‬ ‭2 wire‬‭Communication‬
‭●‬ ‭Tx and Rx‬
‭●‬ ‭Baud Rate should be same‬
‭●‬

‭Comparison of UART and Parallel Comm‬

‭In terms of bus complexity, UART is better, but in terms of speed, Parallel is better‬
‭UART Configuration‬

‭ aud rate should be same‬‭for device 1 and 2, o‬‭therwise‬‭they cant understand at what speed the‬
B
‭data is coming, normally baud rate is 9600 for UART‬

‭Also data length should have fixed data length‬

‭What is UART?‬

‭ ART (Universal Asynchronous Receiver Transmitter) is a hardware communication protocol‬


U
‭used for serial communication between two devices. It is widely used in embedded systems,‬
‭microcontrollers, and computers to send and receive data over a simple two-wire interface.‬

‭How Does UART Work?‬

‭ ART transmits and receives data‬‭asynchronously‬‭, meaning‬‭it does not require a clock signal.‬
U
‭Instead, it relies on‬‭pre-agreed settings between‬‭the sender and receiver‬‭, such as‬‭baud rate,‬
‭start/stop bits, and parity bits‬‭.‬

‭Basic UART Communication Steps:‬

‭1.‬ D ‭ ata Preparation:‬‭The transmitter takes parallel data‬‭(e.g., an 8-bit byte) and converts it‬
‭into a serial stream of bits.‬
‭2.‬ ‭Data Transmission:‬‭The transmitter sends data frame-by-frame,‬‭starting with a‬‭start‬
‭bit‬‭, followed by data bits, an optional‬‭parity bit‬‭,‬‭and a‬‭stop bit‬‭.‬
‭3.‬ ‭Data Reception:‬‭The receiver detects the start bit‬‭and reads the incoming bits based on‬
‭the agreed baud rate.‬
‭4.‬ ‭Data Reconstruction:‬‭The receiver converts the serial‬‭data back into parallel form.‬

‭UART Frame Structure‬

‭Each data packet in UART follows a specific format:‬


| Start Bit | Data Bits (5-9) | Parity Bit (Optional) | Stop Bit (1 or‬

2) |‬

‭ .‬
1 ‭ tart Bit (1 bit)‬‭→ Always LOW (0) to indicate the‬‭beginning of a new data frame.‬
S
‭2.‬ ‭Data Bits (5-9 bits)‬‭→ The actual data being transmitted‬‭(typically 8 bits).‬
‭3.‬ ‭Parity Bit (Optional, 1 bit)‬‭→ Used for error checking‬‭(Even or Odd parity).‬
‭4.‬ ‭Stop Bit (1-2 bits)‬‭→ Always HIGH (1) to indicate‬‭the end of the data frame.‬

‭Key Features of UART‬

‭‬
● ‭ ull-duplex Communication:‬‭Can send and receive data‬‭simultaneously.‬
F
‭●‬ ‭Asynchronous:‬‭No need for a clock signal.‬
‭●‬ ‭Simple Wiring:‬‭Requires only‬‭two wires‬‭(TX for transmission,‬‭RX for reception).‬
‭●‬ ‭Baud Rate:‬‭Determines the speed of data transfer (e.g.,‬‭9600, 115200 bps).‬
‭●‬ ‭Error Detection:‬‭Uses parity bits and stop bits to‬‭detect errors.‬

‭Advantages of UART‬


‭ ‬‭Simple and low-cost‬

‭ ‬‭Reliable for short distances‬

‭ ‬‭No need for a separate clock signal‬

‭ ‬‭Supports full-duplex communication‬

‭Disadvantages of UART‬


‭ ‬‭Limited speed‬‭(Compared to SPI/I2C)‬

‭ ‬‭Only supports point-to-point communication‬‭(No multiple‬‭device support)‬

‭ ‬‭Data frame overhead‬‭(Start, stop, and parity bits‬‭add extra bits)‬
‭Comparison with Other Communication Protocols‬

‭ sing‬‭parity bit‬‭we can identify whether we have received‬‭data correctly or not, i.e.‬‭error‬
U
‭correction‬
‭Even parity:0‬

‭Key Features:‬

‭●‬ ‭Type:‬‭Asynchronous, point-to-point communication.‬


‭●‬ N ‭ umber of Wires:‬‭2 (TX for transmit, RX for receive). Often uses GND for a common‬
‭reference.‬
‭●‬ ‭Data Rate:‬‭Configurable using baud rates (common values:‬‭9600, 115200, etc.).‬
‭●‬ ‭Data Frame:‬‭Start bit, data bits (5–9), optional parity‬‭bit, stop bit(s).‬

‭How It Works:‬

‭‬ U
● ‭ nlike I2C and SPI, UART does not use a clock line.‬
‭●‬ ‭Devices must agree on the same‬‭baud rate‬‭(speed of‬‭communication).‬
‭●‬ ‭Data is transmitted asynchronously in chunks (frames), with each frame having:‬
‭○‬ ‭A‬‭start bit‬‭(indicates the start of data).‬
‭○‬ ‭Data bits‬‭(the actual information).‬
‭○‬ ‭Optional‬‭parity bit‬‭for error checking.‬
‭○‬ ‭Stop bit(s)‬‭to indicate the end of the frame.‬

‭Advantages:‬

‭‬ S
● ‭ imple, requires only two lines.‬
‭●‬ ‭Widely supported by most microcontrollers.‬

‭Disadvantages:‬

‭‬ L
● ‭ imited to two devices (point-to-point).‬
‭●‬ ‭Slower compared to I2C and SPI.‬
‭●‬ ‭Requires both devices to use the same baud rate.‬

‭Applications:‬

‭●‬ D
‭ ebugging (serial communication with PCs), GPS modules, Bluetooth modules, and‬
‭GSM modules.‬
‭5‬‭.‬‭USB:‬

‭ ajority in all computers, we have usb 2.0 as this much data rate is sufficient‬
M
‭It has black strip‬

‭We have different type of usb for different application‬

‭ ajority we can see have 4 busses‬


M
‭2 busses : D+ and D-, carry the same info but are mirror images‬
‭And, at the receiver, there will be a differential amplifier, i.e. we amplify the difference of both the‬
‭signals‬
‭We will have better SNR (higher)‬

‭2.5 - (-2.5) = 5V, so increase SNR‬

‭ igh‬‭Signal-to-Noise Ratio (SNR)‬‭is desirable in many‬‭applications because it indicates that‬


H
‭the signal (desired information) is much stronger than the noise (unwanted interference).‬

‭6. RS-232:‬

‭RS-232: The Standard for Serial Communication‬

‭ S-232 (Recommended Standard 232) is a‬‭serial communication‬‭standard‬‭used for‬


R
‭transmitting data between computers and peripheral devices. It defines‬‭electrical, signal‬
‭timing, and physical‬‭characteristics for communication.‬
‭Key Features of RS-232‬

‭‬
● ‭ synchronous communication‬‭(no clock signal required).‬
A
‭●‬ ‭Point-to-point connection‬‭(only two devices can communicate‬‭at a time).‬
‭●‬ ‭Voltage levels:‬‭Uses‬‭high voltage‬‭for data representation.‬
‭●‬ ‭Supports full-duplex‬‭(simultaneous send/receive).‬
‭●‬ ‭Slow speed‬‭compared to modern serial interfaces.‬

‭How RS-232 Works?‬

‭RS-232 transmits‬‭binary data‬‭(0s and 1s) as‬‭voltage‬‭levels‬‭:‬

‭Logic Level‬ ‭Voltage‬

‭1 (Mark/Idle)‬ ‭-3V to -15V‬

‭‬
0 ‭+3V to +15V‬
‭(Space/Active)‬

‭ his is‬‭inverted compared to TTL logic‬‭(0V for LOW,‬‭5V for HIGH). That's why‬‭level‬
T
‭converters‬‭(like MAX232) are needed to connect RS-232‬‭to microcontrollers.‬

‭RS-232 Pin Configuration‬

‭The‬‭DB-9 (9-pin) connector‬‭is the most commonly used‬‭RS-232 connector.‬

‭Pin‬ ‭Name‬ ‭Function‬

‭1‬ ‭DCD‬ ‭Data Carrier Detect‬

‭2‬ ‭RXD‬ ‭Receive Data‬

‭3‬ ‭TXD‬ ‭Transmit Data‬

‭4‬ ‭DTR‬ ‭Data Terminal Ready‬

‭5‬ ‭GND‬ ‭Ground‬

‭6‬ ‭DSR‬ ‭Data Set Ready‬


‭7‬ ‭RTS‬ ‭Request to Send‬

‭8‬ ‭CTS‬ ‭Clear to Send‬

‭9‬ ‭RI‬ ‭Ring Indicator‬

‭‬
● ‭ XD (Transmit Data):‬‭Sends data from the device.‬
T
‭●‬ ‭RXD (Receive Data):‬‭Receives data from the other device.‬
‭●‬ ‭GND (Ground):‬‭Common ground for both devices.‬
‭●‬ ‭RTS/CTS & DTR/DSR:‬‭Flow control signals.‬

‭Some applications only need‬‭TXD, RXD, and GND‬‭for‬‭basic data transmission.‬

‭RS-232 Communication Process‬

‭ .‬
1 ‭ tart Bit‬‭: Indicates the beginning of data transmission.‬
S
‭2.‬ ‭Data Bits (5-8 bits)‬‭: Actual data being sent.‬
‭3.‬ ‭Parity Bit (Optional)‬‭: Used for error checking.‬
‭4.‬ ‭Stop Bit (1 or 2 bits)‬‭: Marks the end of data transmission.‬

‭The‬‭baud rate‬‭(e.g.,‬‭9600 bps‬‭) must be the same on‬‭both devices.‬

‭Advantages of RS-232‬


‭ ‬‭Simple and widely used‬

‭ ‬‭Works over long distances (up to 15m)‬

‭ ‬‭Supports full-duplex communication‬

‭Disadvantages of RS-232‬


‭ ‬‭Slow data rates‬‭(up to 115.2 kbps)‬

‭ ‬‭High voltage levels (requires level converters)‬

‭ ‬‭Limited to point-to-point communication‬

‭RS-232 vs. UART‬


‭Feature‬ ‭RS-232‬ ‭UART‬

‭Type‬ ‭Communication Standard‬ ‭Communication Protocol‬


‭ oltage‬
V ‭±3V to ±15V‬ ‭0V to 5V (TTL)‬
‭Levels‬

‭Wiring‬ ‭3-9 wires‬ ‭2 wires (TX, RX)‬

‭Speed‬ ‭Slow (~115 kbps)‬ ‭Faster (Up to Mbps)‬

‭Usage‬ ‭Long-distance communication‬ ‭Embedded systems‬

‭‬ R
● ‭ S-232 is a standard‬‭, while‬‭UART is a protocol‬‭used‬‭in microcontrollers.‬
‭●‬ ‭To interface a UART-based microcontroller with RS-232, a‬‭MAX232 converter IC‬‭is‬
‭required.‬

‭Where is RS-232 Used?‬

‭‬
● I‭ndustrial automation‬‭(PLC communication)‬
‭●‬ ‭Legacy computer peripherals‬‭(serial mouse, modems)‬
‭●‬ ‭Microcontroller debugging‬
‭●‬ ‭Point-of-sale (POS) systems‬
‭●‬ ‭Medical devices‬

‭Example: RS-232 Communication with Arduino‬

‭To connect an‬‭Arduino (UART, 5V logic)‬‭to an‬‭RS-232‬‭device‬‭, use a‬‭MAX232‬‭level shifter:‬

‭ pp‬
c
‭CopyEdit‬
void setup() {‬

Serial.begin(9600); // Initialize UART (RS-232 communication)‬

}‬

void loop() {‬

Serial.println("Hello, RS-232!");‬

delay(1000);‬

}‬

‭This will send "Hello, RS-232!" every second over the serial port.‬
‭Conclusion‬

‭ S-232 is a classic serial communication standard that has been widely used in industrial and‬
R
‭embedded systems. Though slower and gradually being replaced by USB and other protocols, it‬
‭remains useful for legacy systems and debugging purposes.‬

‭7. Parallel Communication‬


‭ arallel communication is a method of transferring data where multiple bits are transmitted‬
P
‭simultaneously over multiple channels or wires. Each bit has its own dedicated wire, and all bits‬
‭are sent at the same time. This contrasts with serial communication, where bits are sent one‬
‭after the other over a single channel.‬

‭Key Features of Parallel Communication‬

‭1.‬ ‭Multiple Wires or Channels‬‭:‬


‭○‬ ‭Each bit of data uses a separate wire.‬
‭○‬ ‭For example, an 8-bit data word requires 8 separate wires for the data.‬
‭2.‬ ‭High Speed‬‭:‬
‭○‬ ‭Since multiple bits are sent simultaneously, the data transfer rate is higher than‬
‭serial communication for short distances.‬
‭3.‬ ‭Synchronization‬‭:‬
‭○‬ ‭A clock signal is usually required to synchronize the sending and receiving ends.‬
‭This ensures all bits are interpreted correctly at the receiver.‬
‭4.‬ ‭Short Distance‬‭:‬
‭○‬ ‭Parallel communication is typically used for short distances due to problems like‬
‭signal interference and crosstalk between wires over long distances.‬

‭How It Works‬

1010‬
‭Imagine you have a‬‭4-bit data word‬‭, like‬‭ ‭. In‬‭parallel communication:‬

‭●‬ ‭Bit 1 (‬‭


1‭)‬is sent over Wire 1.‬
‭●‬ ‭Bit 2 (‬‭
0‭)‬is sent over Wire 2.‬
‭●‬ ‭Bit 3 (‬‭
1‭)‬is sent over Wire 3.‬
‭●‬ ‭Bit 4 (‬‭
0‭)‬is sent over Wire 4.‬
‭All four wires transmit their respective bits‬‭at the same time‬‭.‬

‭Example in Real Life‬

‭1.‬ ‭Computer Buses‬‭:‬


‭○‬ ‭Inside a computer, data moves between the CPU, memory, and peripherals using‬
‭parallel communication buses like the data bus.‬
‭2.‬ ‭Printers‬‭:‬
‭○‬ ‭Older printers used parallel ports (e.g., the Centronics port) to receive data from‬
‭computers.‬

‭Advantages‬

‭1.‬ ‭Faster Data Transfer‬‭:‬


‭○‬ ‭Multiple bits are transmitted simultaneously, making it faster for large volumes of‬
‭data.‬
‭2.‬ ‭Simplicity in Timing‬‭:‬
‭○‬ ‭Easier to achieve synchronous communication since all bits arrive together.‬

‭Disadvantages‬

‭1.‬ ‭Wiring Complexity‬‭:‬


‭○‬ ‭Requires more wires, making the design bulky and expensive.‬
‭2.‬ ‭Signal Degradation‬‭:‬
‭○‬ ‭Over long distances, parallel communication suffers from issues like crosstalk‬
‭and skew (timing mismatches between wires).‬
‭3.‬ ‭Distance Limitation‬‭:‬
‭○‬ ‭Best suited for short-range communication, usually within a device or a small‬
‭setup.‬

You might also like