which protocal is best in any microcontroller
i2c or SPI ?
which protocal is best in any microcontroller
i2c or SPI ?
As with everything, there are pros and cons of both methods.
I2C
SPI
My advice?
Use I2C in general (easier to wire and change over. can handle many devices) and reserve the SPI bus for something requiring the high speed.
Dan McGraw
M0WUT
As with everything, there are pros and cons of both methods.
I2C
SPI
My advice?
Use I2C in general (easier to wire and change over. can handle many devices) and reserve the SPI bus for something requiring the high speed.
Dan McGraw
M0WUT
Good overview!
I2C has one extra benefit: the slaves acknowledge the transfer, so you're sure a slave is listening.
It also has a drawback, and that is that uses an open collector drive, and with long cables and / or many devices on one bus you risk very bad data transfers (when it takes too long to pull up). The other drawback of the bus structure is that if you plan to use many devices of the same type, you get bus conflicts, which can only be solved by adding I2C multiplexers, which add even more lag to your communication.