Digi XBee-PRO PKG-U User Manual

XBee-PRO PKG-U® USB RF Modem
802.15.4
User Guide
Revision history—90000831
Revision Date Description
A September, 2006 Initial release.
B
C July, 2017 Updated branding and made editorial enhancements.
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.
© 2017 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
Updated document to fix minor errors.
Send comments
Documentation feedback: To provide feedback on this document, send your comments to
techcomm@digi.com.
Customer support
Digi Technical Support: Digi offers multiple technical support plans and service packages to help our
customers get the most out of their Digi product. For information on Technical Support plans and pricing, contact us at +1 952.912.3444 or visit us at www.digi.com/support.
XBee-PRO PKG-U® USB RF Modem
2
Contents
XBee-PRO USB modem
Features overview 6
Worldwide acceptance 7 Specifications 8 External interface 10
Interfacing protocol
RS-232 operation 12
Pin signals 12
Wiring Diagrams 13
RF modem operation
Serial Communications 15
RS-232 data flow 15
Host and RF modem settings 15
Transparent operation 16
API operation 16
Flow control 17
IEEE 802.15.4 networks 18
Addressing 23
Modes of operation 24
RF modem configuration
Programming the RF Modem 30
Programming Examples 30
X-CTU software 31 Command reference 32
Special 32
Networking and security 33
RF Interfacing 45
Sleep (low power) 46
Serial interfacing 47
I/O settings 49
Diagnostics 57
AT command options 59 Command descriptions 61
XBee-PRO PKG-U® USB RF Modem
3
A1 (End Device Association) command 61
A2 (Coordinator Association) command 62
AC (Apply Changes) command 63
AI (Association Indication) command 63
AP (API Enable) command 64
AS (Active Scan) command 65
AV (ADC Voltage Reference) command 66
BD (Interface Data Rate) command 67
CA (CCA Threshold) command 68
CC (Command Sequence Character) command 68
CE (Coordinator Enable) command 69
CH (Channel) command 69
CN (Exit Command Mode) command 70
CT (Command Mode Timeout) command 70
D0 - D4 (DIOn Configuration) commands 70
D5 (DIO5 Configuration) command 71
D6 (DIO6 Configuration) command 72
D7 (DIO7 Configuration) command 72
D8 (DI8 Configuration) command 73
DA (Force Disassociation) command 73
DB (Received Signal Strength) command 73
DH (Destination Address High) command 74
DL (Destination Address Low) command 74
DN (Destination Node) command 75
DP (Disassociation Cyclic Sleep Period) command 75
EA (ACK Failures) command 76
EC (CCA Failures) command 76
ED (Energy Scan) command 76
EE (AES Encryption Enable) command 77
FP (Force Poll) command 78
FR (Software Reset) command 78
GT (Guard Times) command 78
HV (Hardware Version) command 78
IA (I/O Input Address) command 79
IC (DIO Change Detect) command 79
ID (Pan ID) command 79
IO (Digital Output Level) command 80
IR (Sample Rate) command 80
IS (Force Sample) command 80
IT (Samples before TX) command 81
IU (I/O Output Enable) command 81
KY (AES Encryption Key) command 82
M0 (PWM0 Output Level) command 82
M1 (PWM1 Output Level) command 83
MM (MAC Mode) command 83
MY (16-bit Source Address) command 84
NB (Parity) command 84
ND (Node Discover) command 85
NI (Node Identifier) command 86
NT (Node Discover Time) command 87
P0 (PWM0 Configuration) command 87
P1 (PWM1 Configuration) command 88
PL (Power Level) command 88
PR (Pull-up Resistor Enable) command 89
PT (PWM Output Timeout) command 90
XBee-PRO PKG-U® USB RF Modem
4
RE (Restore Defaults) command 90
RN (Random Delay Slots) command 90
RO (Packetization Timeout) command 91
RP (RSSI PWM Timer) command 91
RR (XBee Retries) command 92
SC (Scan Channels) command 92
SD (Scan Duration) command 93
SH (Serial Number High) command 94
SL (Serial Number Low) command 94
SM (Sleep Mode) command 94
SP (Cyclic Sleep Period) command 95
ST (Time before Sleep) command 96
T0 - T7 ((D0-D7) Output Timeout) command 96
VL (Firmware Version - Verbose) 96
VR (Firmware Version) command 97
WR (Write) command 97 API operation 97
API frame specifications 98
API types 99
Appendix A: agency certifications
FCC certification 104
OEM labeling requirements 104
FCC notices 104
FCC-approved antennas (2.4 ghz) 105 European certification 108
OEM labeling requirements 108
Declarations of conformity 108
Maximum power and frequency specifications 109 IC (Industry Canada) certification 109
Labeling requirements 109
Appendix B: Additional information
One-year warranty 111 Ordering Information 111
XBee-PRO PKG-U® USB RF Modem
5
XBee-PRO USB modem
The XBee-PRO RS-232 RF modem is an IEEE 802.15.4 compliant solution that features an RS-232 interface. Out-of-box, the modem is equipped to sustain outstanding range (2-3x the range of typical
802.15.4 solutions) and requires no additional configuration for immediate RF communications. Simply feed data into one modem, then the data is sent out the other end of the wireless link.
The modem transfers a standard asynchronous serial data stream between two or more devices. Its built-in RS-232 interface allows for rapid integration into existing data systems.
Features overview
Long-range data integrity
Range
n Indoor/Urban: up to 300; (100 m)
n Outdoor line-of-sight: up to one mile (1.6 km)
1. Transmit power: 60 mW (18 dBm), 100 mW (w0 dBm)
Receiver sensitivity: -100 dBM
RF Data rate: 250,000 bps
Advanced networking & security
n Retries and acknowledgements
n DSSS (Direct Sequence Spread Spectrum)
n Each direct sequence channels has over 65,000 unique network addresses available
n Source/destination addressing
XBee-PRO PKG-U® USB RF Modem
6
XBee-PRO USB modem Features overview
n Unicast and broadcast communications
n Point-to-point, point-to-multipoint and peer-to-peer topologies supported
n Coordinator/end device operations
n Transparent and API operations
n 128-bit encryption
Low power
Power currents
n Receive current: 90 mA (@9V)
n Transmit current: 300 mA
n Power-down current: < 25 mA
Easy-to-use
n No configuration necessary for out-of box RF communications.
n Free X-CTU software.
n (Testing and configuration software) built-in RS-232 interfacing.
n Small form factor.
n Network compatible with other 802.15.4 devices.
n AT and API command modes for configuring modem parameters.
Free and unlimited technical support.
Worldwide acceptance
n FCC approved (USA) refer to Appendix A [p56] for FCC requirements.
n Systems that include XBee®/XBee-PRO® RF modules inherit Digi certifications.
n ISM (industrial, scientific & medical) 2.4 GHz frequency band
n Manufactured under ISO 9001:2000 registered standards
XBee®/XBee-PRO® RF modules are optimized for use in the United States, Canada, Australia, Japan and Europe.
Visit www.digi.com for complete list of government agency approvals.
XBee-PRO PKG-U® USB RF Modem
7
XBee-PRO USB modem Specifications
Specifications
Specifications of the XBee-PRO RS-232 RF modem
Specification XBee-PRO
Performance
Indoor/urban range (w/2.1 dB dipole antenna) Up to 300’ (100 m)
Outdoor/urban range (w/2.1 dB dipole antenna) Up to 4000 ft (1200 m)
Transmit power output 60 mW, 100 mW (20 dBm)
1
EIRP
RF data rate 250,000 bps
Interface data rate 1200 bps - 115200 bps
(non-standard baud rates also supported
Receiver sensitivity -100 dBm (1% packet
error rate)
Networking and security
Operating frequency ISM 2.4 GHz
Modulation DSSS (direct sequence
spread spectrum)
Supported network topologies Point-to-point, point-to-
multipoint, peer-to-peer and mesh
Number of channels (software selectable) 12 direct sequence
channels
Addressing layers PAN ID, channel and
source/destination addresses
Antenna
Connector RPSMA (reverse polarity
SMA)
Impedance 50 ohms unbalanced
Power requirements
Power supply Powered through USB
port
Receive current 90 mA
1
See Appendix A: agency certifications for region‐specific certification requirements.
XBee-PRO PKG-U® USB RF Modem
8
XBee-PRO USB modem Specifications
Specification XBee-PRO
Transmit current 300 mA (Average current
when streaming data (@9600bps) = 92 mA)
Power-down current < 25 mA
Physical properties
Size 4.500” x 2.750” x 1.125”
(11.4cm x 7.0cm x 2.9cm)
Weight 5.25 oz. (150 g)
Data connection USB
Operating temperature 0 - 70º C (commercial)
Certifications (partial list)
United States (FCC Part 15.247) OUR-XBEEPRO
Industry Canada (IC) 4214A-XBEEPRO
Europe (CE) ETSI (Max. 10 mW
transmit power output)*
XBee-PRO PKG-U® USB RF Modem
9
XBee-PRO USB modem External interface
External interface
Front view
I/O & power LEDs
LEDs indicate RF modem activity as follows:
n Yellow (top LED) = serial data out (to host).
n Green (middle) = serial data In (from host).
n Red (bottom) = Power/association Indicator (refer to D5 (DIO5 Configuration) command).
RSSI LEDs
RSSI LEDs indicate the amount of fade margin present in an active wireless link. Fade margin is defined as the difference between the incoming signal strength and the modem's receiver sensitivity.
n 3 LEDs ON = very strong signal (> 30 dB fade margin)
n 2 LEDs ON = strong signal (> 20 dB fade margin)
n 1 LED ON = moderate signal (> 10 dB fade margin)
n 0 LED ON = weak Signal (< 10 dB fade margin)
XBee-PRO PKG-U® USB RF Modem
10
XBee-PRO USB modem External interface
Back view
USB port
Standard type-B USB connector is used to communicate with USBhost and power the RF modem.
DIP switch
DIP switch functions are not supported in this release. Future down- loadable firmware versions will support DIP switch configurations.
Reset swiitch
The Reset Switch is used to reset (re-boot) the RF modem.
Antenna port
Port is a 50Ω RF signal connector for connecting to an external antenna. The connector type is RPSMA (reverse polarity SMA) female. The connector has threads on the outside of a barrel and a male center conductor.
XBee-PRO PKG-U® USB RF Modem
11
Interfacing protocol
RS-232 operation
Pin signals
Pins used on the female RS-232 (DB-9) serial connector
DB-9 pin RS-232 name Description Implementation
1 DCD Data-carrier-detect Connected to DSR (pin6)
2 RXD Received data Serial data exiting the RF modem
3 TXD Transmitted data Serial data entering into the RF
4 DTR Data-terminal-ready Can enable power-down on the RF
5 GND Ground signal Ground
1
1Functions listed in the implementation column may not be available at the time of release.
XBee-PRO PKG-U® USB RF Modem
Pin assignments and implementations
1
(to host)
modem (from host)
modem
12
Interfacing protocol RS-232 operation
DB-9 pin RS-232 name Description Implementation
6 DSR Data-set-ready Connected to DCD (pin1)
7 RTS / CMD Request-to-
send/command mode
8 CTS Clear-to-send Provides CTS flow control
9 RI Ring indicator Optional power input that is
Wiring Diagrams
DTE RS-232 Device to a DCE RF Modem
RS-232 device (DTE-male connector) wired to an XBeee-PRO RF modem (DCE-female)
1
Provides RTS flow control or enables "command mode" on the RF modem Refer to Flow control and the D6
(DIO6 Configuration) command.
Refer to Flow control and D7 (DIO7
Configuration) command.
connected internally to the positive lead of the front power connector
DCE RF Modem to an DCE RS-232 Device
XBee‐PRO RF modem (DCE ‐female connector) wired to an RS‐232 device (DCE)
1
1Functions listed in the implementation column may not be available at the time of release.
XBee-PRO PKG-U® USB RF Modem
13
Interfacing protocol RS-232 operation
Sample wireless connection: DTE <--> DCE DCE <--> DCE
Typical wireless link between DTE and DCE devices
XBee-PRO PKG-U® USB RF Modem
14
RF modem operation
Serial Communications
RS-232 data flow
The XBee-PRO RS-232 RF modem interfaces to a host device through a standard RS-232 (DB-9) connector. Devices that have a standard RS-232 serial port can connect directly through the pins of the RF modem as shown in the following figure.
System data flow in an RS‐232 environment
Host and RF modem settings
Serial communications between a host and an XBee-PRO RF modem are dependent upon having matching baud rate, parity, stop bit & number of data bits settings. Refer to the table below to ensure host serial port settings match those of the XBee-PRO RF modem.
XBee-PRO PKG-U® USB RF Modem
Parameter values critical to serial communications
between the RF modem and host
Parameter setting Default parameter value
Baud (serial data rate) 9600 bps (BD parameter = 3)
Number of data bits 8
Parity None
Number of stop bits 1
15
RF modem operation Serial Communications
Both the XBee-PRO RF modem and host (PC) settings can be viewed and adjusted using Digi's proprietary X-CTU software. Use the PC settings tab to configure host settings. Use the terminal or
RF modem configuration tabs to configure the RF modem settings.
Note Failure to enter AT command mode is most commonly due to baud rate mismatch. Ensure the
baud setting on the PC settings tab matches the BD (interface data rate) setting of the RF modem
(by default, BD parameter = 3, which is associated to 9600 baud).
Transparent operation
By default, XBee-PRO RF modems operate in transparent mode. When operating in this mode, the modems act as a serial line replacement - all UART data received through the DI pin is queued up for RF transmission. When RF data is received, the data is sent out the DO pin.
Serial-to-RF packetization
Data is buffered in the DI buffer until one of the following causes the data to be packetized and transmitted:
1. No serial characters are received for the amount of time determined by the RO (packetization
timeout) parameter. If RO = 0, packetization begins when a character is received.
2. The maximum number of characters that will fit in an RF packet (100) is received.
3. The command mode sequence (GT + CC + GT) is received. Any character buffered in the DI
buffer before the sequence is transmitted.
If the modem cannot immediately transmit (for instance, if it is already receiving RF data), the serial data is stored in the DI buffer. The data is packetized and sent at any RO timeout or when 100 bytes (maximum packet size) are received.
If the DI buffer becomes full, hardware or software flow control must be implemented in order to prevent overflow (loss of data between the host and modem).
API operation
API (application programming interface) operation is an alternative to the default transparent operation. The frame-based API extends the level to which a host application can interact with the networking capabilities of the modem.
When in API mode, all data entering and leaving the modem is contained in frames that define operations or events within the modem.
Transmit data frames (received through the DI (Data In) pin) include:
n RF transmit data frame
n Command frame (equivalent to AT commands)
Receive data frames (sent out the data out) include:
n RF-received data frame
n Command response
n Event notifications such as reset, associate, disassociate, etc.
The API provides alternative means of configuring modems and routing data at the host application layer. A host application can send data frames to the modem that contain address and payload information instead of using command mode to modify addresses. The modem will send data frames
XBee-PRO PKG-U® USB RF Modem
16
RF modem operation Serial Communications
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 examples cited below:
n Transmitting data to multiple destinations without entering command mode.
n Receive success/failure status of each transmitted RF packet.
n Identify the source address of each received packet.
Flow control
Internal data flow diagram
DI (data In) buffer
When serial data enters the RF modem through the DI (Data In) pin, the data is stored in the DI Buffer until it can be processed.
Hardware flow control (CTS). When the DI buffer is 17 bytes away from being full; by default, the modem de-asserts CTS (high) to signal to the host device to stop sending data (refer to D7 (DIO7
Configuration) command. CTS is re-asserted after the DI Buffer has 34 bytes of memory available.
How to eliminate the need for flow control:
1. Send messages that are smaller than the DI buffer size.
2. Interface at a lower baud rate (BD (interface data rate) parameter] than the throughput data
rate.
Case in which the DI Buffer may become full and possibly overflow:
If the modem is receiving a continuous stream of RF data, any serial data that arrives on the DI pin is placed in the DI Buffer. The data in the DI buffer will be transmitted over-the-air when the modem is no longer receiving RF data in the network.
Refer to RO (Packetization Timeout) command, BD (Interface Data Rate) command, and D7 (DIO7
Configuration) command command descriptions for more information.
Refer to BD (Interface Data Rate) command and RO (Packetization Timeout) command command descriptions for more information.
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 RTS is enabled for flow control (D6 (DIO6 configuration) parameter =
1), data will not be sent out the DO buffer as long as RTS (DIO6) is de-asserted.
Two cases in which the DO buffer may become full and possibly overflow:
XBee-PRO PKG-U® USB RF Modem
17
RF modem operation Serial Communications
1. If the RF data rate is set higher than the interface data rate of the modem, the modem will
receive data from the transmitting modem faster than it can send the data to the host.
2. If the host does not allow the modem to transmit data out from the DO buffer because of being
held off by hardware or software flow control.
To implement API operations, refer to API operation.
IEEE 802.15.4 networks
The following IEEE 802.15.4 network types are available to the RF modem:
n NonBeacon
n NonBeacon (w/coordinator)
The following terms will be used to explicate the network system types:
Terms and definitions (Applicable networking network types are designated within <brackets>.)
Term Definition
Association <NonBeacon (w/coordinator) systems only>
The establishment of membership between end devices and a coordinator.
<NonBeacon (w/coordinator) systems only>
Coordinator
A central RF modem that is configured to provide synchronization services through the transmission of beacons.
End device When in the same network as a coordinator - RF modems 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.
NonBeacon
By default, XBee-PRO RF modems are configured to support NonBeacon communications (no coordinator). NonBeacon systems operate within a peer-to-peer network topology and are not dependent upon master/slave relationships. This means that modems remain synchronized without use of master/server configurations and each modem in the network shares both roles of master and slave. Digi's peer-to-peer architecture features fast synchronization times and fast cold start times. This default configuration accommodates a wide range of RF data applications.
NonBeacon peer-to-peer architecture
XBee-PRO PKG-U® USB RF Modem
18
RF modem operation Serial Communications
A peer-to-peer network can be established by configuring each modem to operate as an end device (CE = 0), disabling end device association on all modems (A1 = 0) and setting ID and CH parameters to be identical across the network.
NonBeacon (with coordinator)
A device is configured as a coordinator by setting the CE (Coordinator Enable) parameter to “1”. Coordinator power-up is governed by the A2 (Coordinator Association) command.
In a NonBeacon (w/coordinator) system, the coordinator can be configured to use direct or indirect transmissions. If the SP (Cyclic Sleep Period) parameter is set to “0," the coordinator sends data immediately. Otherwise, the SP parameter determines the length of time the coordinator will retain the data before discarding it. Generally, SP (Cyclic Sleep Period) and ST (Time before Sleep) parameters should be set to match the SP and ST settings of the end devices.
Association plays a critical role in the implementation of a NonBeacon (with coordinator) system. Refer to Association for more information.
Association
Association is the establishment of membership between end devices and a coordinator and is only applicable in NonBeacon (w/coordinator) networks. The establishment of membership is useful in scenarios that require a central unit (coordinator) to relay messages to or gather data from several remote units (end devices), assign channels or assign PAN IDs.
An RF data network that consists of one coordinator and one or more end devices forms a PAN (personal area network). Each device in a PAN has a PAN identifier [ID (PAN ID) parameter]. PAN IDs must be unique to prevent miscommunication between PANs. The coordinator PAN ID is set using the ID (PAN ID) and A2 (coordinator association) commands.
An end device can associate to a coordinator without knowing the address, PAN ID or channel of the coordinator. The A1 (End Device Association) parameter bit fields determine the flexibility of an end device during association. The A1 parameter can be used for an end device to dynamically set its destination address, PAN ID and/or channel.
For example: If the PAN ID of a coordinator is known, but the operating channel is not; the A1 command on the end device should be set to enable the Auto_Associate and Reassign_Channel bits. Additionally, the ID parameter should be set to match the PAN ID of the associated coordinator.
Coordinator/end device setup and operation
To configure a modem to operate as a coordinator, set the CE (Coordinator Enable) parameter to 1. Set the CE parameter of End Devices to 0 (default). Coordinator and end devices should contain
XBee-PRO PKG-U® USB RF Modem
19
RF modem operation Serial Communications
matching firmware versions.
NonBeacon (w/coordinator) systems
In a NonBeacon (w/coordinator) system, the coordinator can be configured to use direct or indirect transmissions. If the SP (Cyclic Sleep Period) parameter is set to 0,, the Coordinator will send data immediately. Otherwise, the SP parameter determines the length of time the Coordinator will retain the data before discarding it. Generally, SP (Cyclic Sleep Period) and ST (Time before Sleep) parameters should be set to match the SP and ST settings of the end devices.
Coordinator Power-up
Coordinator power-up is governed by the A2 (Coordinator Association) command. On power-up, the coordinator undergoes the following sequence of events:
1. Check A2 parameter- reassign_PANID flag
Set (bit 0 = 1) - The coordinator issues an active scan. The active scan selects one channel and
transmits a BeaconRequest command to the broadcast address (0xFFFF) and broadcast PAN
ID (0xFFFF). It then listens on that channel for beacons from any coordinator operating on that
channel. The listen time on each channel is determined by the SD (Scan Duration) parameter
value.
Once the time expires on that channel, the active scan selects another channel and again
transmits the BeaconRequest as before. This process continues until all channels have been
scanned, or until 5 PANs have been discovered. When the active scan is complete, the results
include a list of PAN IDs and channels that are being used by other PANs. This list is used to
assign an unique PAN ID to the new coordinator. The ID parameter will be retained if it is not
found in the active scan results. Otherwise, the ID (PAN ID) parameter setting will be updated
to a PAN ID that was not detected.
Not Set (bit 0 = 0) - The coordinator retains its ID setting. No active scan is performed.
2. Check A2 parameter - reassign_channel flag (bit 1)
Set (bit 1 = 1) - The coordinator issues an energy scan. The energy scan selects one channel
and scans for energy on that channel. The duration of the scan is specified by the SD (Scan
Duration) parameter. Once the scan is completed on a channel, the energy scan selects the
next channel and begins a new scan on that channel. This process continues until all channels
have been scanned.
When the energy scan is complete, the results include the maximal energy values detected on
each channel. This list is used to determine a channel where the least energy was detected. If
an active scan was performed (reassign_PANID flag set), the channels used by the detected
PANs are eliminated as possible channels. Thus, the results of the energy scan and the active
scan (if performed) are used to find the best channel (channel with the least energy that is not
used by any detected PAN). Once the best channel has been selected, the CH (Channel)
parameter value is updated to that channel.
Not set (bit 1 = 0) - The coordinator retains its CH setting. An energy scan is not performed.
XBee-PRO PKG-U® USB RF Modem
20
RF modem operation Serial Communications
3. Start coordinator
The coordinator starts on the specified channel (CH parameter) and PAN ID (ID parameter).
Note, these may be selected in steps 1 and/or 2 above. The coordinator will only allow end
devices to associate to it if the A2 parameter “AllowAssociation” flag is set. Once the
coordinator has successfully started, the Associate LED will blink one time per second. (The LED
is solid if the coordinator has not started.)
4. Coordinator modifications
Once a coordinator has started:
Modifying the A2 (Reassign_Channel or Reassign_PANID bits), ID, CH or MY parameters will
cause the coordinator’s MAC to reset (The coordinator RF modem (including volatile RAM) is
not reset). Changing the A2 AllowAssociation bit will not reset the coordinator’s MAC. In a non-
beaconing system, end devices that are associated to the coordinator prior to a MAC reset will
have knowledge of the new settings on the Coordinator. Thus, if the Coordinator were to
change its ID, CH or MY settings, the End Devices would no longer be able to communicate with
the non-beacon coordinator. Once a coordinator has started, the ID, CH, MY or A2 (Reassign_
Channel or Reassign_PANID bits) should not be changed.
End device power-up
End device power-up is governed by the A1 (End Device Association) command. On power-up, the end device undergoes the following sequence of events:
1. Check A1 parameter -11 AutoAssociate bit.
Set (bit 2 = 1) - End device will attempt to associate to a coordinator. (refer to steps 2-3).
Not Set (bit 2 = 0) - End device will not attempt to associate to a coordinator. The end device
will operate as specified by its ID, CH and MY parameters. Association is considered complete
and the Associate LED blinks quickly (5 times per second). When the AutoAssociate bit is not
set, the remaining steps (2-3) do not apply.
XBee-PRO PKG-U® USB RF Modem
21
RF modem operation Serial Communications
2. Discover coordinator (if AutoAssociate bit set).
The end device issues an active scan. The active scan selects one channel and transmits a
BeaconRequest command to the broadcast address (0xFFFF) and broadcast PAN ID (0xFFFF).
It then listens on that channel for beacons from any coordinator operating on that channel. The
listen time on each channel is determined by the SD parameter.
Once the time expires on that channel, the active scan selects another channel and again
transmits the BeaconRequest command as before. This process continues until all channels
have been scanned, or until 5 PANs have been discovered. When the active scan is complete,
the results include a list of PAN IDs and channels that are being used by detected PANs.
The end device selects a coordinator to associate with according to the A1 parameter
(Reassign_PANID) and (Reassign_Channel) flags:
Reassign_PANID Bit Set (bit 0 = 1)- end device can associate with a PAN with any ID value.
Reassign_PANID Bit Not Set (bit 0 = 0) - end device will only associate with a PAN whose ID
setting matches the ID setting of the end device.
Reassign_Channel bit set (bit 1 = 1) - end device can associate with a PAN with any CH
value.
Reassign_Channel bit not set (bit 1 = 0)- end device will only associate with a PAN whose
CH setting matches the CH setting of the end device.
After applying these filters to the discovered coordinators, if multiple candidate PANs exist, the
end device will select the PAN whose transmission link quality is the strongest. If no valid
coordinator is found, the end device will either go to sleep (as dictated by its SM (Sleep Mode)
parameter) or retry association.
Note An end device will also disqualify coordinators if they are not allowing association (A2 -
AllowAssociation bit); or, if the coordinator is not using the same NonBeacon scheme as the end device. (They must both be programmed with NonBeacon code.)
3. Associate to valid coordinator.
Once a valid coordinator is found (step 2), the End Device sends an AssociationRequest
message to the coordinator. It then waits for an AssociationConfirmation to be sent from the
coordinator. Once the confirmation is received, the end device is associated and the Associate
LED blinks rapidly (2 times per second). The LED is solid if the end device has not associated.
4. End device changes once an end device has associated.
Changing A1, ID or CH parameters will cause the end device to disassociate and restart the
association procedure.
If the end device fails to associate, the AI command can give some indication of the failure.
XBee-PRO PKG-U® USB RF Modem
22
RF modem operation Serial Communications
Addressing
Every RF data packet sent over-the-air contains a source address and destination address field in its header. The RF modem conforms to the 802.15.4 specification and supports both short 16-bit addresses and long 64-bit addresses. A unique 64-bit IEEE source address is assigned at the factory and can be read with the SL (Serial Number Low) and SH (Serial Number High) commands. Short addressing must be configured manually. A modem will use its unique 64-bit address as its source address if its MY (16-bit Source Address) value is 0xFFFF or 0xFFFE.
To send a packet to a specific modem using 64-bit addressing: set destination address (DL + DH) to match the source address (SL + SH) of the intended destination modem.
To send a packet to a specific modem using 16-bit addressing: Set DL (Destination Address Low) parameter to equal the MY parameter and set the DH (Destination Address High) parameter to 0.
Unicast mode
By default, the RF modem operates in Unicast node. Unicast mode is the only mode that supports retries. While in this mode, receiving modems send an ACK (acknowledgement) of RF packet reception to the transmitter. If the transmitting modem does not receive the ACK, it will re-send the packet up to three times or until the ACK is received.
Short 16-bit addresses
The modem can be configured to use short 16-bit addresses as the source address by setting (MY < 0xFFFE). Setting the DH parameter (DH = 0) will configure the destination address to be a short 16-bit address (if DL < 0xFFFE). For two modems to communicate using short addressing, the destination address of the transmitter modem must match the MY parameter of the receiver.
The following table shows a sample network configuration that would enable Unicast mode communications using short 16-bit addresses.
Sample Unicast network configuration
(using 16‐bit addressing)
Parameter RF modem 1 RF modem 2
MY (Source Address) 0x01 0x02
DH (Destination Address High) 0 0
DL (Destination Address Low) 0x02 0x01
Long 64-bit addresses
The RF modem’s serial number (SL parameter concatenated to the SH parameter) can be used as a 64-bit source address when the MY (16-bit Source Address) parameter is disabled. When the MY parameter is disabled (set MY = 0xFFFF or 0xFFFE), the modem’s source address is set to the 64-bit IEEE address stored in the SH and SL parameters.
When an end device associates to a coordinator, its MY parameter is set to 0xFFFE to enable 64- bit addressing. The 64-bit address of the modem is stored as SH and SL parameters. To send a packet to a specific modem, the destination address (DL + DH) on one modem must match the source address (SL + SH) of the other.
Broadcast mode
Any RF modem within range will accept a packet that contains a broadcast address. When configured to operate in Broadcast mode, receiving modems do not send ACKs (acknowledgements) and transmitting modems do not automatically re-send packets as is the case in Unicast mode.
XBee-PRO PKG-U® USB RF Modem
23
RF modem operation Serial Communications
To send a broadcast packet to all modems regardless of 16-bit or 64-bit addressing, set the destination addresses of all the modems as shown below.
Sample network configuration (All modems in the network):
n DL (Destination Low Address) = 0x0000FFFF
n DH (Destination High Address) = 0x00000000 (default value)
Note When programming the modem, parameters are entered in hexadecimal notation (without the
“0x” prefix). Leading zeros may be omitted.
Modes of operation
XBee-PRO RF modems operate in five modes.
Modes of operation
Idle mode
When not receiving or transmitting data, the RF modem is in idle mode. The modem shifts into the other modes of operation under the following conditions:
n Transmit mode (serial data is received in the DI buffer).
n Receive mode (valid RF data is received through the antenna).
n Sleep mode (sleep mode condition is met).
n Command mode (command mode sequence is issued).
Transmit/receive modes
RF data packets
Each transmitted data packet contains a source address and destination address field. The source address matches the address of the transmitting modem as specified by the MY (Source Address) parameter (if MY >= 0xFFFE), the SH (Serial Number High) parameter or the SL (Serial Number Low) parameter. The <Destination Address> field is created from the DH (Destination Address High) and DL (Destination Address Low) parameter values. The source address and/or destination address fields will either contain a 16-bit short or long 64-bit long address.
The RF data packet structure follows the 802.15.4 specification.
XBee-PRO PKG-U® USB RF Modem
24
RF modem operation Serial Communications
Refer to Addressing for more information.
Direct and indirect transmission
There are two methods to transmit data:
n Direct transmission - data is transmitted immediately to the destination address.
n Indirect transmission - A packet is retained for a period of time and is only transmitted after
the destination modem (source address = destination address) requests the data.
Indirect transmissions can only occur on a coordinator. Thus, if all nodes in a network are end devices, only direct transmissions will occur. Indirect transmissions are useful to ensure packet delivery to a sleeping node. The coordinator currently is able to retain up to two indirect messages.
Direct transmission
A NonBeaconing coordinator can be configured to use only direct transmission by setting the SP (Cyclic Sleep Period) parameter to 0. Also, a NonBeaconing coordinator using indirect transmissions will revert to direct transmission if it knows the destination modem is awake.
To enable this behavior, the ST (Time before Sleep) value of the coordinator must be set to match the ST value of the end device. Once the end device either transmits data to the coordinator or polls the coordinator for data, the coordinator uses direct transmission for all subsequent data transmissions to that modem address until ST time (or number of beacons) occurs with no activity (at which point it will revert to using indirect transmissions for that modem address). No activity means no transmission or reception of messages with a specific address. Global messages will not reset the ST timer.
Indirect transmission
To configure indirect transmissions in a PAN (personal area network), the SP (Cyclic Sleep Period) parameter value on the coordinator must be set to match the longest sleep value of any end device. The SP parameter represents time in NonBeacon systems and beacons in Beacon-enabled systems. The sleep period value on the coordinator determines how long (time or number of beacons) the coordinator will retain an indirect message before discarding it.
In NonBeacon networks, an end device must poll the coordinator once it wakes from sleep to determine if the coordinator has an indirect message for it. For cyclic sleep modes, this is done automatically every time the modem wakes (after SP time). For pin sleep modes, the A1 (End Device Association) parameter value must be set to enable coordinator polling on pin wake-up. Alternatively, an end device can use the FP (Force Poll) command to poll the coordinator as needed.
CCA (clear channel assessment)
Prior to transmitting a packet, a CCA (clear channel assessment) is performed on the channel to determine if the channel is available for transmission. The detected energy on the channel is compared with the CA (Clear Channel Assessment) parameter value. If the detected energy exceeds the CA parameter value, the packet is not transmitted.
Also, a delay is inserted before a transmission takes place. This delay is settable using the RN (Backoff Exponent) parameter. If RN is set to “0”, then there is no delay before the first CCA is performed. The RN parameter value is the equivalent of the “minBE” parameter in the 802.15.4 specification. The transmit sequence follows the 802.15.4 specification.
XBee-PRO PKG-U® USB RF Modem
25
RF modem operation Serial Communications
By default, the MM (MAC Mode) parameter = 0. On a CCA failure, the modem will attempt to re- send the packet up to two additional times.
When in Unicast packets with RR (Retries) = 0, the modem will execute two CCA retries. Broadcast packets always get two CCA retries.
Acknowledgment
If the transmission is not a broadcast message, the modem will expect to receive an acknowledgment from the destination node. If an acknowledgment is not received, the packet will be resent up to 3 more times. If the acknowledgment is not received after all transmissions, an ACK failure is recorded.
Sleep mode
Sleep modes enable the RF modem to enter states of low-power consumption when not in use. In order to enter sleep mode, one of the following conditions must be met (in addition to the modem having a non-zero SM parameter value):
n DTR (data terminal ready) is de-asserted.
n The modem is idle (no data transmission or reception) for the amount of time defined by the ST
(Time before Sleep) parameter. Note ST is only active when SM = 4-5.
Transition into sleep
Sleep mode setting
Pin hibernate (SM =1)De-assert
Pin Doze (SM = 2) De-assert
Cyclic Sleep (SM = 4 -
5)
mode
DTR (data terminal ready)
DTR (data terminal ready)
Automatic transition to sleep mode as defined by the SM (Sleep Mode) and ST (Time
before Sleep) parameters.
Sleep mode configurations
Transition out of sleep mode (wake)
Assert DTR Pin/host-
Assert DTR Pin/host-
Transition occurs after the cyclic sleep time interval elapses. The time interval is
defined by the SP (Cyclic Sleep Period) parameter.
Characteristics
controlled / NonBeacon systems only / lowest power
controlled / NonBeacon systems only / fastest wake­up
RF modem wakes in pre­determined time intervals to detect if RF data is present / When SM = 5, NonBeacon systems only
Related commands
(SM) < 6 mA
(SM) < 6 mA
(SM), SP,ST< 25 mA
Power consumption
when sleeping
XBee-PRO PKG-U® USB RF Modem
26
RF modem operation Serial Communications
The SM command is central to setting sleep mode configurations. By default, sleep modes are disabled (SM = 0) and the modem remains in idle/receive mode. When in this state, the modem is constantly ready to respond to serial or RF activity.
Higher voltages
Sleep mode current consumption is highly sensitive to voltage. Voltages above 3.0V will cause much higher current consumption.
Sample sleep mode currents
XBee
XBee-PRO
Vcc (V) SM=1 SM=2 SM=4,5 SM=1 SM=2 SM=4,5
2.8–3.0 <3 µA <35uA <34uA <4uA <34uA <34uA
3.1 8uA 37mA 36uA 12uA 39uA 37uA
3.2 32uA 48uA 49uA 45uA 60uA 55uA
3.3 101uA 83uA 100uA 130uA 115uA 120uA
3.4 255uA 170uA 240uA 310uA 260uA 290uA
Pin/Host-controlled sleep modes
The transient current when waking from pin sleep (SM = 1 or 2) does not exceed the idle current of the modem. The current ramps up exponentially to its idle current.
Pin hibernate (SM = 1)
n Pin/host-controlled
n Typical power-down current: < 6 mA
n Typical wake-up time: 10.2 msec
Pin hibernate mode minimizes quiescent power (power consumed when in a state of rest or inactivity). This mode is voltage level-activated; when DTR is de-asserted, the modem will finish any transmit, receive or association activities, enter idle mode and then enter a state of sleep. The modem will not respond to either serial or RF activity while in pin sleep.
To wake a sleeping modem operating in Pin Hibernate mode, assert DTR (data terminal ready). The modem will wake when DTR is asserted and is ready to transmit or receive when the CTS line is low. When waking the modem, the pin must be asserted at least two 'byte times' after CTS goes low. This assures that there is time for the data to enter the DI buffer.
Pin doze (SM = 2)
n Pin/host-controlled
n Typical power-down current: < 6 mA
n Typical wake-up time: 2.6 msec
Pin doze mode functions like does Pin Hibernate Mode; however, Pin Doze features faster wake-up time and higher power consumption.
To wake a sleeping modem operating in Pin Doze Mode, assert DTR (data terminal ready). The modem will wake when DTR is asserted and is ready to transmit or receive when the CTS line is low. When waking the modem, the pin must be asserted at least two 'byte times' after CTS goes low. This assures that there is time for the data to enter the DI buffer.
XBee-PRO PKG-U® USB RF Modem
27
RF modem operation Serial Communications
Cyclic sleep modes
Cyclic sleep remote (SM = 4)
n Typical power-down current: < 25 mA (when asleep)
n Typical wake-up time: 2.6 msec
The cyclic sleep modes allow modems to periodically check for RF data. When the SM parameter is set to ‘4’, the modem is configured to sleep, then wakes once a cycle to check for data from a modem configured as a cyclic sleep coordinator (SM = 0, CE = 1). The cyclic sleep remote sends a poll request to the coordinator at a specific interval set by the SP (Cyclic Sleep Period) parameter. The coordinator will transmit any queued data addressed to that specific remote upon receiving the poll request.
If no data is queued for the remote, the coordinator will not transmit and the remote will return to sleep for another cycle. If queued data is transmitted back to the remote, it will stay awake to allow for back and forth communication until the ST (Time before Sleep) timer expires.
Also note that CTS will go low each time the remote wakes, allowing for communication initiated by the remote host if desired.
Cyclic sleep remote with pin wake-up (SM = 5)
Use this mode to wake a sleeping remote modem through either the RF interface or by the assertion of DTR for event-driven communications. The cyclic sleep mode works as described above (cyclic sleep remote) with the addition of a pin-controlled wake-up at the remote modem. The DTR pin is edge­triggered, not level-triggered. The modem will wake when a low is detected then set CTS low as soon as it is ready to transmit or receive.
Any activity will reset the ST (Time before Sleep) timer so the modem will go back to sleep only after there is no activity for the duration of the timer. Once the module wakes (pin-controlled), further pin activity is ignored. The modem transitions back into sleep according to the ST time regardless of the state of the pin.
[Cyclic sleep coordinator (SM = 6)]
n Typical current = receive current
n Always awake
Note The SM=6 parameter value exists solely for backwards compatibility with firmware version
1.x60. If backwards compatibility with the older firmware version is not required, always use the CE (Coordinator Enable) command to configure a modem as a coordinator.
This mode configures a modem to wake cyclic sleeping remotes through RF interfacing. The coordinator will accept a message addressed to a specific remote 16 or 64-bit address and hold it in a buffer until the remote wakes and sends a poll request. Messages not sent directly (buffered and requested) are called indirect messages. The coordinator only queues one indirect message at a time. The coordinator will hold the indirect message for a period 2.5 times the sleeping period indicated by the SP (Cyclic Sleep Period) parameter. The coordinator's SP parameter should be set to match the value used by the remotes.
Command mode
To modify or read RF modem parameters, the modem must first enter into Command mode - a state in which incoming characters are interpreted as commands. Two command mode types are supported: AT command mode and API command mode.
AT command mode
To enter AT command mode:
XBee-PRO PKG-U® USB RF Modem
28
RF modem operation Serial Communications
Send the 3-character command sequence “+++” and observe guard times before and after the command characters.
Default AT Command Mode Sequence (for transition to Command mode):
n No characters sent for one second GT (Guard Times) parameter = 0x3E8.
n Input three plus characters (“+++”) within one second [CC (Command Sequence Character)
parameter = 0x2B.
n No characters sent for one second GT (Guard Times) parameter = 0x3E8.
All of the parameter values in the sequence can be modified to reflect user preferences.
Note Failure to enter AT Command mode is most commonly due to baud rate mismatch. Ensure the
baud setting on the PC Settings tab matches the interface data rate of the RF modem. By default,
the BD parameter = 3 (9600 bps).
To send AT commands:
Send AT commands and parameters using the syntax shown below.
Syntax for sending AT commands
To read a parameter value stored in the RF modem’s register, omit the parameter field.
The preceding example would change the RF modem destination address (Low) to “0x1F”. To store the new value to non-volatile (long term) memory, subsequently send the WR (Write) command.
For modified parameter values to persist in the modem’s registry after a reset, changes must be saved to non-volatile memory using the WR (Write) command. Otherwise, parameters are restored to previously saved values after the modem is reset.
System response
When a command is sent to the modem, the modem will parse and execute the command. Upon successful execution of a command, the modem returns an “OK” message. If execution of a command results in an error, the modem returns an “ERROR” message.
To exit AT Command mode:
1. Send the ATCN (Exit Command Mode) command (followed by a carriage return).
OR
2. If no valid AT commands are received within the time specified by CT (Command Mode
Timeout) Command, the RF modem automatically returns to Idle Mode.
For an example that illustrates programming the RF modem using AT commands, refer to RF modem
configuration.
XBee-PRO PKG-U® USB RF Modem
29
RF modem configuration
Programming the RF Modem
Refer to the Command mode section for more information about entering Command Mode, sending AT commands and exiting Command Mode. For information regarding modem programming using API Mode, refer to the API operation.
Programming Examples
Setup
The programming examples in this section require the installation of Digi's X-CTU software and an RS­232 connection to a PC.
1. Install Digi's X-CTU software to a PC by double-clicking the "setup_X-CTU.exe" file. (The file is
located on the Digi CD and under the Software section of the following web page:
www.maxstream.net/support/downloads.php. Refer to the the X-CTU software section for
more information.
2. Connect the RF modem to a PC using their respective serial ports.
3. Launch the X-CTU software and select the PC Settings tab. Verify the baud and parity settings
of the Com port match those of the RF modem.
Note Failure to enter AT Command mode is most commonly due to baud rate mismatch. Ensure the
baud setting on the PC Settings tab matches the interface data rate of the RF modem (by default, BD
parameter = 3 (which corresponds to 9600 bps)).
Sample configuration: modify RF modem destination address
Example: Utilize the X-CTU Terminal tab to change the RF modem's DL (Destination Address Low) parameter and save the new address to non-volatile memory.
After establishing a serial connection between the RF modem and a PC refer to the Setup section above, select the Terminal tab of the X-CTU software and enter the following command lines (CR stands for carriage return):
Method 1 (one line per command).
Send AT command System response
+++ OK <CR> (enter into Command mode)
XBee-PRO PKG-U® USB RF Modem
30
Loading...
+ 81 hidden pages