Wednesday, April 24, 2013

TryFi 4

TryFi 4 - The SPI Try

I've been trying to line up which pins to provide the XbeeWifi library, so it can communicate with the Xbee wifi radio. Once I have this completed, it should be somewhat easier to make it host a webpage over the wifi connection.

Let's go over what I have learned so far:
*SPI uses 5 pins to communicate:
  -MOSI = Master device (Output) to the Subordinate device (Input)

  -MISO = Master device (Input) from the Subordinate device (Output). Named after a tasty soup, this is opposite of MOSI.
  -CLK = Clock. It's a circuit in a processor that's like a camshaft in an engine, in that it synchronizes all of the other parts. One master device can provide the clock signal to multiple subordinate devices.
  -ATN =Attention This allows a subordinate device to tell the master device that it has information to send. 
  -SEL = Select. This pin is used by the master device to tell a subordinate device to transmit data. This allows designs where MOSI, MISO, and CLK are shared between several subordinate devices, and each subordinate will only use the MOSI and MISO lines (also known as a Bus) when their SEL is turned on during the CLK pulse. This would save pins, allowing more subordinates per master. 

*CJBearman's XbeeWifi library calls for 3 of these plus 1 additional pin:
  -RESET - Reset. This is optional, but allows for the Xbee to be reset into SPI mode by the library. The other option is to manually configure the Xbee with X-CTU.

*The Xbee uses the following pinouts:

  -MOSI = 11

  -MISO = 4

  -CLK = 18

  -ATN = 13

  -SEL = 17
  -RESET = 5

*Arduino Uno SPI pinouts:
  -MOSI = 11 & ICSP 4

  -MISO = 12 & ICSP 1

  -CLK = SCK = 13 & ICSP 3

  -ATN = 

  -SEL = 10 (SS)
  -RESET = 1 & ICSP 5

Something to note here is the Arduino Uno's ICSP header has these same pins -- it seems pin 11 and ICSP 4 both connect to the same pin on the Atmel ATMega328. A good post with some very technical details helps me to sort this out. I'm not completely sure that Reset on the Uno is the same Reset as the Xbee is looking for. 

So far, we have:
Select: 10
Atn: ? 
Reset: 1?
DOUT: 12

For the library to work, we have to have at least the first 2 filled in. Out of desperation, I'm manually wiring the Reset and ATN pins to 5 and 6

Here the yellow wire runs from Arduino
Pin 5 to Xbee pin 5, while the white wire
runs from Arduino Pin 6 to Xbee Pin 17 

Looking at the pinouts...

No comments:

Post a Comment