Which is the difference between I2C and SPI and which the best option?
I use a I2C eeprom in my project, but now I am evaluating use SPI eeprom (www.ramtrom.com). The only difference is that the SPI (25Mhz) is more fast that I2C (1Mhz), but really the CCS take this advantage?
If somebody can tell me your opinion? Thank you very much!!
Best Regards,
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Tue Jan 11, 2005 1:12 pm
Quote:
The only difference is that the SPI (25Mhz) is more fast that I2C (1Mhz), but really the CCS take this advantage?
In the PIC processor the fastest SPI rate you can get is using the internal SPI hardware. The maximum SPI frequency is then CPU-clock / 4. Assuming you are running at the maximum speed of 40MHz for a PIC18, then your SPI-clock will be 10MHz. So your SPI eeprom is much faster than the maximum SPI-clock achievable in the PIC.
I2C advantages:
- Good software I2C simulation by the the CCS compiler (if you want to use the hardware I2C for something else).
- Requires only 2 I/O pins (SPI requires 3 + 1 select line for every device).
- Multiple masters possible on the same bus.
SPI advantages:
- Faster (higher bitrates and no overhead for addressing etc.)
- Easier protocol (no multi-master, etc).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum