This is the third in a progression of articles on the more unobtrusive parts of the I2C convention (which cover TWI and SMBus executions too). In the past article, we examined a few issues around the START condition; in this article we center around a piece of what can turn out badly with STOP.
What is a “ordinary” STOP?
Per the I2C detail, STOP is characterized as a rising SDA line while SCL is high. Very much like with START, this could hypothetically happen anytime during a transmission (up to a Slave isn’t at present driving SDA low), and ought to reset all I2C Slave gadgets (and Masters too, in multi-ace conditions) back to an Idle state. Obviously, having this happen under conditions other than having recently finished an ACK/NAK bit is a mistake (Unexpected STOP).
What is a “missing” STOP?
A STOP would be considered ‘missing’ when an ACK/NAK is sent, trailed by the transport getting back to an IDLE state, and afterward a START (instead of a Restart) happens. Yet, could this at any point entirely occur?The ACK bit is sent by the ‘recipient’ of the previous byte. Toward the finish of the ACK time frame, demonstrated by the falling edge of SCL, the ACK source Bulk Send Polygon tokens should deliver SDA assuming the Master is to be allowed full control of the transport. Nonetheless, the Master isn’t generally given *full* command over picking the following activity. One of three tasks could happen straightaway: STOP, ReSTART, or sending an information byte (which could be either the Master being the ‘transmitter’, or the Slave being such).
On account of a Slave Receive activity, the Slave has produced the ACK bit. Assuming that the ACK bit was low, the Slave is expected to deliver the SDA line low after SCL falls toward the finish of the ACK time frame. Since the Slave stated ACK, it is permitting the Master to send extra information bytes, or to send a ReSTART or STOP, as it picks. In the event that the Slave sent a NAK, it is demonstrating that it can’t acknowledge extra information bytes, and in this way wouldn’t attempt to hold SDA low under any condition. In this way, on account of a Slave Receive activity, the Master is in full control of the transport after each ACK.
On account of a Slave Transmit activity, the Master has produced the ACK bit. After SCL is driven low toward the finish of ACK, the Slave might wish to communicate an extra information byte, and will accept the job of ‘transmitter’ in the future, possibly driving SDA low in setting up the primary information digit of the following byte. For this situation, the Master doesn’t have command over the SDA line. The main thing the Master can do, in this manner, is discharge SCL, which is important for timing in the primary information bit. Consequently, by giving an ACK (rather than a NAK), the Master is providing up its capacity to create a STOP or ReSTART after the ACK bit. On the off chance that the Master produces a NAK all things considered, the Slave should stop its ‘transmitter’ job and not drive SCL after the NAK is seen. This permits the Master to control SCL to either produce a ReSTART or a STOP.
All in all, returning to the current inquiry, might there be such an incredible concept as a ‘missing STOP’? The response is, No. STOP is discretionary, since a ReSTART could be given rather than a STOP. STOP would be expected to deliver control in a multi-ace setup, yet it is unimaginable, through transport perception, to decide if a given Master *intended* to surrender control yet didn’t do as such. In such a case, the transport would give off an impression of being IDLE (both SCL and SDA high), however on the off chance that no STOP were given, the framework would really be anticipating a ReSTART or an extra information byte, including a similar Master.
On account of a Slave Receive, in the event that the Slave gave a NAK, it is anticipating a STOP or ReSTART to be the following transport activity. On the off chance that rather the Master sends an extra information byte, this blunder might actually be grouped either as demonstrating a Missing STOP, or as Unexpected Data. The most ideal decision of grouping is as Unexpected Data. The thinking behind this choice is as per the following: characterizing it as a ‘Missing’ STOP infers that, albeit the STOP was discarded, resulting transport states have gotten back to business as usual, explicitly that a START or ReSTART, trailed by a Master Address, would be seen preceding any information. Since a START or even a ReSTART are deficient for this situation, the ensuing byte can’t be a Master Address, and must thusly be information. The transport grouping must in this way be seen as a (mixed up) continuation of an information move. For sure, all things considered, eventually soon, a STOP will truth be told be given.