Command reference
Configuring radios to pass DIO
This is how to set up two radios so that pin signals (high or low) from one radio will be passed to the other.In this instance, we will show how to set up sending from to another, but having bi-directional communication should be similar.
On the transmitter radio:
- Under I/O Settings, set the pins that will be transmitted to "3 - DI" (data in)
- Set IC - DIO to FF (this will make it look at all the pins and transmit when they change)
- Set sample rate to 0 (unless you want synchronous updates)
- Set the corresponding pins to "4 - DO (LOW)" or "5- DO (HIGH)"
- Under I/O Line Passing set "Input Addresses" to 0xFFFF (allow any radios)
- Set IU - I/O Output enable to Disabled
Changing baud rates
You can change the baud rate using the ATBD command:- 0 = 1200
- 1 = 2400
- 2 = 4800
- 3 = 9600
- 4 = 19200
- 5 = 38400
- 6 = 57600
- 7 = 115200
-> AT (check if xbee modem is responding)
<- OK
-> ATBD (get current baud rate as above)
<- 3 (9600)
-> ATBD 4 (set baud rate to 19200)
<- OK
-> ATBD (check again)
<- 4
-> ATWR (write the baud rate change to flash)
<- OK
Setting a pin direction
Use ATDx where x is the pin number from 0 to 8- 0 = Disabled
- 1 = Special purpose: CTS pin (pin D7 only!) RTS pin (pin D6 only!) Association Indicator (pin D5 only!)
- 2 = Analog input (pins 0 thru 5 only)
- 3 = Digital input
- 4 = Digital output, default is low (0)
- 5 = Digital output, default is high (1)
-> AT (check if xbee modem is responding)
<- OK
-> ATD4 (get current pin state)
<- 0 (disabled)
-> ATD4 3 (set pin to digital input)
<- OK
-> ATD4 (check again)
<- 3
-> ATWR (write the change to flash)
<- OK
Changing the PAN ID
By default all XBee's use PAN ID #3332. The ID is 4 bytes of hexadecimal and can range from 0000 to FFFF. XBees will only send/receive data to other modems on the same PAN.Use ATID #### where #### is the 4 digit hex ID
For example to set the PAN ID to 3137
-> AT (check if xbee modem is responding)
<- OK
-> ATID (get current PAN)
<- 3332 (default, or something else)
-> ATID 3137 (set new id)
<- OK
-> ATID (check again)
<- 3137
-> ATWR (write the change to flash)
<- OK