SPI over XBee

Let’s suppose I have a sensor, say an accelerometer for example, which interfaces to a microcontroller over SPI.

I’ve wired this up to an Arduino, got it working fine.

But I want to use something like XBee to make it wireless.

Is it possible for me to set up XBee modules so I can basically connect the SPI peripheral device’s MISO, MOSI, SCK and CS lines to one XBee, and have those SPI signals basically relayed out to the pins on the other XBee module?

Does anyone know of any prior art doing this sort of thing?

Cheers.

No.

The XBee uses an Asynchronous Serial protocol not SPI. Look up both with Google or Wiki.

What you can do is use the Arduino as a protocol converter.

Accelerometer → SPI - Arduino - UART → XBee.

couldn’t you fake it using xbee dio? (the spi speed won’t be too good…but it should work right?)

That is an interesting idea groggory.

But can the Accelerometer generate an SPI clock? Probably not since it can only be an SPI Slave. You still need an SPI master to generate the CS and SCK to the Accelerometer chip.

To have this work the XBee’s IO lines need to be driven from other end (over the RF link) with CS & SCK or through remote IO commands.

Hi, minerva, I`m want to get mi 3axis Accelerometer comunicate with arduino via Spi, could you help me out with a simple code to test the accelerometer…or a pointing start

Thanks in advance

A hack, but you could take a $2 microprocessor like an Atmel Tiny2313 or some such. Code up an SPI interface using bit-toggling if the little chip doesn’t have SPI hardware. Then process the SPI data and send it out a UART which is connected to the XBee’s UART.