Interview Question · Waveform
The Ninth Clock: ACK and NACK
- Likely at Analog Devices
The Question
The interviewer asks
Draw one I2C byte with its acknowledge. Who drives SDA in the ninth clock on a write, and on a read? Why does the controller NACK the last byte it reads?
SCL slot: 1 2 3 4 5 6 7 8 | 9
SDA byte: D7 D6 D5 D4 D3 D2 D1 D0 | ?
Write: fill in the SDA owner for slots 1-8 and slot 9.
Read: fill in the owner and the last-byte response.You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The controller makes all nine clocks. In the ninth, the transmitter releases SDA. The receiver pulls it low (ACK) and holds it through the high phase; SDA left high is a NACK. On a write the target ACKs, and on a read the controller does. The controller NACKs the last read byte so the target stops driving. An ACK would tell the target to send the next byte, which may hold SDA low and block the STOP.
A low lane of 1 pulls the net down. The pull-up raises it only when every device releases.
Read phases and sample points (quarter bit)
- START: columns 2 through 3.
- 0xa0 + ACK: columns 4 through 39.
- 0x3c + ACK: columns 40 through 75.
- STOP: columns 76 through 79.
- SDA sampled at 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74.
- Cycle 6
Clocks 1 to 8: the transmitter (here the controller) drives the bits, most significant first.
- Cycle 36
Clock 9 begins: the controller lets go of SDA.
ctrl_lowfalls to 0. - Cycle 38
The receiver (the target) pulls SDA low and holds it through the high period: ACK.
- Cycle 74
Every byte has its own ninth clock. A NACK would be nobody pulling: SDA high.
Generated and decoded back. In clocks 1 to 8 the controller drives; in clock 9 it lets go and the target pulls.
Clocks 1 to 8
The transmitter puts each bit on SDA while SCL is low, MSB first; it is stable while SCL is high.
Clock 9
The transmitter lets go. The receiver pulls SDA low (ACK) or leaves it high (NACK).
After a NACK
The controller sends STOP or a repeated START.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Fresher)
A good fresher answer says the receiver drives the ACK, low means ACK, and the controller makes the ninth clock.
What Interviewers Listen For (Junior)
A good junior answer explains that the last-byte NACK tells the target to stop sending. It knows a NACK carries information, such as no device, busy or end of read, and is not a bus fault.
What Interviewers Listen For (Mid-Level)
A good mid-level answer knows this bug depends on the data. If the next byte starts with a 1, the STOP still forms. So a test that reads only such bytes never sees it.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItBreak ItCompare
- The Ninth Clock: ACK and NACK
-
WhyWhat a NACK MeansL1 Junior
Your driver gets a NACK after the address byte. What could it mean, and what should the controller do?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
After an address, most likely no device answers at that address, or the target is busy with a real-time task. Later in a transfer, a NACK can mean the target did not understand the byte or cannot take more. A controller-receiver also NACKs on purpose to end a read. Whatever the reason, the controller ends with STOP or tries again with a repeated START. Software decides whether to retry.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer lists the reasons for a NACK after the address. It gives the controller's two legal answers: STOP, or a repeated START.
What Interviewers Listen For (Mid-Level)
A good mid-level answer separates NACKs a driver should retry, such as busy, from ones it should report, like a missing device. It first checks for the 7-bit versus 8-bit address mix-up.
Missed Corner
"Address 0xA0 got a NACK, so the part is dead."
Often the datasheet's 0xA0 is the 7-bit address 0x50 shifted left with R/W = 0. Passing 0xA0 to a driver that expects seven bits puts address 0x20 on the wire, and nothing answers.
Source NXP UM10204 rev. 7 §3.1.10 Figure 10 (seven address bits, then R/W)
-
Break ItAn ACK That OverstaysL2 Mid-Level
A target keeps pulling SDA low after its ACK slot, into the next bit. What does a correct controller report, and how do you find the culprit?
log Illustrative SDA ownership excerpt Ninth clock: target pulls SDA low for ACK Following data bit: controller releases SDA for a 1 Target still pulls SDA low Resolved SDA=02:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
A correct controller that sends a 1 and reads a 0 decides it lost arbitration. So the log says "arbitration lost", even on a single-controller bus. The wires alone cannot say who pulled. You need the driver view, meaning each device's pull-low enable. It shows the target's lane still active after the ninth clock.
The ACK That Overstays: ack_not_releasedMeasured on the bench, 100 ns per column, around the address byte's ninth clock and the first bit of the data byte 0xA5. All cyclesA low lane of 1 pulls the net down. The pull-up raises it only when every device releases.
- Cycle 27
Clock 9 of the address: the controller has let go; the target pulls. A correct ACK.
- Cycle 40
The SCL fall should end the ACK, but
tgt_lowstays 1. - Cycle 52
Bit 7 of 0xA5 is 1, so the controller lets go of SDA. It reads 0 back while SCL is high and concludes it lost arbitration after SCL pulse 10.
Measured. The target never lets go after its ACK. The controller sends a 1, reads 0 and reports a lost arbitration.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer sees that "arbitration lost" may really be a stuck ACK. It asks to see which device pulls SDA low.
What Interviewers Listen For (Senior)
A good senior answer adds an assertion on each device's pull-low enable. It checks that the receiver lets go by the end of the ACK clock. It adds a test where the byte after the ACK starts with a 1.
- Cycle 27
-
CompareThe I3C T-Bit Versus the I2C ACKL1 JuniorL2 Mid-Level
In I2C the ninth bit of a data byte is the receiver's ACK. What is it in I3C SDR?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The transmitter drives it. On a write, it is odd parity from the controller: the XOR of the eight data bits with 1. Parity lets the target detect a corrupted byte. On a read, it is end-of-data from the target: 0 ends the message, and 1 offers more. So the target decides how much it returns, though the controller may abort after a 1 with a repeated START.
An SDR Private Write: Pointer 0x10, Then 0x3c and 0x01Lanes: SCL and SDA, then who drives SDA low or high, and the drive style. The target only drives in the ACK slots. All cyclesRead phases and sample points (quarter bit)
- START: columns 2 through 3.
- 7e/W (open drain) + ACK: columns 4 through 39.
- Sr: columns 40 through 43.
- 08/W (push-pull) + ACK: columns 44 through 79.
- 10 + T0: columns 80 through 115.
- 3c + T1: columns 116 through 151.
- 01 + T0: columns 152 through 187.
- STOP: columns 188 through 191.
- SDA sampled at 6, 10, 14, 18, 22, 26, 30, 34, 38, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186.
- Cycle 78
Header ACK: the target pulls SDA in open drain, exactly as in I2C.
- Cycle 79
Handoff: the controller pulls SDA low just after the SCL rise, while the target lets go. Both low for a moment is safe (MIPI §5.1.2.3.1).
- Cycle 114
Ninth bit of 0x10: the controller drives the parity, XOR(data, 1) = 0. The target drives nothing.
- Cycle 150
Ninth bit of 0x3c: four 1s, so parity 1. Still the controller, still push-pull.
Generated and decoded back. 0x10 and 0x01 each have one 1 bit, so their T-bit is 0. 0x3c has four 1 bits, so its T-bit is 1.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer says the transmitter drives the T-bit: parity on writes, end-of-data on reads.
What Interviewers Listen For (Mid-Level)
A good mid-level answer computes parity for a byte: 0x00 and 0xFF give 1, and 0x01 gives 0. It names the I2C habit that breaks: a target that ACKs the ninth bit fights the controller's parity.
Misconception
"I3C targets ACK every data byte like I2C."
Only the address header has an ACK. A target that pulls SDA in the ninth bit of a written byte collides with the controller's push-pull parity bit.
Source MIPI I3C Basic v1.0 §5.1.2.3.3
-
What IfA Parity Error on a Written ByteL2 Mid-Level
What if the target sees a parity error on a byte the controller wrote? What does it do, and how does the controller find out?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
It cannot NACK the byte, because the ninth bit belongs to the controller. Error type S2 says the target ignores the rest and waits for a STOP or a repeated START. The controller sees nothing on the wire. It learns of the error later, from the Protocol Error bit that GETSTATUS returns.
Self-Check
Tick each key point you covered in your answer.
Misconception
"The target NACKs a bad byte, as in I2C."
In I3C SDR the controller drives the ninth bit of a write as parity. The target has no slot to answer in.
Source MIPI I3C Basic v1.0 §5.1.2.3.3
-
Prove ItSolve P8.3.1: Receive Eight Bits and Own the NinthSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
What People Get Wrong
Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.
Misconception
"ACKing the last byte is harmless; the STOP ends the read anyway."
An ACK makes the target-transmitter put the next byte's MSB on SDA. If that bit is 0 the target holds SDA low and no STOP can form. The twin shows it, and shows it hiding when the next MSB is 1.
Run It
ACK last byte, next byte 10: read 3c, STOP seen 0, SDA 0 FAIL: no STOP formed, the target still holds SDA ACK last byte, next byte 9a: read 3c, STOP seen 1, SDA 1 PASS: STOP formedSee the Fix
`timescale 1ns/1ns
// A one-byte register read, from the first data bit on. The target sends mem[0] and, if the
// controller ACKs, starts mem[1] at once (auto-increment). The controller then tries a STOP:
// SDA low while SCL is low, SCL high, then let go of SDA. A STOP is SDA rising while SCL is high.
module tb;
logic c_low = 0, t_low = 0, scl = 0;
wire sda = !(c_low | t_low);
byte mem [2];
int stops;
always @(posedge sda) if (scl) stops++;
task automatic read_one(input bit ack_last, input byte next);
byte v; int idx = 0;
mem[0] = 8'h3c; mem[1] = next; stops = 0;
for (int b = 7; b >= 0; b--) begin
#100 t_low = !mem[idx][b]; // the target puts its bit on SDA after the SCL fall
#1100 scl = 1; #100 v[b] = sda; #1100 scl = 0;
end
#100 t_low = 0; c_low = ack_last; // ninth clock: the controller-receiver answers
#1100 scl = 1; #1200 scl = 0;
if (ack_last) begin idx = 1; #100 t_low = !mem[idx][7]; end // ACKed: the target sends on
#100 c_low = 1; // set up the STOP
#1000 scl = 1;
#600 c_low = 0; // let go: SDA rises unless the target still pulls
#1000 if (ack_last) $display("ACK last byte, next byte %h: read %h, STOP seen %0d, SDA %0d", next, v, stops, sda);
else $display("NACK last byte, next byte %h: read %h, STOP seen %0d, SDA %0d", next, v, stops, sda);
if (stops == 0) $display("FAIL: no STOP formed, the target still holds SDA");
else $display("PASS: STOP formed");
t_low = 0; c_low = 0; #2000 scl = 0;
endtask
initial begin
read_one(0, 8'h10);
read_one(0, 8'h9a);
$finish;
end
endmodule
Prints: NACK last byte, next byte 10: read 3c, STOP seen 1, SDA 1 PASS: STOP formed NACK last byte, next byte 9a: read 3c, STOP seen 1, SDA 1 PASS: STOP formed
Misconception
"The target always sends the ACK."
The receiver sends it. On a read the controller is the receiver. So it ACKs every byte it wants more of, and NACKs the last.
Source NXP UM10204 rev. 7 §3.1.6, §3.1.10
Half-Truth
"A NACK means the bus is broken; reset everything."
UM10204 lists five ordinary reasons (no device, busy, not understood, cannot take more, controller ending a read). The answer is a STOP or a repeated START.