Digi XBee, XBee-PRO User Manual

XBee/XBee-PRO S1 802.15.4 (Legacy)
RF Modules
User Guide
Revision history—90000982
Revision Date Description
T December
2015
V October
2016
W June 2017 Modified regulatory and certification information as required by RED (Radio
X May 2018 Added note on range estimation. Changed ICto ISED.
Corrected RESET pin information.
Noted that bit 13 of the SC parameter is not available for XBee-PRO devices. Corrected an error in the I/O line passing parameters table. Added S1 and Legacy to the product name. Updated the certifications.
Updated and rebranded the documentation.
Equipment Directive).
Trademarks and copyright
Digi, Digi International, and the Digi logo are trademarks or registered trademarks in the United States and other countries worldwide. All other trademarks mentioned in this document are the property of their respective owners.
© 2018 Digi International Inc. All rights reserved.
Disclaimers
Information in this document is subject to change without notice and does not represent a commitment on the part of Digi International. Digi provides this document “as is,” without warranty of any kind, expressed or implied, including, but not limited to, the implied warranties of fitness or merchantability for a particular purpose. Digi may make improvements and/or changes in this manual or in the product(s) and/or the program(s) described in this manual at any time.
Warranty
To view product warranty information, go to the following website:
www.digi.com/howtobuy/terms
Customer support
Gather support information: Before contacting Digi technical support for help, gather the following
information:
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
2
Product name and model
Product serial number (s)
Firmware version
Operating system/browser (if applicable)
Logs (from time of reported issue)
Trace (if possible)
Description of issue
Steps to reproduce
Contact Digi technical support: Digi offers multiple technical support plans and service packages. Contact us at +1 952.912.3444 or visit us at www.digi.com/support.
Feedback
To provide feedback on this document, email your comments to
Include the document title and part number (XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide, 90000982 X) in the subject line of your email.
techcomm@digi.com
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
3
Contents
About the XBee/XBee-PRO S1 802.15.4 (Legacy) RF Modules
Technical specifications
Electrical characteristics 10
DC Characteristics (VCC = 2.8 - 3.4 VDC) 10
ADC timing/performance characteristics1 11 Performance specifications 12 Power requirements 12 General specifications 13 Networking and security specifications 13 Regulatory conformity summary 13
Hardware
Antenna options 16 XBee/XBee-PRO S1 802.15.4 (Legacy) Mechanical drawings 16 Mounting considerations 16 Pin signals 17 Design notes 19
Power supply design 19
Board layout 19
Antenna performance 19
Pin connection recommendations 20
Keepout area 20
Operation
Serial communications 23
UART data flow 23
Transparent operating mode 24
API operating mode 24
Flow control 25 ADC and Digital I/O line support 26
I/O data format 27
API support 27
Sleep support 27
DIO pin change detect 28
Sample rate (interval) 28
I/O line passing 28
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
4
Configuration example 30 Networks 30
Peer-to-peer networks 31
NonBeacon (with coordinator) 31
Association 31 Addressing 34
Unicast mode 34
Broadcast mode 35 Modes of operation 35
Idle mode 36
Transmit/Receive modes 36
Sleep modes 38 Multiple AT commands 41 Parameter format 41
Configuration
Configure the device using XCTU 44 Programming the RF module 44
Setup 44 Remote configuration commands 45
Send a remote command 45
Apply changes on remote devices 46
Remote command responses 46 Software libraries 46 XBee Network Assistant 46
AT commands
Special commands 49
WR (Write) 49
RE (Restore Defaults) 49
FR (Software Reset) 49 Networking and security commands 50
CH (Channel) 50
ID (PAN ID) 50
DH (Destination Address High) 50
DL (Destination Address Low) 51
MY (16-bit Source Address) 51
SH (Serial Number High) 51
SL (Serial Number Low) 51
RR (XBee Retries) 52
RN (Random Delay Slots) 52
MM (MAC Mode) 53
NI (Node Identifier) 53
ND (Node Discover) 54
NT (Node Discover Time) 55
NO (Node Discovery Options) 55
DN (Destination Node) 55
CE (Coordinator Enable) 56
SC (Scan Channels) 56
SD (Scan Duration) 57
A1 (End Device Association) 58
A2 (Coordinator Association) 59
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
5
AI (Association Indication) 60
DA (Force Disassociation) 61
FP (Force Poll) 61
AS (Active Scan) 61
ED (Energy Scan) 62
EE (AES Encryption Enable) 63
KY (AES Encryption Key) 63 RF interfacing commands 64
PL (Power Level) 64
CA (CCA Threshold) 64 Sleep commands (low power) 65
SM (Sleep Mode) 65
SO (Sleep Options) 66
ST (Time before Sleep) 66
SP (Cyclic Sleep Period) 66
DP (Disassociated Cyclic Sleep Period) 67 Serial interfacing commands 67
BD (Interface Data Rate) 67
RO (Packetization Timeout) 69
AP (API Enable) 69
NB (Parity) 70
PR (Pull-up/Down Resistor Enable) 70 I/O settings commands 71
D0 (DIO0 Configuration) 71
D1 (DIO1 Configuration) 71
D2 (AD2/DIO2 Configuration) 72
D3 (DIO3 Configuration) 72
D4 (DIO4 Configuration) 73
D5 (DIO5 Configuration) 73
D6 (DIO6 Configuration) 74
D7 (DIO7 Configuration) 74
D8 (DIO8 Configuration) 75
IU (I/O Output Enable) 75
IT (Samples before TX) 76
IS (Force Sample) 76
IO (Digital Output Level) 77
IC (DIO Change Detect) 77
IR (Sample Rate) 77
IA (I/O Input Address) 78
T0 (D0 Output Timeout) 78
T1 (D1 Output Timeout) 79
T2 (D2 Output Timeout) 79
T3 (D3 Output Timeout) 79
T4 (D4 Output Timeout) 80
T5 (D5 Output Timeout) 80
T6 (D6 Output Timeout) 80
T7 (D7 Output Timeout) 81
P0 (PWM0 Configuration) 81
P1 (PWM1 Configuration) 81
M0 (PWM0 Output Level) 82
M1 (PWM1 Output Level) 82
PT (PWM Output Timeout) 83
RP (RSSI PWM Timer) 83 Diagnostic commands 83
VR (Firmware Version) 84
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
6
VL (Version Long) 84
HV (Hardware Version) 84
DB (Last Packet RSSI) 84
EC (CCA Failures) 85
EA (ACK Failures) 85
ED (Energy Scan) 85 Command mode options 86
CT (Command Mode Timeout) 86
CN (Exit Command mode) 86
AC (Apply Changes) 86
GT (Guard Times) 87
CC (Command Sequence Character) 87
API operation
API frame specifications 89
API operation (AP parameter = 1) 89
API operation-with escaped characters (AP parameter = 2) 89 Calculate and verify checksums 90
Example 90 API types 91
Modem Status - 0x8A 91
Modem status codes 93
Local AT Command Request - 0x08 93
Queue Local AT Command Request - 0x09 95
Local AT Command Response - 0x88 96
Remote AT Command Request - 0x17 98
Remote AT Command Response- 0x97 100
64-bit Transmit Request - 0x00 102
16-bit Transmit Request- 0x01 104
Transmit Status - 0x89 106
64-bit Receive Packet - 0x80 108
16-bit Receive Packet - 0x81 109
64-bit I/O Sample Indicator - 0x82 111
16-bit I/O Sample Indicator - 0x83 113
Regulatory information
United States (FCC) 116
OEM labeling requirements 116
FCC notices 116
FCC-approved antennas (2.4 GHz) 117
RF exposure 123 Europe (CE) 123
Maximum power and frequency specifications 123
OEM labeling requirements 123
Declarations of conformity 124
Antennas 124 ISED (Innovation, Science and Economic Development Canada) 125
Labeling requirements 125 Japan 125
Labeling requirements 125 Brazil ANATEL 125
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
7

