CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Can I use PIC SPI interface to connect two SPI devices?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Sigma



Joined: 03 May 2004
Posts: 48
Location: Sg

View user's profile Send private message

Can I use PIC SPI interface to connect two SPI devices?
PostPosted: Mon Jun 19, 2006 8:15 pm     Reply with quote

Hi, all,

I have one 12bit ADC and one 12bit DAC.

I want to interface with them using SPI interface. Do they provide different slave address for me to talk to?

I know I2C will do.

Thanks for your advice.
Sigma
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Can I use PIC SPI interface to connect two SPI devices?
PostPosted: Mon Jun 19, 2006 11:32 pm     Reply with quote

Sigma wrote:
Hi, all,

I have one 12bit ADC and one 12bit DAC.

I want to interface with them using SPI interface. Do they provide different slave address for me to talk to?

I know I2C will do.

Thanks for your advice.
Sigma


SPI uses chip select lines (cs) to select different devices.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 12:24 am     Reply with quote

I prefer SPI over I2C. Not having address pins is one reason.

Simply lower the chip select pin and start talking. I've never tried but it seems likely that if you have two or more of the same chip and you control the clock you could easily send the same data to those devices simultainiously.

SPI is way easier to implement then I2C (imo). If you read the datasheets for the parts you'll find that you should have no problem talking to both.
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 9:51 am     Reply with quote

iso9001 wrote:
SPI is way easier to implement then I2C (imo).


I'm one of those weirdos that finds I2C easier than SPI. Very Happy
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 2:43 pm     Reply with quote

That IS wierd!

I like SPI just b/c software implement is just as easy as hardware. I have used I2C before but I don't like the extra parts (pullups) and the address pins... I know I'll never need more then 8 ADCs but it feels a little constrictive.

I2C isn't nearly as fast is it ?
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue Jun 20, 2006 3:03 pm     Reply with quote

newguy wrote:
I'm one of those weirdos that finds I2C easier than SPI. Very Happy

I'm another one of those weirdos. Not having to route all the CS lines is a big benefit of the I2C. When I need speed (MMC card, CAN or Ethernet controller, external UART), I use SPI. But often there are both high speed and lower speed devices (LED drivers, temperature sensord etc.) in the same instrument. Typically low speed devices outnumber the high-speed devices. In such cases, I use both SPI (hardware) and I2C (software). Having an auxiliary I2C bus allows to reduce the pin count on the PIC and save a lot of routing.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group