ECEN 449 Lecture 8: Serial Communications and I2C Protocol

AffableAltoSaxophone avatar
AffableAltoSaxophone
·
·
Download

Start Quiz

Study Flashcards

9 Questions

What method is used to write data to a device in I2C protocol?

write

What is the purpose of the acknowledgment bit in I2C protocol?

To indicate that the receiving device has received the data

What is the benefit of repeated start conditions in I2C protocol?

To reduce the number of start and stop conditions

What is the purpose of the error handling mechanism in I2C protocol?

To provide a way to recover from errors during data transfer

What is the role of the transmitter in I2C protocol?

To send data to the I2C bus

What is the role of the receiver in I2C protocol?

To receive data from the I2C bus

What is the term for a device that initiates and terminates transfers in I2C protocol?

Master

What is the purpose of arbitration in I2C protocol?

To ensure that only one master can control the bus at a time

What is the term for a situation where more than one master can control the bus at the same time in I2C protocol?

Multi-Master

Study Notes

Serial Communication Overview

  • Serial communication: information is transmitted serially (bit-by-bit) over the communication medium
  • Parallel communication: information is transferred in chunks of bits (bytes, 32-bit, 64-bit words) at a time
  • Synchronous communication: transmission requires a reference clock
  • Asynchronous communication: no reference clock, hand-shaking is required

I2C Serial Communications Protocol

  • I2C is a two-wire serial communication protocol invented by Philips Semiconductors (now NXP) in 1982
  • I2C connects microcontroller master devices with lower-speed peripheral slave devices
  • Only two lines are used: Serial Data Line (SDA) and Serial Clock Line (SCL)
  • Communication occurs in a synchronous, half-duplex manner

I2C Bus Overview

  • I2C bus is a multi-master serial single-ended computer bus to communicate with low-voltage devices
  • The I2C bus offers four data transfer speeds: standard, fast, high-speed, ultra high-speed modes
  • I2C supports 7-bit and 10-bit address space devices and its operation varies with low voltages
  • The I2C protocol connects a maximum of 128 devices

I2C Communication Modes

  • Standard Mode: Up to 100 kbps
  • Fast Mode: Up to 400 kbps
  • Fast Mode Plus: Up to 1 Mbps
  • High-Speed Mode: Up to 3.4 Mbps
  • Ultra-Fast Mode: Up to 5 Mbps

I2C Protocol - Communication Steps

  • Start Condition: Master initiates communication
  • Address + Read/Write Bit: Master sends the slave’s address
  • Data Transfer: Master writes or reads data
  • Stop Condition: Master ends communication

I2C Message Format

  • Message-oriented data transfer with four parts:
    • Start condition
    • Slave Address transmission
    • Data fields
    • Stop condition

Read/Write Control

  • Start Condition: SDA goes from High to Low, while SCL is High
  • Direction of Transfer:
    • 𝑅𝑅|𝑤𝑤 = 0: Controller (Master) sending data to peripheral
    • 𝑅𝑅|𝑤𝑤 = 1: Controller is requesting to receive data from peripheral

mbed Code Example: Reading Sensor Data

  • Initialization: Create an instance of the I2C object and specify the pins for SCL and SDA lines
  • Addressing: Specify the address of the device to communicate with
  • Reading and Writing: Use the "read" and "write" methods to communicate with the device
  • Acknowledgment: Receiving device sends an acknowledgment bit after each byte of data is transferred
  • Repeated Start: Allows for repeated start conditions for reading or writing multiple registers
  • Error Handling: Mbed provides methods for error handling, including timeouts and retries

I2C Terminology

  • Transmitter: The device that sends data to the I2C bus
  • Receiver: The device that receives data from the I2C bus
  • Controller (Master): The device that initiates/terminates transfers and generates clock signals
  • Peripheral (Slave): The device addressed by a master
  • Multi-Master: More than one master can control the bus at the same time without corrupting the message
  • Arbitration: Procedure to ensure that only one master controls the bus at a time
  • Synchronization: Procedure to synchronize the clock signals of two or more devices

Test your understanding of serial communications, including synchronous and asynchronous protocols, common interfaces, and APIs. This quiz covers UART, SPI, I2C, and other serial communication modes.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Examen Final
42 questions

Examen Final

OutstandingMoonstone avatar
OutstandingMoonstone
Technology and Communication Quiz
6 questions
DOAIOT chap  6
8 questions

DOAIOT chap 6

CleanJasmine avatar
CleanJasmine
Use Quizgecko on...
Browser
Browser