About the XBee/XBee-PRO S1 802.15.4 (Legacy) RF Modules

The XBee and XBee-PRO RF Modules were engineered to meet IEEE 802.15.4 standards and support the unique needs of low-cost, low-power wireless sensor networks. The devices require minimal power and provide reliable delivery of data between devices.
The devices operate within the ISM 2.4 GHz frequency band and are pin-for-pin compatible with each other.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
8

Technical specifications

Electrical characteristics 10 Performance specifications 12 Power requirements 12 General specifications 13 Networking and security specifications 13 Regulatory conformity summary 13
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
9
Technical specifications Electrical characteristics

Electrical characteristics

The following tables list the electrical characteristics of the XBee/XBee-PRO XBee/XBee-PRO S1
802.15.4 (Legacy) RF Modules.

DC Characteristics (VCC = 2.8 - 3.4 VDC)

Symbol Characteristic Condition Min Typical Max Unit
V
IL
V
IH
V
OL
V
OH
Input low voltage All Digital Inputs - - 0.35 *
Input high voltage All Digital Inputs 0.7 *
Output low voltage IOL= 2 mA, VCC >= 2.7 V - - 0.5 V
Output high
IOH= -2 mA, VCC >= 2.7VVCC
voltage
II
IN
II
OZ
Input leakage Current
High impedance leakage current
VIN = VCC or GND, all inputs, per pin
VIN = VCC or GND, all I/O High-Z, per pin
TX Transmit current VCC = 3.3 V -
RX Receive current VCC = 3.3 V -
PWR­DWN
Power-down current
SM parameter = 1 - <10 - µA
V
VCC
- - V
VCC
- - V
- 0.5
- 0.025 1 µA
- 0.025 1 µA
45 (XBee)
- mA
215, 140 (XBee-PRO, International)
50 (XBee)
- mA
55 (XBee-PRO)
ADC characteristics (operating)
Symbol Characteristic Condition Min Typical Max Unit
V
REFH
I
REF
V
INDC
1. V
2. Maximum electrical operating range, not valid conversion range.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
VREF - analog-to-digital converter reference range
VREF - reference supply current Enabled - 200 - µA
Analog input voltage
is connected to VCC.
DDAD
2
Disabled or Sleep Mode
2.08 - V
DDAD
1
V
- <0.01 0.02 µA
V
SSAD
0.3
-
V
DDAD
0.3
+
V
10
Technical specifications Electrical characteristics
ADC timing/performance characteristics
1
Symbol Characteristic Condition Min Typical Max Unit
R
AS
V
AIN
Source impedance at input
Analog input voltage
RES Ideal resolution (1 LSB)
DNL Differential non-linearity
INL Integral non-linearity
E
ZS
F
FS
E
IL
E
TU
Zero-scale error
Full-scale error
Input leakage error
Total unadjusted error
7
8
9
2
- - - kW
3
4
5
6
- V
REFL
- V
REFL
V
2.08V < VDDAD < 3.6V 2.031 - 3.516 mV
- - ±0.5 ±1.0 LSB
- - ±0.5 ±1.0 LSB
- - ±0.4 ±1.0 LSB
- - ±0.4 ±1.0 LSB
- - ±0.05 ±5.0 LSB
10
- - ±1.1 ±2.5 LSB
1. All accuracy numbers are based on the processor and system being in WAIT state (very little
activity and no I/O switching) and that adequate low-pass filtering is present on analog input pins (filter with 0.01 µF to 0.1 µF capacitor between analog input and VREFL). Failure to observe these guidelines may result in system or microcontroller noise causing accuracy errors which will vary based on board layout and the type and magnitude of the activity. Data transmission and reception during data conversion may cause some degradation of these specifications, depending on the number and timing of packets. We advise testing the ADCs in your installation if best accuracy is required.
2. RASis the real portion of the impedance of the network driving the analog input pin. Values
greater than this amount may not fully charge the input circuitry of the ATD resulting in accuracy error.
3. Analog input must be between V
REFL
and V
for valid conversion. Values greater than V
REFH
REFH
will convert to $3FF.
4. The resolution is the ideal step size or 1LSB = (V
REFH–VREFL
)/1024.
5. Differential non-linearity is the difference between the current code width and the ideal code
width (1LSB). The current code width is the difference in the transition voltages to and from the current code.
6. Integral non-linearity is the difference between the transition voltage to the current code and
the adjusted ideal transition voltage for the current code. The adjusted ideal transition voltage is (Current Code–1/2)*(1/((VREFH+EFS)–(VREFL+EZS))).
7. Zero-scale error is the difference between the transition to the first valid code and the ideal
transition to that code. The Ideal transition voltage to a given code is (Code–1/2)*(1/(VREFH– VREFL)).
8. Full-scale error is the difference between the transition to the last valid code and the ideal
transition to that code. The ideal transition voltage to a given code is (Code–1/2)*(1/(VREFH– VREFL)).
9. Input leakage error is error due to input leakage across the real portion of the impedance of
the network driving the analog pin. Reducing the impedance of the network reduces this error.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
11
Technical specifications Performance specifications
10. Total unadjusted error is the difference between the transition voltage to the current code and the ideal straight-line transfer function. This measure of error includes inherent quantization error (1/2LSB) and circuit error (differential, integral, zero-scale, and full-scale) error. The specified value of ETU assumes zero EIL (no leakage or zero real source impedance).

Performance specifications

The following table describes the performance specifications for the devices.
Note Range figure estimates are based on free-air terrain with limited sources of interference. Actual
range will vary based on transmitting power, orientation of transmitter and receiver, height of transmitting antenna, height of receiving antenna, weather conditions, interference sources in the area, and terrain between receiver and transmitter, including indoor and outdoor structures such as walls, trees, buildings, hills, and mountains.
Specification
Indoor/urban range
Outdoor RF line-of-sight range
Transmit power output (software selectable)
RF data rate
Serial interface data rate (software selectable)
Receiver sensitivity (typical)

Power requirements

The following table describes the power requirements for the XBee/XBee-PRO S1 802.15.4 (Legacy).
XBee
Up to 100 ft (30 m)
Up to 300 ft (90 m)
1 mW (0 dBm)
250,000 b/s 250,000 b/s
1200 b/s - 250 kb/s (non-standard baud rates also supported)
-92 dBm (1% packet error rate)
XBee-PRO
Up to 300 ft. (90 m) Up to 200 ft (60 m) International variant
Up to 1 mile (1600 m) Up to 2500 ft (750 m) international variant
63 mW (18 dBm)* 10 mW (10 dBm) for international variant
1200 bps - 250 kb/s (non-standard baud rates also supported)
100 dBm (1% packet error rate)
Specification
Supply voltage 2.8 - 3.4 V 2.8 - 3.4 V
Transmit current (typical)
Idle/receive current (typical)
Power-down current < 10 uA < 10 uA
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
XBee XBee-PRO
45 mA (@3.3 V)
50 mA (@3.3 V)
n 250 mA (@3.3 V) (150 mA for international variant)
RPSMA module only.
n 340 mA (@3.3 V) (180 mA for international variant)
55 mA (@ 3.3 V)
12
Technical specifications General specifications

