Let’s start off by looking at the wires, because that’s where a surprising number of glitches and complications can creep in. Physical Layer Image from Sparkfun’s I2C Tutorial So here’s a guide to making it work when it’s not working. If you need to connect a few cheap temperature sensors to a microcontroller (and their bus addresses don’t clash) I2C is a great choice. I2C was designed to connect up a bunch of slower, cheaper devices without using a lot of copper real estate compared to its closest rival protocol: SPI. I’ve never seen twenty devices on a bus, much less 127.īut still, I2C has its place. Although I2C does reduce the number of signal wires you need, it gets dangerous when you have more than a handful of devices on the same pair of wires, and you’re lucky when they all conform to the same standard. In reality, the tradeoff for using only two wires is a significantly complicated signalling and addressing system that brings both pitfalls and opportunities for debugging. There’s an allowance for multiple clock-masters on the same bus, and a way for slaves to signal that the master needs to wait. On paper, up to 127 devices can be connected together using just two wires (and ground). In principle, it’s a brilliant protocol, and in comparison to asynchronous serial and SPI, it’s very well defined and clearly standardized.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |