Wednesday, November 7, 2007

11072007 class

coordinator

Router 1
Router 2
- ATNR
--> set the CH,channel
--> set the PAN ID

manual talble6-03. Networking Commands
Bit(Channel) 0(0x0B) -> ATCH B
0000 0000 0000 0001

pick a channel same as with PAN ID

send command("NI", "**_COORDINATOR"); -> name changed

send command("D1", byte(0x3)); -> digital pin setup

API - Application Programming Interface

ARDUINO CODE
Serial.available()>0
PROCESSING CODE
port.available()>0

int lengthMSB = port.read(); // high byte for length of packet
int lengthLSB = port.read(); // low byte for length of packet

int lengthTotal = (lengthMSB <<8) + lengthLSB; // bit shift and add for total

checksum
-> simple check to detect errors
0xFF = 255

API Identifier 0x8A

Sleep:
ATSM
ATSP : sleep period
ATST : time before sleep
ex) ATSM5, SP64, ST 14---> will wake up pin 9 high, and also every 1 sec.(1000ms) for 20ms

with micro controller -> set the one pin to detect signal to wake up xbee
without the micro controller -> set the sleep time to give interval period continuously to send radio signal