General specifications

The following table describes the general specifications for the devices.
Specification XBee XBee-PRO
Operating frequency band
Dimensions 0.960 in x 1.087 in (2.438 cm x 2.761 cm) 0.960 in x 1.297 in (2.438 cm x 3.294 cm)
Operating temperature
Antenna options
ISM 2.4 GHz ISM 2.4 GHz
-40 to 85ºC (industrial) -40 to 85ºC (industrial)
Integrated whip antenna, embedded PCB antenna, U.FL connector, RPSMA connector

Networking and security specifications

The following table describes the networking and security specifications for the devices.
Specification
Supported network topologies Point-to-point, point-to-multipoint and
Number of channels (software selectable)
Addressing options PAN ID, channel and addresses PAN ID, channel and
XBee
peer-to-peer
16 direct sequence channels 12 direct sequence
Integrated whip antenna, embedded PCB antenna, U.FL connector, RPSMA connector
XBee-PRO
channels
addresses

Regulatory conformity summary

This table describes the agency approvals for the devices.
Specification XBee XBee-PRO
United States (FCC Part 15.247) OUR-XBEE OUR-XBEEPRO
Innovation, Science and Economic Development Canada (ISED)
Europe (CE) Yes Yes (Maximum 10 dBm transmit power
1
See Regulatory information or region-specific certification requirements.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
4214A-XBEE 4214A-XBEEPRO
output)
1
13
Technical specifications Regulatory conformity summary
Specification XBee XBee-PRO
Japan R201WW07215214
Australia/New Zealand RCM/R-NZ RCM/R-NZ
Brazil ANATEL 0369-15-
1209
R201WW08215111 (Maximum 10 dBm transmit power output)*
Wire, chip, RPMSA, and U.FL versions are certified for Japan. PCB antenna version is not.
ANATEL 0378-15-1209
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
14

Hardware

Antenna options 16 XBee/XBee-PRO S1 802.15.4 (Legacy) Mechanical drawings 16 Mounting considerations 16 Pin signals 17 Design notes 19
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
15
Hardware Antenna options

Antenna options

The ranges specified are typical for the integrated whip (1.5 dBi) and dipole (2.1 dBi) antennas. The printed circuit board (PCB) antenna option provides advantages in its form factor; however, it typically yields shorter range than the whip and dipole antenna options when transmitting outdoors. For more information, see XBee and XBee-PRO OEM RF Module Antenna Considerations Application Note.

XBee/XBee-PRO S1 802.15.4 (Legacy) Mechanical drawings

The following graphics show the mechanical drawings of the XBee / XBee-PRO OEM RF Modules. The XBee and XBee-PRO RF Modules are pin-for-pin compatible.
Note The antenna options not shown.

Mounting considerations

We design the through-hole module to mount into a receptacle so that you do not have to solder the module when you mount it to a board. The development kits may contain RS-232 and USB interface boards that use two 20-pin receptacles to receive modules.
The following illustration shows the module mounting into the receptacle on the RS-232 interface board.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
16
Hardware Pin signals
Century Interconnect manufactures the receptacles used on Digi development boards. Several other manufacturers provide comparable mounting solutions; however, Digi currently uses the following receptacles:
n Through-hole single-row receptacles: Samtec part number: MMS-110-01-L-SV (or equivalent)
n Surface-mount double-row receptacles: Century Interconnect part number: CPRMSL20-D-0-1
(or equivalent)
n Surface-mount single-row receptacles: Samtec part number: SMM-110-02-SM-S
Note We recommend that you print an outline of the module on the board to indicate the
correct orientation for mounting the module.

