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

2 SPI MODES

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








2 SPI MODES
PostPosted: Thu Feb 26, 2009 6:10 pm     Reply with quote

In future project I want to interface with two diffferent SPI devices. I was looking at their data sheets and found that one device is mode 1 and the other is mode 3. So I would like some feedback on the way to deal with this issue. Use a chip with two spi lines or setup the spi each time I want use each sensor?

Any Ideas?
asmallri



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

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

PostPosted: Thu Feb 26, 2009 6:42 pm     Reply with quote

If you do not need to access both devices concurrently then you can use a single SPI bus to do this. It just means you need to initialize the SPI as part of the process for selecting each device.

The process for all PICs is deselect all devices, stop the SPI bus, change the SPI configuration, clear the SPI interrupt flag, enable the SPI bus, select the sensor, communicate with the sensor....
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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