I2C Start and Stop Conditions
In this article, let’s discuss the start and stop conditions that are generated by the master.
Each I2C command initiated by the master device starts with a START condition and ends with a STOP condition.
For both conditions, SCL has to be high. A high to low transition of SDA is considered as START and a low to high transition as STOP. After the Start condition, the bus is considered as busy and can be used by another master only after a Stop condition is detected.
After the Start condition, the master can generate a repeated Start. Repeated start means, without issuing a STOP condition making one more START condition and this is equivalent to a standard START and is usually followed by the slave I2C address. After the STOP condition, both SDA and SCL are released, which means both are in a pull-up state.
Remember that both start and stop conditions are made in master mode by software. The bus is considered to be busy after the START condition, and the bus is considered to be free again a specific time after the STOP condition. When the bus is free, another master can get the chance to claim the bus for data communication. The bus stays busy if repeated START is generated instead of the STOP condition.
The most of the microcontroller’s I2C peripherals support both master and slave mode. Because when the peripheral makes START condition, the mode is automatically in master mode and when it generates STOP condition, the mode goes to slave mode.
Few notes about START and STOP conditions:
- A single message can contain multiple START conditions. The use of this is so-called “repeated START” is common in I2C.
- STOP condition always denotes the end of the transmission even if it is issued in the middle of the transaction or the middle of a byte.
In the following article, let’s see I2C ACK and NACK and I2C data validity.