View previous topic :: View next topic |
Author |
Message |
Sigma
Joined: 03 May 2004 Posts: 48 Location: Sg
|
Can I use PIC SPI interface to connect two SPI devices? |
Posted: Mon Jun 19, 2006 8:15 pm |
|
|
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
|
Re: Can I use PIC SPI interface to connect two SPI devices? |
Posted: Mon Jun 19, 2006 11:32 pm |
|
|
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
|
|
Posted: Tue Jun 20, 2006 12:24 am |
|
|
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
|
|
Posted: Tue Jun 20, 2006 9:51 am |
|
|
iso9001 wrote: | SPI is way easier to implement then I2C (imo). |
I'm one of those weirdos that finds I2C easier than SPI. |
|
|
iso9001
Joined: 02 Dec 2003 Posts: 262
|
|
Posted: Tue Jun 20, 2006 2:43 pm |
|
|
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
|
|
Posted: Tue Jun 20, 2006 3:03 pm |
|
|
newguy wrote: | I'm one of those weirdos that finds I2C easier than SPI. |
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. |
|
|
|