A. Stop condition requires SCL to be high, not low
B. SDA should be low, not high for stop condition
C. Both SDA and SCL should be low for stop condition
D. No error; code correctly detects stop condition
Solution
Step 1: Recall stop condition timing
Stop condition occurs when SDA rises from low to high while SCL is high.
Step 2: Check code condition
The code checks SDA high and SCL low, which is incorrect; SCL must be high for stop.
Final Answer:
Stop condition requires SCL to be high, not low -> Option A
Quick Check:
Stop = SDA high + SCL high [OK]
Hint: Stop needs SCL high, not low [OK]
Common Mistakes:
Confusing clock line state for stop
Assuming SDA low means stop
Ignoring line state transitions
5. You want to implement a function in embedded C that waits for the I2C start condition before proceeding. Which logic correctly detects the start condition on SDA and SCL lines?
hard
A. Wait until SDA changes from low to high while SCL is low
B. Wait until SDA changes from high to low while SCL is high
C. Wait until both SDA and SCL are low simultaneously
D. Wait until SCL changes from low to high while SDA is low
Solution
Step 1: Understand start condition in I2C
Start condition is when SDA line falls from high to low while SCL line is high.
Step 2: Match logic to condition
Wait until SDA changes from high to low while SCL is high correctly waits for SDA falling edge with SCL high, matching start condition.
Final Answer:
Wait until SDA changes from high to low while SCL is high -> Option B
Quick Check:
Start = SDA high-to-low + SCL high [OK]
Hint: Start = SDA falls low while SCL high [OK]
Common Mistakes:
Waiting for SDA rising edge instead of falling
Checking SCL low instead of high
Confusing start with stop condition
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.