Master I2C Interview Questions and Answers from basic to advanced. Learn I2C protocol, addressing, ACK/NACK, clock stretching, arbitration, pull-up resistors, and real-world debugging tips. Perfect guide for embedded engineers and interview preparation
I2C Interview Questions & Answers (Basic to Advanced): I2C (Inter-Integrated Circuit) is a widely used serial communication protocol that enables data exchange between microcontrollers and peripherals using just two wires: SDA (Serial Data Line) and SCL (Serial Clock Line).
I2C Interview Questions : In this guide, we will explore I2C interview questions step by step, covering basic, medium, and advanced levels, with detailed answers to help you master this essential protocol.
Basic I2C Interview Questions
1. What is I2C and how does it work?
I2C is a serial communication protocol that enables multiple devices to communicate over a shared two-wire interface. It follows a master-slave architecture, where the master initiates communication, and slaves respond based on their unique addresses.
2. What are the roles of SDA and SCL in I2C communication?
- SDA (Serial Data Line): Transfers data between devices.
- SCL (Serial Clock Line): Provides synchronization for data transmission.
Both lines are open-drain and require pull-up resistors for proper operation.
3. What are the standard speeds of I2C communication?
I2C supports different speed modes:
- Standard Mode (SM): 100 kbps
- Fast Mode (FM): 400 kbps
- Fast Mode Plus (FM+): 1 Mbps
- High-Speed Mode (HS): 3.4 Mbps
- Ultra-Fast Mode (UF): 5 Mbps
4. How many devices can be connected to a single I2C bus?
I2C supports up to 127 devices (7-bit addressing) or 1024 devices (10-bit addressing). The actual number depends on bus capacitance and pull-up resistor values.
5. What is the difference between I2C and SPI?
Feature | I2C | SPI |
---|---|---|
Wires Needed | 2 (SDA, SCL) | 4 (MISO, MOSI, SCLK, SS) |
Speed | Up to 3.4 Mbps | Up to 100 Mbps |
Multi-Master Support | Yes | No |
Complexity | Low | Higher |
6. Why are pull-up resistors needed in I2C?
Since I2C uses open-drain logic, pull-up resistors are required to keep the SDA and SCL lines HIGH when no device is actively pulling them LOW.
7. What are the possible states of SDA and SCL lines?
- HIGH (Idle state)
- LOW (Active state)
- Transitioning (During data transmission)
8. What is an I2C address, and how is it assigned?
Each slave device has a unique 7-bit or 10-bit address, assigned by the manufacturer. Some devices allow hardware pin configurations to change the address.
9. What are the start and stop conditions in I2C communication?
- Start Condition: Master pulls SDA LOW while SCL is HIGH.
- Stop Condition: Master releases SDA HIGH while SCL is HIGH.
10. What are ACK and NACK in I2C?
- ACK (Acknowledge): Slave pulls SDA LOW to confirm data reception.
- NACK (Not Acknowledge): Slave releases SDA HIGH, indicating an issue.
Medium-Level I2C Interview Questions
11. What is clock stretching in I2C?
Clock stretching allows a slave device to hold SCL LOW to delay communication when it is not ready to process data.
12. What happens if two devices on the I2C bus share the same address?
This can cause bus conflicts. Solutions include:
- Using address-selectable devices
- Implementing an I2C multiplexer (e.g., PCA9548A)
13. Explain standard, fast, and high-speed modes in I2C.
Mode | Speed | Features |
---|---|---|
Standard Mode | 100 kbps | Default speed |
Fast Mode | 400 kbps | Faster data transfer |
High-Speed Mode | 3.4 Mbps | Requires special handshake |
14. How can address conflicts be resolved in I2C communication?
- Use configurable slave addresses
- Implement I2C multiplexers
- Assign software-defined addresses
15. What is a repeated start condition in I2C?
It allows the master to continue communication without releasing the bus, preventing another master from interrupting.
16. How is bus arbitration handled in I2C?
When multiple masters transmit at the same time, the master detecting a LOW while expecting HIGH loses arbitration and stops transmitting.
17. What is the difference between 7-bit and 10-bit I2C addressing?
- 7-bit Addressing: Supports up to 127 devices, commonly used.
- 10-bit Addressing: Supports more devices but requires special handling.
18. What happens if a slave does not acknowledge a transmission?
The master can either retry transmission or issue a STOP condition.
19. How do you handle common I2C errors?
- Bus Busy: Check if another master is using the bus.
- NACK Received: Verify device address and connection.
- Arbitration Lost: Implement proper recovery.
20. How does a master detect a busy slave?
The slave holds SCL LOW (clock stretching) when it is busy.
Advanced I2C Interview Questions
21. How is multi-master communication handled in I2C?
By using arbitration and clock synchronization mechanisms.
22. What are the advantages and disadvantages of software I2C vs. hardware I2C?
Feature | Software I2C | Hardware I2C |
---|---|---|
Flexibility | High | Low |
Speed | Lower | Faster |
CPU Load | High | Low |
23. How can you debug I2C issues using an oscilloscope or logic analyzer?
- Check Start/Stop conditions
- Verify correct ACK/NACK responses
- Analyze bit patterns on SDA and SCL
24. How does clock stretching impact I2C performance?
It slows down communication as the slave holds SCL LOW until it is ready.
25. How can power consumption be optimized in an I2C-based system?
- Use higher pull-up resistor values
- Implement low-power sleep modes
26. How can I2C speed be increased while maintaining data integrity?
- Reduce bus capacitance
- Use lower pull-up resistor values
27. What are common challenges in I2C implementation?
- Address conflicts
- Clock stretching issues
- Debugging complexity
28. How is priority handled in multi-master I2C mode?
The arbitration mechanism ensures the master with the lowest address wins.
29. What is PEC (Packet Error Checking) in SMBus?
PEC adds error detection by using a CRC-8 checksum.
30. How can low-power I2C communication be implemented in battery-operated devices?
- Use interrupt-driven I2C communication
- Disable I2C when not in use
If you\’re preparing for I2C interview questions, understanding the fundamentals of I2C communication is crucial. I2C (Inter-Integrated Circuit) is a widely used serial communication protocol in embedded systems. This guide will cover the most common I2C interview questions, from basic concepts to advanced troubleshooting techniques.
Best Resources to Learn I2C Interview Questions
For more details on II2C Interview Questions, check out:
Conclusion on I2C Interview Questions
Mastering I2C Interview Questions is essential for embedded software engineers. By understanding I2C fundamentals, error handling, and debugging techniques, you can confidently answer any I2C-related questions in an interview.
FAQ on I2C Interview Questions
1. What is I2C?
Ans:
I2C (Inter-Integrated Circuit) is a synchronous, multi-master, multi-slave, serial communication protocol used for connecting low-speed devices like sensors, EEPROMs, ADCs, and microcontrollers. It uses only two wires:
SDA (Serial Data Line) – for data transfer.
SCL (Serial Clock Line) – for clock synchronization.
2. What are the advantages of I2C over SPI?
Ans:
Fewer wires: I2C uses only two lines, while SPI requires at least four.
Multi-master support: I2C allows multiple masters on the same bus.
Addressing: I2C uses unique addresses for each device, while SPI uses separate chip select lines.
Cost-effective: I2C reduces pin usage, making it more efficient for embedded systems.
3. What are the limitations of I2C?
Ans:
Slower speed: I2C is slower compared to SPI, with maximum speeds of 3.4 Mbps.
Short distance: It is suited for short-range communication only (~1 meter).
Complex protocol: More complex addressing scheme and overhead compared to SPI.
4. What are the standard I2C speeds?
Ans:
Standard Mode: 100 kbps
Fast Mode: 400 kbps
Fast Mode Plus: 1 Mbps
High-Speed Mode: 3.4 Mbps
Ultra-Fast Mode: 5 Mbps (rarely used)
5. Explain how data is transmitted over I2C.
Ans:
Start Condition: The master generates a START condition by pulling SDA low while SCL is high.
Addressing: The master sends the 7-bit or 10-bit address of the slave, followed by the R/W bit.
Acknowledgment (ACK): The slave responds with an ACK by pulling SDA low.
Data Transfer: Data is transferred 1 byte at a time (MSB first), with an ACK after each byte.
Stop Condition: The master generates a STOP condition by releasing SDA while SCL is high.
6. What is the difference between 7-bit and 10-bit addressing in I2C?
Ans:
7-bit addressing: Supports 128 unique addresses (0x00 to 0x7F).
10-bit addressing: Allows 1024 unique addresses by using two bytes for addressing.
Usage: 7-bit addressing is common in embedded systems, while 10-bit is used for larger address space needs.
7. What is clock stretching in I2C?
Ans:
Clock stretching is a mechanism where the slave holds the SCL line low to force the master into a wait state. It allows the slave to:
Catch up with processing data.
Synchronize with the master.
Prevent data loss due to speed mismatch.
8. What is the role of pull-up resistors in I2C?
Ans:
Pull-up resistors are necessary to:
Keep the lines in a known state when idle (HIGH).
Ensure proper voltage levels during data transfer.
Typical values range from 2.2kΩ to 10kΩ, depending on the bus speed and capacitance.
9. How does I2C handle multiple masters?
Ans:
I2C supports multi-master mode using arbitration:
If two masters start communication simultaneously, they compare the bits being transmitted.
The master that sends a low bit while detecting a high bit loses arbitration and stops transmission.
The master with the lower address value wins arbitration.
10. What is repeated start in I2C?
Ans:
A repeated start condition allows the master to:
Continue communication without releasing the bus.
Avoid generating a stop condition between consecutive transfers.
Useful for reading data after writing without losing bus control.
11. What is clock stretching and why is it needed?
Ans:
Clock stretching occurs when a slave holds the SCL line low to delay further communication, allowing it time to process data.
It prevents the master from overrunning the slave.
Ensures data integrity.
Commonly used in slow peripherals.
12. How do you avoid data collision in I2C?
Ans:
Arbitration: Masters monitor the bus and back off if they lose arbitration.
ACK/NACK checking: Slaves respond with ACK or NACK to confirm data reception.
Bus recovery: Masters can reset the bus if it gets stuck.
13. What is the difference between ACK and NACK?
Ans:
ACK (Acknowledge): The receiver pulls the SDA line low during the 9th clock cycle, confirming successful data reception.
NACK (Not Acknowledge): The receiver leaves SDA high during the 9th clock cycle, indicating no data received or end of communication.
14. How do you troubleshoot I2C communication issues?
Check pull-up resistors: Ensure proper resistance values.
Verify address conflicts: Check for duplicate addresses.
Use logic analyzers or oscilloscopes: Inspect the waveforms.
Check clock stretching issues: Identify if slaves are holding SCL low.
Look for bus contention: Resolve multiple masters fighting for bus control.
15. What is the impact of capacitance on I2C communication?
Excessive capacitance slows down the signal rise time.
Maximum capacitance for I2C is typically 400 pF.
To mitigate this: Reduce bus length.
Use lower-value pull-up resistors.
16. How do you calculate I2C bus speed?
Bus speed is determined by: Bus Speed=1(THIGH+TLOW)\\text{Bus Speed} = \\frac{1}{(T_{HIGH} + T_{LOW})}
Where:
THIGHT_{HIGH} = High clock period.
TLOWT_{LOW} = Low clock period.
For example, in 100 kbps mode:
THIGH=4.7μsT_{HIGH} = 4.7 \\mu s
TLOW=4.7μsT_{LOW} = 4.7 \\mu s
Bus speed = 100 kbps
17. What is I2C bus arbitration?
Arbitration is the process where multiple masters compete for bus control.
It prevents data corruption by ensuring only one master controls the bus at a time.
Arbitration uses bitwise comparison of data bits.
18. How do you implement I2C in embedded systems?
Initialize the I2C module with the desired clock speed.
Set the device address.
Start communication with a START condition.
Send/receive data in bytes.
Wait for ACK/NACK signals.
End communication with a STOP condition.
19. What are common issues with I2C communication?
No ACK: Slave not responding.
Bus hang: SCL line stuck low due to clock stretching.
Address conflict: Two slaves with the same address.
Data corruption: Incorrect pull-up resistor values or noise.
What are the differences between SMBus and I2C?
Feature | I2C | SMBus |
---|---|---|
Speed | Up to 3.4 Mbps | Up to 1 Mbps |
Voltage | 2.5V, 3.3V, 5V | 3.0V to 5V |
Timeout | No timeout feature | 35 ms timeout |
Protocol | Open standard | Strict protocol specification |
Above FAQ covers the I2C Interview Questions and provides detailed answers to frequently asked interview questions, ranging from basic to advanced topics. Let me know if you want in-depth explanations or code examples wrt I2C Interview Questions!
Thank you for exploring I2c Interview Question tutorials ! Stay ahead in embedded systems with expert insights, hands-on projects, and in-depth guides. Follow Embedded Prep for the latest trends, best practices, and step-by-step tutorials to enhance your expertise. Keep learning, keep innovating!
You can also Visit other tutorials of Embedded Prep
- Multithreading in C++
- Multithreading Interview Questions
- Multithreading in Operating System
- Multithreading in Java
- POSIX Threads pthread Beginner’s Guide in C/C++
- Speed Up Code using Multithreading
- Limitations of Multithreading
- Common Issues in Multithreading
- Multithreading Program with One Thread for Addition and One for Multiplication
- Advantage of Multithreading
- Disadvantages of Multithreading
- Applications of Multithreading: How Multithreading Makes Modern Software Faster and Smarter”
- Master CAN Bus Interview Questions 2025
- What Does CAN Stand For in CAN Bus?
- CAN Bus Message Filtering Explained
- CAN Bus Communication Between Nodes With Different Bit Rates
- How Does CAN Bus Handle Message Collisions
- Message Priority Using Identifiers in CAN Protocol
Special thanks to @mr-raj for contributing to this article on Embedded Prep

Mr. Raj Kumar is a highly experienced Technical Content Engineer with 7 years of dedicated expertise in the intricate field of embedded systems. At Embedded Prep, Raj is at the forefront of creating and curating high-quality technical content designed to educate and empower aspiring and seasoned professionals in the embedded domain.
Throughout his career, Raj has honed a unique skill set that bridges the gap between deep technical understanding and effective communication. His work encompasses a wide range of educational materials, including in-depth tutorials, practical guides, course modules, and insightful articles focused on embedded hardware and software solutions. He possesses a strong grasp of embedded architectures, microcontrollers, real-time operating systems (RTOS), firmware development, and various communication protocols relevant to the embedded industry.
Raj is adept at collaborating closely with subject matter experts, engineers, and instructional designers to ensure the accuracy, completeness, and pedagogical effectiveness of the content. His meticulous attention to detail and commitment to clarity are instrumental in transforming complex embedded concepts into easily digestible and engaging learning experiences. At Embedded Prep, he plays a crucial role in building a robust knowledge base that helps learners master the complexities of embedded technologies.
Leave a Reply