COMMUNICATION
PROTOCOLS
1
COMMUNICATION
Two types:
1. Serial Communication
2. Parallel Communication
2
Synchronous
• Data is transmitted synchronously with clock.
• Data rate is same as clock.
• I2C, SPI, etc.
Asynchronous
• Data is not transmitted synchronously with clock
• Data rate is different for different applications.
• UART, CAN, etc.
3
Simplex
• Communication can occur only in one direction from device A to device B
only.
Half Duplex
• Data transmission can occur between device A & device B, but only one at
a time.
Full Duplex
• Data transmission can occur in between in both direction between Device A
& B simultaneously.
4
- UART
- I2C
- SPI
- CAN
5
UART/USART/LPUART
6
Serial Communication
UNIVERSAL Asynchronous
ASYNCHRONOUS
RECEIVER- Full- Duplex
TRANSMITTER
Widely- Used
7
CONNECTIONS
Two Lines : Rx and Tx.
Rx is connected to Tx.
Tx is connected to Rx.
8
DATA FORMAT
9
• Every time a communication starts, the sender sends a logic “0” signal.
START BIT
10
• After the start bit, we want to transmit the data.
• The data bits can be 5, 6, 7, 8, 9 bits, etc. to form a character (usually 8
bits).
DATA FRAME
11
• To verify the correctness of data transmission.
• Odd Parity.
• Even Parity.
PARITY BIT
12
• It is an end marker for character data.
STOP BIT
13
1. The transmitting UART receives data in parallel from the
data bus.
UART DATA
TRANSMISSION
14
2. The transmitting UART adds the start bit, parity bit, and the
stop bit(s) to the data frame.
15
3. The entire packet is sent serially from the transmitting UART
to the receiving UART. The receiving UART samples the data
line at the pre-configured baud rate.
16
4. The receiving UART discards the start bit, parity bit, and
stop bit from the data frame.
17
5. The receiving UART converts the serial data back into
parallel and transfers it to the data bus on the receiving end.
18
Since there is no clock signal in asynchronous communication,
the two communication devices need to agree on a baud rate.
Common ones are 4800, 9600, 115200, etc.
BAUD RATE
19
Only two wires for data communication
CLK signal is not required.
PROS
Parity bit for allowing to check the errors.
20
Devices need to be on the same baud rate.
CONS: Both Devices need to be configured in a same way.
21
Debugging Most GPS Modules Radios like (Bluetooth,
Wi-Fi)
USE CASES
22
Wires 2
9600, 19200, 38400, 57600,
115200, 230400, 460800, 921600,
Speed 1000000, 1500000
Methods of
SUMMARY Transmission
Serial or
Asynchronous
Parallel? Serial
Maximum
Number of
Masters 1
23