Pin signals

The following image shows the pin numbers; it shows the device's top sides, the shields are on the bottom.
The following table describes the pin assignments for the devices. A horizontal line above the signal name indicates low-asserted signals.
Pin Name Direction Description
1
VCC - Power supply
2
DOUT Output UART data out
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
17
Hardware Pin signals
Pin Name Direction Description
3 DIN/CONFIG
DO8
1
4
5 RESET
Input UART data In
Either Digital output 8
Input/Open drain output
Device reset (reset pulse must be at least 200 ns). This must be driven as an open drain/collector. The device drives this line low when a reset occurs. Never drive this line high.
6
PWM0/RSSI Either PWM output 0 / RX signal strength indicator
7
PWM1 Either PWM output 1
8
[reserved] - Do not connect
9 DTR/SLEEP_RQ/DI8
10
GND - Ground
11
AD4/DIO4 Either Analog input 4 or digital I/O 4
12 CTS /DIO7
13 ON/SLEEP
14
VREF Input Voltage reference for A/D inputs
15
Associate/AD5/DIO5 Either Associated indicator, analog input 5 or digital I/O 5
Either Pin sleep control line or digital input 8
Either Clear-to-send flow control or digital I/O 7
Output Device status indicator
16 RTS/DIO6
17
AD3/DIO3 Either Analog input 3 or digital I/O 3
18
AD2/DIO2 Either Analog input 2 or digital I/O 2
19
AD1/DIO1 Either Analog input 1 or digital I/O 1
20
AD0/DIO0 Either Analog input 0, digital I/O 0
Either Request-to-send flow control, or digital I/O 6
Notes:
n Minimum connections: VCC, GND, DOUT and DIN
n Minimum connections for updating firmware: VCC, GND, DIN, DOUT, RTS and DTR
n Signal direction is specified with respect to the module
n The module includes a 50 kΩ pull-up resistor attached to RESET
n You can configure several of the input pull-ups using the PR command
n Leave any unused pins disconnected
1
Function is not supported at the time of this release.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
18
Hardware Design notes

Design notes

The XBee modules do not specifically require any external circuitry specific connections for proper operation. However, there are some general design guidelines that we recommend for help in troubleshooting and building a robust design.

Power supply design

A poor power supply can lead to poor device performance, especially if you do not keep the supply voltage within tolerance or if it is excessively noisy. To help reduce noise, place a 1.0 μF and 8.2 pF capacitor as near as possible to pin 1 on the PCB. If you are using a switching regulator for the power supply, switch the frequencies above 500 kHz. Limit the power supply ripple to a maximum 100 mV peak to peak.

Board layout

We design XBee devices to be self sufficient and have minimal sensitivity to nearby processors, crystals or other printed circuit board (PCB) components. Keep power and ground traces thicker than signal traces and make sure that they are able to comfortably support the maximum current specifications. There are no other special PCB design considerations to integrate XBee devices, with the exception of antennas.

Antenna performance

Antenna location is important for optimal performance. The following suggestions help you achieve optimal antenna performance. Point the antenna up vertically (upright). Antennas radiate and receive the best signal perpendicular to the direction they point, so a vertical antenna's omnidirectional radiation pattern is strongest across the horizon.
Position the antennas away from metal objects whenever possible. Metal objects between the transmitter and receiver can block the radiation path or reduce the transmission distance. Objects that are often overlooked include:
n metal poles
n metal studs
n structure beams
n concrete, which is usually reinforced with metal rods
If you place the device inside a metal enclosure, use an external antenna. Common objects that have metal enclosures include:
n vehicles
n elevators
n ventilation ducts
n refrigerators
n microwave ovens
n batteries
n tall electrolytic capacitors
Do not place XBee devices with the chip or integrated PCB antenna inside a metal enclosure.
Do not place any ground planes or metal objects above or below the antenna.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
19
Hardware Design notes
For the best results, mount the device at the edge of the host PCB. Ensure that the ground, power, and signal planes are vacant immediately below the antenna section.

Pin connection recommendations

