View previous topic :: View next topic |
Author |
Message |
neohimura
Joined: 08 Feb 2011 Posts: 14
|
PIC18 Slave Select Pin and ADC |
Posted: Tue Feb 08, 2011 9:58 am |
|
|
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
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Tue Feb 08, 2011 3:47 pm |
|
|
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
|
|
Posted: Thu Feb 10, 2011 3:17 am |
|
|
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. |
|
|
|