Adding D/A converters, use SPI or I2C?

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
smachin
Posts: 2
Joined: Sun Feb 01, 2009 5:33 am
Contact:

Adding D/A converters, use SPI or I2C?

Post by smachin »

Hi All,

I have a new simple microcontroller design coming up, but it needs two channels of D/A. I want to use a serial interface between the CPU and the external D/As to keep it simple, as no high speed is necessary. Would I be better off using the SPI or I2C interface for this? I haven't used either before (usually used memory mapped parallel interface).

Thanks,
Sean :D
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: Adding D/A converters, use SPI or I2C?

Post by MrAl »

LEDs vs Bulbs, LEDs are winning.
mthornton
Posts: 16
Joined: Tue Jul 21, 2009 8:07 pm
Contact:

Re: Adding D/A converters, use SPI or I2C?

Post by mthornton »

Recently researched the same question for a project of my own. I needed 2 ch of 12 bit D/A. In the end I discovered much better availability of SPI as opposed to I2C. I guess the reason is that most often D/A applications DO require high speed, and SPI has it all over I2C when it comes to speed.
I ended up selecting Microchip MCP4822-E/P, available in stock from Allied.
SETEC_Astronomy
Posts: 582
Joined: Tue May 09, 2006 12:44 am
Contact:

Re: Adding D/A converters, use SPI or I2C?

Post by SETEC_Astronomy »

I've used both protocols in PIC controlled projects and find SPI easier to implement and more straight forward to handle. If you're a proficient coder and can design a decent circuit you should have no problems with either protocol, spec limits would be the ultimate deciding factor in that case.
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: Adding D/A converters, use SPI or I2C?

Post by philba »

I agree with SETEC, go with SPI.

SPI is very simple but requires more pins than I2C. You can even bit bang SPI pretty easily. I2C is more complex and harder to get right, even for experienced programmers. I2C's big advantage comes when you have more than 2 devices. They can all share the same 2 wires while SPI requires an additional pin per device (for select).
L. Daniel Rosa
Posts: 400
Joined: Tue Dec 25, 2001 1:01 am
Location: Bellingham, WA
Contact:

Re: Adding D/A converters, use SPI or I2C?

Post by L. Daniel Rosa »

You're at the possible break even point. I2C devices have the device address hard wired into them. Some have one or two pins available to choose an address, but not all. You may need a separate pair of I/O pins just for a second I2C device, but with SPI you will need one per device in addition to the bus requirements.
Post Reply

Who is online

Users browsing this forum: No registered users and 91 guests