The only required pin connections are VCC, GND, DOUT and DIN. To support serial firmware updates, you should connect VCC, GND, DOUT, DIN, RTS, and SLEEP (DTR).
Leave all unused pins disconnected. Pull all inputs on the device high with internal pull-up resistors using the PR command. You do not need a specific treatment for unused outputs.
Other pins may be connected to external circuitry for convenience of operation including the Associate LED pin (pin 15). The Associate LED flashes differently depending on the state of the device.
If analog sampling is desired, attach the VRef (pin 14) to a voltage reference.

Keepout area

We recommend that you allow a “keepout” area, as shown in the following drawing.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
20
Hardware Design notes
Notes
1. We recommend non-metal enclosures. For metal enclosures, use an external antenna.
2. Keep metal chassis or mounting structures in the keepout area at least 2.54 cm (1 in) from the antenna.
3. Maximize the distance between the antenna and metal objects that might be mounted in the keepout area.
4. These keepout area guidelines do not apply for wire whip antennas or external RFconnectors. Wire whip antennas radiate best over the center of a ground plane.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
21

Operation

Serial communications 23 ADC and Digital I/O line support 26 Networks 30 Addressing 34 Modes of operation 35 Multiple AT commands 41 Parameter format 41
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
22
Operation Serial communications

Serial communications

RF Modules interface to a host device through a serial port. Using its serial port, the device communicates with any of the following:
n Logic and voltage compatible UART
n Level translator to any serial device (for example, through an RS-232 or USB interface board)

UART data flow

Devices that have a UART interface connect directly to the pins of the XBee/XBee-PRO S1 802.15.4 (Legacy) as shown in the following figure. The figure shows system data flow in a UART-interfaced environment. Low-asserted signals have a horizontal line over the signal name.
Serial data
A device sends data to the XBee/XBee-PRO S1 802.15.4 (Legacy)'s UART through pin 3 DIN as an asynchronous serial signal. When the device is not transmitting data, the signals should idle high.
For serial communication to occur, you must configure the UART of both devices (the microcontroller and the XBee/XBee-PRO S1 802.15.4 (Legacy)) with compatible settings for the baud rate, parity, start bits, stop bits, and data bits.
Each data byte consists of a start bit (low), 8 data bits (least significant bit first) and a stop bit (high). The following diagram illustrates the serial bit pattern of data passing through the device. The diagram shows UART data packet 0x1F (decimal number 31) as transmitted through the device.
Serial communications depend on the two UARTs (the microcontroller and the RF device) to be configured with compatible settings, including baud rate, parity, start bits, stop bits, and data bits.
The UART baud rate and parity settings on the XBee module can be configured with the BD and NB commands, respectively. For more information, see AT commands.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
23
Operation Serial communications

Transparent operating mode

Devices operate in this mode by default. The device acts as a serial line replacement when it is in Transparent operating mode. The device queues all UART data it receives through the DIN pin for RF transmission. When a device receives RF data, it sends the data out through the DOUT pin. You can set the configuration parameters using Command mode.
Serial-to-RF packetization
The device buffers data in the serial receive buffer until one of the following causes the data to be packetized and transmitted:
n The device receives no serial characters for the amount of time determined by the RO
(Packetization Timeout) parameter. If RO = 0, packetization begins when a character is received.
n The device receives the Command Mode Sequence (GT + CC + GT). Any character buffered in
the serial receive buffer before the sequence is transmitted.
n The device receives the maximum number of characters that fits in an RF packet (100 bytes).
If the device cannot immediately transmit (for example, if it is already receiving RF data), it stores the serial data in the DI buffer. The device packetizes the data and sends the data at any RO timeout or when it receives the maximum packet size (100 bytes).
If the DI buffer becomes full, hardware or software flow control must be implemented in order to prevent overflow (that is, loss of data between the host and module).

API operating mode

API (Application Programming Interface) operating mode is an alternative to the default Transparent operating mode. The frame-based API extends the level to which a host application can interact with the networking capabilities of the module.
When in API mode, all data entering and leaving the device is contained in frames that define operations or events within the module.
Transmit data frames (received through the DI pin (pin 3)) include:
n RF Transmit data frame
n Command frame (equivalent to AT commands)
Receive Data frames (sent out the DO pin (pin 2)) include:
n RF-received data frame
n Command response
n Event notifications such as reset, associate, disassociate, and so on
The API provides alternative means of configuring modules and routing data at the host application layer. A host application sends data frames to the device that contains address and payload information instead of using command mode to modify addresses. The device sends data frames to the application containing status packets, as well as source, RSSI, and payload information from received data packets.
The API operation option facilitates many operations such as the following examples:
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
24
Operation Serial communications
n Transmitting data to multiple destinations without entering Command Mode
n Receiving success/failure status of each transmitted RF packet
n Identifying the source address of each received packet
To implement API operation, see API operation.

