PC Based 1 Communication Protocols - 2024-25 - Report

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

Communication

Protocols
Parallel Communication
Serial Communication
Classification of
Communication Protocols
 According to communication medium:
 Wired
 Wireless
 According to channel:
 Simplex: data sent in one direction only.
 Half duplex: two-way transfer, but only in one direction at a time
 Full duplex: send and receive data simultaneously.
Classification of Communication
Protocols

According to synchronization:
Synchronous (SPI – I2C):
In synchronous communication, both the
transmitter and receiver share a common
clock. Thus, one line is assigned to the
clock.
Asynchronous (UART)
Definitions
 Bit Rate bit/Sec --- bits transmitted in one sec
 Buad Rate Baud/Sec --- signal transmitted in
one sec

Most Cases
1 Baud = 1 Bit
 Frame
 Protocol
The RS 232
 RS-232: Recommended Standard 232

 Also called: “serial port” or COM port.

 Used to be a common interface to connect computer to


other devices.

 Note: most modern laptops do not have serial port!


7
UART = Universal Asynchronous
Receiver Transmitter
UART
A Character Frame Consists of:
 The line is initially HIGH (no transmission).
 Start bit: the bit which signals the receiver that data
is coming.
 Data bits: amount of actual data in a packet (5, 7, or
8 bits).
 Parity: It's used for error checking in serial
communication. There are two types of parity: even
and odd. The option of no parity is also available.
 Stop bit: is used to indicate the end of a single
packet. Typical values are 1, 1.5, and 2 bits. The stop
bits not only indicate the end of transmission but also
give the computers some room for error in the clock
speeds. 10
Connecting two PCs

 To connect two PCs, the


simplest way is to connect
 Pin 2 & Pin 3
 Pin 3 & Pin 2
 Pin 5 & Pin5

 This can be done with a


cross cable.

 After that we should use a


suitable software to
implement the serial 11

communications.
Connecting two microcontrollers
(µC)
By the same way.

12
Connecting a PC to a
µC
• This case is more difficult because The RS 232 logic levels
are different from the (TTL 0&5V) levels.

• The region between +3 and -3 volts is undefined.


• The serial port in the µC uses a unit called the UART
which uses 0 and 5V logic levels.
• Due to differences in logic levels, we need to use a
converter, e.g. MAX 232 IC.
13
Connecting a PC to a
µC

14
USB to TTL Converter
Tx and Rx must agree on:

1) The transmission rate (bit rate)


By adjusting the same bit rate in both transmitter and receiver, they
can adjust the time of each bit and get the data correctly.

2) The number of data bits encoding a character

3) The optional parity bit

4) The number of stop bits

16
Numerical Example
Assume that the bit rate is 9600 bit/sec (bps). Find the time
interval of one bit. How many bytes can be sent in one second if
there is one start and one stop bits?

Answer:

 Interval of one bit = 1/9600 = 104 μsec.

 To send 8 bits of data, we need to transmit additional 1 start +


1 stop bit for a total of 10 bits. Hence we can send 9600/10 =
960 Byte/sec. 17
Serial port in Arduino

18
Report:
Serial Read and
Write?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy