I was thinking about doing this a few months ago to save pins. I did
not bother to test this because on my pic 18f452, they will have to
share the pin RC3/SCK/SCL and RC4/SDI/SDA. Sharing the clock line (SCK/
SCL) should be ok since the direction is always an output.

I worry about the SDI/SDA line. With SPI, this pin must always be
input. Does the I2C lib change the direction of this pin?

The SPI lib does not set the pin direction within the init procedure,
the user must do it.

There is also the SSPSTAT register to worry about, so maybe a call to
the init procedures before switching would solve these problems. I
would like to find a proper solution for this as well. Any Idea's?

Matt

On Mar 9, 3:16 am, vasile surducan <[email protected]> wrote:
> Hi all,
>
> It's been a long time since I used both SPI and I2C from MSSP. As far I
> remember there is no issue using alternately SPI and I2C as long the unused
> device on the bus is highZ.
> Does anyone tested this recently on PIC18 ?
>
> thx,
> Vasile

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to