Selecting Between I2C and SPI for Your Project

Thread Starter

daljeet795

Joined Jul 2, 2018
295
Hello everybody.
I am not working any project I am just asking for my doubt. I was wondering if you could help me with Choosing between I2C and SPI for a Project For a example let say We have microcontroller communicate with sensor that use either I2C or SPI. I don't think we choose SPI because it''s faster then I2C there may be other reasons

My question is What would you choose either I2C or SPI.
 

MrChips

Joined Oct 2, 2009
30,708
You need to examine the rest of the hardware.
What other devices are interfaced to the MCU?
What interface schemes are needed for those devices?
Are there sufficient GPIO pins available to fulfill all interface requirements?
 

OBW0549

Joined Mar 2, 2015
3,566
My question is What would you choose either I2C or SPI.
If you need high speed, use SPI.
If you need to address multiple devices and don't want to use up MCU pins on device chip selects, use I2C.
If you need to use a particular sensor that features only I2C or SPI, use that interface.
Otherwise, just flip a coin and choose one or the other at random.
 

Thread Starter

daljeet795

Joined Jul 2, 2018
295
You need to examine the rest of the hardware.
What other devices are interfaced to the MCU?
What interface schemes are needed for those devices?
Are there sufficient GPIO pins available to fulfill all interface requirements?
OK so It's depends on the other requirements so If we are making temperature controller system to monitor the temperature of four devices

Component list of project :

1. 8051 * 1
2. thermocouple * 4
3. choosing ADC 12-bit SPI MCP3202-B or ADC 12-bit AD7992

We have decided hardware part of project and we have two options of ADC device. my question is which one ADC is better for given requirement and why it is better choice ?
 

jpanhalt

Joined Jan 18, 2008
11,087
Have you considered a combined TC amplifier, digitizer, and linearization device? The MAX31856 is about twice the cost of the MCP3202, ($4.61 in single chips), but it is really simple to use. It is 3-wire SPI. So for 4 devices, you would need 6 port pins.
 

Papabravo

Joined Feb 24, 2006
21,159
The AD7992 only comes in an MSOP-10 package, while the MCP3202 has 4 different package options all 8-pin parts. What is the price differential in production quantities?
 

Thread Starter

daljeet795

Joined Jul 2, 2018
295
I am not going to make temperature controller system. as all said selection of other device depend's on the project requirement. I have given some temporary requirement for my question and I have mentioned clearly that it's just example to choose either I2C or SPI in project

@jpanhalt @Papabravo
 

Papabravo

Joined Feb 24, 2006
21,159
I am not going to make temperature controller system. as all said selection of other device depend's on the project requirement. I have given some temporary requirement for my question and I have mentioned clearly that it's just example to choose either I2C or SPI in project

@jpanhalt @Papabravo
And I said initially that it really doesn't matter which one you pick. There are just no significant engineering differences between the two methods of talking to those devices. One other question why would you choose 12-bit A/D converters? That will give you close to 4 significant figures and seems like overkill.
 
Top