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 support@ccsinfo.com

PIC18 Slave Select Pin and ADC

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



Joined: 08 Feb 2011
Posts: 14

View user's profile Send private message

PIC18 Slave Select Pin and ADC
PostPosted: Tue Feb 08, 2011 9:58 am     Reply with quote

I'm trying to communicate two PIC18F4550 using SPI. On my slave PIC18, I want to use all available ADC pins (AN0-AN12). Since the SPI Slave Select (SS) pin shares with AN4, is it possible for me to change the slave select pin to another I/O pin?
Thank you.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 08, 2011 11:54 am     Reply with quote

See this thread where the issue is discussed by Ttelmah:
http://www.ccsinfo.com/forum/viewtopic.php?t=44392
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Tue Feb 08, 2011 3:47 pm     Reply with quote

Simple answer, is to not use slave select....
You can run SPI without any select at all, for point to point communication. Only problem is if the devices loose 'sync'. However, you can get a similar action, using any other pin. Just have the master setup the SPI port, then set or clear it's 'select' pin, _then wait_ for a mSec or so, before starting transmission.
Have the slave sit monitoring this pin, and when it sees it go to the 'selected' state, reset the SPI hardware. This way the SPI will resynchronise if needed.

Best Wishes
neohimura



Joined: 08 Feb 2011
Posts: 14

View user's profile Send private message

PostPosted: Thu Feb 10, 2011 3:17 am     Reply with quote

It works now. I had to remove the analog input for AN4 and use that pin for Slave select. Thank you for your help PCM programmer and Ttelmah.
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