View previous topic :: View next topic |
Author |
Message |
Guest
|
3-wire SPI device and 4-wire SPI device on the same bus? |
Posted: Tue Nov 25, 2008 12:48 pm |
|
|
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
|
Re: 3-wire SPI device and 4-wire SPI device on the same bus? |
Posted: Tue Nov 25, 2008 2:23 pm |
|
|
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
|
|
Posted: Tue Nov 25, 2008 4:21 pm |
|
|
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
|
|
|
|