Professional Documents
Culture Documents
E–CSE–I ST YEAR
ASSIGNMENT 2
1. Compare and contrast UART, I2C, SPI and CAN communication Interfaces
in terms of their features, advantages and typical applications.
CAN (Controller Area Network): CAN is a serial communication protocol designed for
robust communication in noisy environments. It supports multi-master communication and
prioritized message-based communication. CAN is commonly used in automotive systems
(e.g., in-vehicle networks), industrial automation, and medical devices where reliability and
real-time communication are critical.
2. Provide examples of real world applications where UART, I2C, SPI and CAN
communication interfaces are commonly used.
GPS Modules: UART is often used to communicate between GPS modules and
microcontrollers in navigation systems.
SD Cards: Secure Digital (SD) cards and microSD cards use the SPI interface for
communication with microcontrollers in devices such as cameras,
smartphones, and GPS units.
1. Start Bit: Communication begins with the transmission of a start bit, which is always
a logic low (0). The start bit signals the beginning of a data frame.
2. Data Transmission: Following the start bit, the UART transmitter sends the data bits
(usually 8 bits) one at a time, starting with the least significant bit (LSB) and ending
with the most significant bit (MSB). The data bits represent the actual information
being transmitted.
3. Parity Bit (Optional): Optionally, a parity bit may be included for error detection. The
parity bit is set to either even or odd parity based on the number of logic high (1) bits
in the data frame.
4. Stop Bit(s): After transmitting the data bits (and parity bit, if used), one or more stop
bits are sent to signal the end of the data frame. The stop bit(s) is always a logic high
(1) and provides a period of time for the receiving device to prepare for the next data
frame.
5. Idle State: When no data is being transmitted, the UART communication line remains
in an idle state, typically held at logic high (1). This idle state distinguishes it from
other communication lines.
7. Error Detection: UART communication does not inherently include error detection or
correction mechanisms. However, parity bits can be used for basic error detection,
although they are optional and not always utilized.
8. Baud Rate: The baud rate, measured in bits per second (bps), determines the rate at
which data is transmitted and received over the UART interface. Both the transmitter
and receiver must operate at the same baud rate for successful communication.
---------------X----------------