Recall & Review
beginner
What is I2C communication used for in embedded systems?
I2C is a communication protocol used to connect multiple devices using just two wires: one for data (SDA) and one for clock (SCL). It allows microcontrollers to read from or write to sensors and other peripherals.
Click to reveal answer
beginner
In I2C, what does the 'read' operation mean?
A 'read' operation means the microcontroller requests data from a device on the I2C bus. The device sends back the requested data over the data line.
Click to reveal answer
intermediate
What are the two main steps to read data from an I2C device?
1. Send the device address with a write flag to specify the register to read from.<br>2. Send the device address with a read flag to receive the data from that register.
Click to reveal answer
intermediate
Why do you send the device address twice when reading data from an I2C device?
The first time is to tell the device which register you want to read (write mode). The second time is to actually read the data from that register (read mode).
Click to reveal answer
intermediate
What is a common function prototype to read data from an I2C device in embedded C?
int i2c_read(uint8_t device_addr, uint8_t register_addr, uint8_t *data, size_t length);<br>This function reads 'length' bytes from 'register_addr' of the device at 'device_addr' into the buffer 'data'.
Click to reveal answer
What are the two wires used in I2C communication?
✗ Incorrect
I2C uses SDA (data line) and SCL (clock line) for communication.
When reading data from an I2C device, what do you send first?
✗ Incorrect
You first send the device address with the write flag to specify the register to read.
What does the microcontroller receive during an I2C read operation?
✗ Incorrect
During a read operation, the microcontroller receives data from the device.
Why is the device address sent twice in an I2C read?
✗ Incorrect
The first address with write flag sets the register, the second with read flag reads data.
Which of these is a typical return value for a successful I2C read function?
✗ Incorrect
A return value of 0 usually means success in embedded C functions.
Explain the step-by-step process to read a byte from an I2C device register.
Think about how you tell the device what to read and then how you get the data.
You got /7 concepts.
Describe why I2C uses two wires and how data and clock signals work together during reading.
Imagine a conversation where one person talks and the other listens in time.
You got /5 concepts.