Reviews my responses

Thread Starter

Dadu@

Joined Feb 4, 2022
155
I recently gave interview for a role as an embedded software developer where I was asked to explain I2C communication. I provided an explanation but am unsure about its accuracy.

I described I2C as a protocol for data exchange between multiple master and slave devices using SDA and clock signals. Its unidirectional protocol, allowing data to be sent or received at one time but not simultaneously.

I2C write operations
If we want to write a slave device. We generate the start condition than send the slave address with write bit. Once slave acknowledge address. We send address of internal register. If slave acknowledged address then master send data to address if slave acknowledged data then master can continue to send more byte or terminate communication by generating stop conditions.

Could someone review this explanation and suggest any improvements or corrections? I want to ensure I'm providing a relevant and accurate explanation during interview

Note : I haven't mentioned read operation here
 

Ya’akov

Joined Jan 27, 2019
10,239
Were I evaluating your answer I would note that it is disorganized concerning the conceptual level of the facts you’ve presented. While each thing is basically correct, the combination isn’t clear at all.

I2C [is] a protocol for data exchange between multiple master and slave devices using SDA and clock signals. Its unidirectional protocol, allowing data to be sent or received at one time but not simultaneously.
From a person who has mastered not only I²C but the concept of communications protocols I would expect something more like:

I²C (Inter-Integrated Circuit [Protocol]) is a synchronous, unidirectional, address-based, serial protocol designed for communication among integrated circuits on a PCB. It was designed by Philips to be lightweight, requiring only two lines, and simple to implement on very limited devices. It uses a master/slave architecture and permits multi-master and multi-slave configurations.

I²C is not a standard though it has been broadly adopted since its introduction. Each manufacturer has its own implementation with particular requirements. These are basically compatible but in particular it is critically important to refer to published reference material on timing when programming for a particular device. There are both datasheets for particular devices and general application notes available for the various manufacturers.

Because of these manufacturer specific idiosyncrasies, programming for I²C is usually best done using a reliable, pre-existing libraries whenever possible and relying heavily on any manufacturer resources of example code when not.


This is just an example. I tried to include information showing that I have an idea of the general idea of protocols, the value of using I²C in particular, and an overview of the things important to consider when programming for I²C including best practices and pitfalls.

I would want the information to demonstrate knowledge of applying I²C to practical problems, and enough detail that each important part of the protocol was mentioned in a way that shows a grasp of its place.
 

Thread Starter

Dadu@

Joined Feb 4, 2022
155
Were I evaluating your answer I would note that it is disorganized concerning the conceptual level of the facts you’ve presented. While each thing is basically correct, the combination isn’t clear at
Thank you for pointing that out. I've noticed that many interviewers often focus on understanding of read and write operations. It seems to be a crucial area of interest during technical discussions
Write Operation:

  1. Start Condition: The master initiates communication by sending a start condition (S) on the bus.
  2. Addressing: The master sends the 7-bit address of the slave device it wants to write to along with the write bit (R/W = 0).
  3. Acknowledgment: The addressed slave device acknowledges its address.
  4. Data Transmission: The master sends one or more bytes of data to the slave device.
  5. Acknowledgment: After sending each byte, the master waits for an acknowledgment from the slave before sending the next byte.
  6. Stop Condition: To conclude the write operation, the master generates a stop condition (P), signaling the end of the communication.

Read Operation:

  1. Start Condition: Similar to the write operation, the master sends the start condition (S).
  2. Addressing : The master sends the 7-bit address of the slave device it wants to read from along with the read bit (R/W = 1).
  3. Acknowledgment : The addressed slave device acknowledges its address.
  4. Data Reception : The slave device sends one or more bytes of data to the master.
  5. Acknowledgment/No Acknowledgment: After receiving each byte, the master sends an acknowledgment to the slave for all bytes except the last one. For the last byte, the master does not send an acknowledgment, indicating the end of the read operation.
  6. Stop Condition : Finally, the master generates the stop condition (P) to complete the read operation.

What's your opinion on this points
 
Top