Electronic – I2C: Is a repeated start between different slave addresses legal

communicationi2cmicrocontroller

I'm writing I²C code for an application where I have only one master, but several slaves. In all the datasheets I've read (not only for this project), the repeated start condition is only used to switch between write and read and write to/from the same slave or vice versa. Of course, those datasheets wouldn't show other slaves (why should they, anyway).

Is it legal to omit the stop condition between transfers to/from different slaves?

Do some slaves misbehave when addressed after a repeated start condition, after different slave had been addressed before?

I know that the second question cannot be safely answered with "no", but if any of you had problems in such a situation before, that's enough for me.

Best Answer

The repeated start condition was added to the specification to allow a master in a multiple master setup to keep control over the bus while initiating a new operation. It does work in a one master setup as well, as can be seen on page 9 of the specification: the repeated start condition is described in a general description, so it works for both modes. Also, after a repeated start condition the address is sent again, so it should work when changing the address as well.

However, it is not very common, so some slaves (I've never seen one though, but Michael Karas has as stated in his answer) might expect a stop condition, which might cause problems when omitting the stop condition. I therefore would recommend you to include the stop condition just to be sure, although your implementation wouldn't be 'wrong' following the specification. A stop condition doesn't cost that much time.