which protocal is best in any microcontroller
i2c or SPI ?
which protocal is best in any microcontroller
i2c or SPI ?
The best protocol is the one that lets you talk to the device you want to talk to.
SPI is generally much faster, though this depends on the device you're talking to. However, you do have to be careful about clock signal integrity.
I2C is slower, but there are lots of devices that only have I2C. With I2C you don't need to worry about signal integrity because the devices filter the input signals so they can ignore ringing -- at least that's my understanding.
SPI requires more signals: you need clock, MISO, and MOSI, plus a chip select for each device. I2C only requires two signals: SCL and SDA.
The best protocol is the one that lets you talk to the device you want to talk to.
SPI is generally much faster, though this depends on the device you're talking to. However, you do have to be careful about clock signal integrity.
I2C is slower, but there are lots of devices that only have I2C. With I2C you don't need to worry about signal integrity because the devices filter the input signals so they can ignore ringing -- at least that's my understanding.
SPI requires more signals: you need clock, MISO, and MOSI, plus a chip select for each device. I2C only requires two signals: SCL and SDA.