<story><title>I2C in a Nutshell</title><url>https://interrupt.memfault.com/blog/i2c-in-a-nutshell</url></story><parent_chain><item><author>fra</author><text>I think I2C and SPI have very different use cases. Over I2C, you can interact with 127 devices with just 2 pins. To do the same with SPI, you&amp;#x27;d need 130 (4 + an additional CS for every device on the bus).&lt;p&gt;You may think of the extra pins as not a problem, but on every product I&amp;#x27;ve worked on we&amp;#x27;ve been pin-limited on the MCU.</text></item><item><author>Ives</author><text>I really don&amp;#x27;t like I2C. Yes, in principle it&amp;#x27;s pretty simple, but if you consider NACKS, slaves holding SCK low, what happens if your master resets while the slave is trying to send a 0 bit (hint: power cycle!), etc, it&amp;#x27;s so easy for the peripheral to get stuck.&lt;p&gt;SPI is much easier to write correctly, and pretty much only has the extra wire (usually not a problem) and the phase polarity issues as a negative point.</text></item></parent_chain><comment><author>clarry</author><text>&amp;gt; Over I2C, you can interact with 127 devices with just 2 pins.&lt;p&gt;In practice, I don&amp;#x27;t see that many chips offering 7 bits of address configuration.  You buy a chip, it has a hardwired address.  Maybe a pin or two for selecting another address.</text></comment>
<story><title>I2C in a Nutshell</title><url>https://interrupt.memfault.com/blog/i2c-in-a-nutshell</url></story><parent_chain><item><author>fra</author><text>I think I2C and SPI have very different use cases. Over I2C, you can interact with 127 devices with just 2 pins. To do the same with SPI, you&amp;#x27;d need 130 (4 + an additional CS for every device on the bus).&lt;p&gt;You may think of the extra pins as not a problem, but on every product I&amp;#x27;ve worked on we&amp;#x27;ve been pin-limited on the MCU.</text></item><item><author>Ives</author><text>I really don&amp;#x27;t like I2C. Yes, in principle it&amp;#x27;s pretty simple, but if you consider NACKS, slaves holding SCK low, what happens if your master resets while the slave is trying to send a 0 bit (hint: power cycle!), etc, it&amp;#x27;s so easy for the peripheral to get stuck.&lt;p&gt;SPI is much easier to write correctly, and pretty much only has the extra wire (usually not a problem) and the phase polarity issues as a negative point.</text></item></parent_chain><comment><author>Ives</author><text>Agreed, but most I2C busses only have 2 or 3 devices on them. There are some boards with 16 or so devices on the same bus, but much more than that and you&amp;#x27;d better hope you can either program their addresses or order them with a specific address, or you might end up with 2 chips with the same address.</text></comment>