Skip to content

Commit 635caea

Browse files
committed
ibi: wait for falling SCL before driving od_pp
1 parent 0e67b06 commit 635caea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ctrl/ibi.sv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ module ibi (
9898
DriveAddr,
9999
// Receive ACK/NACK
100100
ReadAck,
101+
// Wait for falling SCL (do not change sel_od_pp_o when SCL is high)
102+
WaitForSclNegedgeAfterAck,
101103
// Transmitt data byte
102104
SendData,
103105
// Transmitt T bit
@@ -144,7 +146,10 @@ module ibi (
144146
if (bus_rx_req_nack) // NACK
145147
state_q <= WaitStop;
146148
else // ACK
147-
state_q <= SendData;
149+
state_q <= WaitForSclNegedgeAfterAck;
150+
151+
WaitForSclNegedgeAfterAck:
152+
if (scl_negedge_i) state_q <= SendData;
148153

149154
SendData:
150155
if (bus_stop_i) state_q <= Flush;

0 commit comments

Comments
 (0)