Flow control

The XBee/XBee-PRO S1 802.15.4 (Legacy) maintains buffers to collect serial and RF data that it receives. The serial receive buffer collects incoming serial characters and holds them until the device can process them. The serial transmit buffer collects the data it receives via the RF link until it transmits that data out the serial port. The following figure shows the process of device buffers collecting received serial data.
DI (Data in) buffer
When serial data enters the RF module through the DI pin (pin 3), the device stores data in the DI buffer until it can be processed.
Hardware Flow Control (CTS)
If you enable CTS flow control (by setting D7 to 1), when the DI buffer is 17 bytes away from being full, the device de-asserts CTS (sets it high) to signal to the host device to stop sending serial data. The device reasserts CTS after the serial receive buffer has 34 bytes of space.
To eliminate the need for flow control:
1. Send messages that are smaller than the DI buffer size (202 bytes).
2. Interface at a lower baud rate [BD (Interface Data Rate) parameter] than the throughput data rate.
Example where the DI buffer may become full and possibly overflow:
If the device is receiving a continuous stream of RF data, it places any serial data that arrives on the DI pin in the DI buffer. The device transmits data in the DI buffer over-the-air when it is no longer receiving RF data in the network.
For more information, see the following command descriptions:
n RO (Packetization Timeout)
n BD (Interface Data Rate)
n D7 (DIO7 Configuration)
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
25
Operation ADC and Digital I/O line support
DO (Data out) buffer
When RF data is received, the data enters the DO buffer and is sent out the serial port to a host device. Once the DO Buffer reaches capacity, any additional incoming RF data is lost.
Hardware Flow Control (RTS)
If you enable RTS flow control (D6 (DIO6 Configuration) Parameter = 1), the device does not send data out the DO buffer as long as RTS (pin 16) is de-asserted.
Examples where the DO buffer may become full, resulting in dropped RF packets:
1. If the RF data rate is set higher than the interface data rate of the device, the device may receive data faster than it can send the data to the host. Even occasional transmissions from a large number of devices can quickly accumulate and overflow the transmit buffer.
2. If the host does not allow the device to transmit data out from the serial transmit buffer due to being held off by hardware flow control.
See the D6 (DIO6 Configuration) command description for more information.

ADC and Digital I/O line support

The XBee/XBee-PRO RF Modules support ADC (analog-to-digital conversion) and digital I/O line passing. The following pins support multiple functions:
n Pin functions and their associated pin numbers and commands
n AD = Analog-to-Digital Converter, DIO = Digital Input/Output
Note Pin functions in parentheses are not applicable to this section.
Pin function Pin# AT Command
AD0/DIO0 20
AD1/DIO1 19
AD2/DIO2 18
AD3/DIO3 / (COORD_SEL) 1
AD4/DIO4 11
AD5/DIO5 / (ASSOCIATE) 15
DIO6/(RTS) 16
DIO7/(CTS) 12
DI8/(DTR) / (Sleep_RQ) 9
Use the following setting to enable ADC and DIO pin functions:
D0
D1
D2
D3
D4
D5
D6
D7
D8
Support type Setting
ADC support ATDn = 2
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
26
Operation ADC and Digital I/O line support
Support type Setting
Digital input support ATDn = 3
Digital output low support ATDn = 4
Digital output high support ATDn = 5

I/O data format

I/O data begins with a header. The first byte of the header defines the number of samples forthcoming. The last two bytes of the header (Channel Indicator) define which inputs are active. Each bit represents either a DIO line or ADC channel. The following figure illustrates the bits in the header.
Sample data follows the header and the channel indicator frame determines how to read the sample data. If any of the DIO lines are enabled, the first two bytes are the DIO sample. The ADC data follows. ADC channel data is represented as an unsigned 10-bit value right-justified on a 16- bit boundary. The following figure illustrates the sample data bits.

API support

I/O data is sent out the UART using an API frame. All other data can be sent and received using Transparent Operation or API frames if API mode is enabled (AP > 0).
API Operations support two RX (Receive) frame identifiers for I/O data (set 16-bit address to 0xFFFE and the device does 64-bit addressing):
n 0x82 for RX Packet: 64-bit Address I/O
n 0x83 for RX Packet: 16-bit Address I/O
The API command header is the same as shown in 64-bit Receive Packet - 0x80 and 16-bit I/O Sample
Indicator - 0x83. RX data follows the format described in I/O data format.

Sleep support

