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

3-wire SPI device and 4-wire SPI device on the same bus?

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








3-wire SPI device and 4-wire SPI device on the same bus?
PostPosted: Tue Nov 25, 2008 12:48 pm     Reply with quote

Hi all,

I'd like to use a 3-wire SPI device (Omron B6TS-08 capacitive sensor) and a 4-wire SPI device (MRF24J40 Zigbee) on the same SPI bus. (pic 18F6627)

Omron B6TS-08, 3-wire: SD (data I/O), SCLK and CS.
MRF24J40, 4-wire: SDI, SDO, SCLK, CS.

Is there any problem about this and can someone share experience about hardware and software with a case like this?

How to configure SPI in this case?

thank you.

Best regards,
Franck
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: 3-wire SPI device and 4-wire SPI device on the same bus?
PostPosted: Tue Nov 25, 2008 2:23 pm     Reply with quote

You can do it by adding one resistor between the PIC's SDI and SDO. The size of the resistor depends on what speed you need. Connect the Omron's SD pin to the PIC's SDI pin.

When you are talking with the Zigbee, the Omron is out of the picture. The resistor between SDI and SDO must be large enough that the Zigbee can drive SDI and the PIC can drive SDO and neither will affect the logic level of the other.

When you are talking with the Omron, the PIC drives SD through the resistor. The resistor in combination with the stray capacitance on the SD line adds to the logic level settling time, so you might need to avoid the fastest SPI speeds. Then when the Omron decides to drive the SD line, it can overpower the resistor just like the Zigbee did.

So your design criteria for the resistor is that it must be high enough so that the Zigbee and the Omron can override it, and low enough to keep up with the selected SPI speed.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
Fram_fr



Joined: 29 Oct 2008
Posts: 13

View user's profile Send private message

PostPosted: Tue Nov 25, 2008 4:21 pm     Reply with quote

Robert,

Thank you for your feed-back, I keep in mind your solution and will finish my hardware design. I'll let you know the result in some weeks.

regards,
Franck
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Nov 25, 2008 5:19 pm     Reply with quote

http://ww1.microchip.com/downloads/en/DeviceDoc/39776b.pdf
see note page 10 by
Quote:
2.13 Serial Peripheral Interface (SPI)
Port Pins


It is references a tri-stated inverter NC7S7125PSX from
Quote:
Section 4.4 “MRF24J40 Schematic and
Bill of Materials”
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