Set SO (Sleep Options) bit 1 to suppress automatic wake-up sampling.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
27
Operation ADC and Digital I/O line support
When a device wakes, it always performs a sample based on any active ADC or DIO lines. This allows sampling based on the sleep cycle whether it be Cyclic Sleep (SM = 4 or 5) or Pin Sleep (SM = 1). Set the IR (Sample Rate) parameter to gather more samples when awake.
For Cyclic Sleep modes: If the IR parameter is set, the device stays awake until the IT (Samples before
TX) parameter is met. The device stays awake for ST (Time before Sleep).

DIO pin change detect

When you use the IC (DIOChange Detect) command to enable DIO Change Detect, DIO lines 0 - 7 are monitored. When a change is detected on a DIO line, the following occurs:
1. An RF packet is sent with the updated DIO pin levels. This packet does not contain any ADC samples.
2. Any queued samples are transmitted before the change detect data. This may result in receiving a packet with less than IT (Samples before TX) samples.
Note Change detect does not affect Pin Sleep wake-up. The D8 pin (DTR/Sleep_RQ/DI8) is the only line
that wakes a device from Pin Sleep. If not all samples are collected, the device still enters Sleep Mode after a change detect packet is sent. Change detect is only supported when the Dx (DIOx Configuration) parameter equals 3, 4 or 5.
Applicable Commands: IC (DIO Change Detect), IT (Samples before TX)
Note Change detect is only supported when the Dx (DIOx Configuration) parameter equals 3, 4 or 5.

Sample rate (interval)

The Sample Rate (Interval) feature allows enabled ADC and DIO pins to be read periodically on devices that are not configured to operate in Sleep Mode. When one of the Sleep Modes is enabled and the IR
(Sample Rate) parameter is set, the device stays awake until IT (Samples before TX) samples have
been collected.
Once a particular pin is enabled, the appropriate sample rate must be chosen. The maximum sample rate that can be achieved while using one A/D line is 1 sample/ms or 1 kHz. The device cannot keep up with transmission when IR and IT are equal to 1 and we do not recommend configuring the device to sample at rates greater than once every 20 ms.

I/O line passing

You can set up virtual wires between XBee/XBee-PRO Modules. When a device receives an RF data packet that contains I/O data, it can be setup to update any enabled outputs (PWM and DIO) based on the data it receives.
I/O lines are mapped in pairs. For example, AD0 can only update PWM0 and DI5 can only update DO5. The default setup is for outputs not to be updated, which results in the I/O data being sent out the UART (See the IU (I/O Output Enable) command). To enable the outputs for updating, set the IA (I/O Input Address) parameter with the address of the device that has the appropriate inputs enabled. This binds the outputs to a particular device's input. This does not affect the ability of the device to receive I/O line data from other modules; if affects only its ability to update enabled outputs. The IA parameter can also be set up to accept I/O data for output changes from any module by setting the IA parameter to 0xFFFF.
When outputs are changed from their non-active state, the device can be setup to return the output level to its non-active state. Set the timers using the Tn (Dn Output Timer) and PT (PWM Output
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
28
Operation ADC and Digital I/O line support
Timeout) commands. The timers are reset every time the device receives a valid I/O sample packet with a matching IA address.
You can adjust the IC (Change Detect) and IR (Sample Rate) parameters to keep the outputs set to their active output if the system needs more time than the timers can handle.
Note DI8 cannot be used for I/O line passing.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
29
Operation Networks
Applicable commands:
n IA (I/O Input Address)
n TN (Dn Output Timeout)
n P0 (PWM0 Configuration)
n P1 (PWM1 Configuration)
n M0 (PWM0 Output Level)
n M1 (PWM1 Output Level)
n PT (PWM Output Timeout)
n RP (RSSSI PWM Timer)

Configuration example

The following table provides an example of a pair of RF devices for a simple A/D link:
Remote Configuration Base Configuration
DL = 0x1234 DL = 0x5678
MY = 0x5678 MY = 0x1234
D0 = 2 P0 = 2
D1 = 2 P1 = 2
IR = 0x14 IU = 1
IT = 5 IA = 0x5678 (or 0xFFFF)
These settings configure the remote device to sample AD0 and AD1 once each every 20 ms. It then buffers 5 samples each before sending them back to the base device. The base then receives a 32­byte transmission (20 bytes data and 12 bytes framing) every 100 ms.

Networks

The following table describes some common terms we use when discussing networks.
Term Definition
Association Establishing membership between end devices and a coordinator.
Coordinator A full-function device (FFD) that provides network synchronization by polling nodes.
End device When in the same network as a coordinator. Devices that rely on a coordinator for
synchronization and can be put into states of sleep for low-power applications.
PAN Personal Area Network. A data communication network that includes one or more
end devices and optionally a coordinator.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
30
Loading...
+ 97 hidden pages