Rare Xbee S2 Datasheet PDF
Rare Xbee S2 Datasheet PDF
ZB RF Modules
User Guide
Date
Description
Various
Initial release and subsequent releases for various editorial updates and
technical content updates to keep current with product changes.
May 2015
Update the SMT dimensions drawing. Added a section on deep sleep and sleep
current measurements. Updated the baud rates supported by the BD
command. Updated the Brazil ANATEL certification information.
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
View the products warranty online: [Link]
Customer support
Telephone (8:00 am 5:00 pm CST):
US & Canada: 866.765.9885
Worldwide: 801.765.9885
Online: [Link]/support
Mail:
Digi International
11001 Bren Road East
Minnetonka, MN 55343
USA
Contents
Overview of the XBee ZigBee RF Module
Worldwide acceptance 9
Whats new in 40xx firmware 9
Specifications of the XBee ZigBee RF Module 10
Hardware specifications 10
Agency approvals 11
Serial communications specifications of the XBee ZigBee RF Module
UART 12
SPI 12
GPIO specifications 13
Hardware specifications for programmable variant 13
Mechanical drawings of the XBee ZigBee RF Modules 14
Pin signals for the XBee ZigBee Surface Mount Module 15
Pin signals for the XBee ZigBee through-hole Module 17
EM357 pin mappings 18
Design notes 19
Power supply design 19
Recommended pin connections 19
Board layout 19
Module operation for the Programmable Variant 24
XBee Programmable Bootloader 27
Overview 27
Bootloader software specifics 27
Bootloader menu commands 31
Firmware updates 32
Output file configuration 33
12
Module operation
Serial communications 34
UART data flow 34
SPI communications 35
Serial buffers 36
UART flow control 37
Break control 38
Serial interface protocols
Modes of operation 40
Idle Mode 40
Transmit Mode 40
Receive Mode 41
Command Mode 41
Sleep Mode 42
38
ZigBee networks
Introduction to ZigBee 43
ZigBee stack layers 43
ZigBee networking concepts 44
Device types 44
PAN ID 45
Operating channel 46
ZigBee application layers: in depth 46
Application Support Sublayer (APS) 46
Application profiles 46
ZigBee Coordinator operation 48
Forming a network 48
Channel selection 48
PAN ID selection 48
Security policy 48
Persistent data 48
XBee ZigBee Coordinator startup 49
Permit joining 50
Resetting the Coordinator 50
Leaving a network 50
Replacing a Coordinator (security disabled only) 51
Example: starting a Coordinator 52
Example: replacing a Coordinator (security disabled) 52
ZigBee Router operation 52
Discovering ZigBee networks 52
Joining a network 53
Authentication 53
Persistent data 53
ZB Router joining 53
Permit joining 54
Joining always enabled 54
Joining temporarily enabled 55
Router network connectivity 55
Leaving a network 56
Network Locator option 57
Resetting the Router 57
Example: joining a network 57
End Device operation 57
Discovering ZigBee networks 58
Joining a network 58
Parent child relationship 58
End Device capacity 58
Authentication 59
Persistent data 59
Orphan scans 59
ZigBee End Device joining 59
Parent Connectivity 60
Resetting the End Device 61
Leaving a network 61
Example: joining a network 61
ZigBee channel scanning 62
Managing multiple ZigBee networks 62
PAN ID filtering 62
Pre-configured security keys 62
Permit joining 62
Application messaging 63
82
ZigBee Security
Security modes 87
ZigBee security model 87
Network layer security 87
Frame counter 88
Message integrity code 88
Network layer encryption and decryption 88
Network key updates 89
APS layer security 89
Message integrity code 89
APS link keys 89
APS layer encryption and decryption 90
Network and APS layer encryption 90
Trust center 90
Forming and joining a secure network 90
Implementing security on the XBee 91
Enabling security 91
Setting the Network Security Key 91
Setting the APS Trust Center Link Key 91
Enabling APS encryption 92
Using a Trust Center 92
93
121
127
131
188
Agency certifications
Manufacturing information
Definitions
Definitions
226
Worldwide acceptance
FCC Approval (USA): Refer to Agency certifications on page 205 for FCC Requirements.
Systems that contain XBee/XBee-PRO ZB RF Modules inherit Digi Certifications
XBee/XBee-PRO ZB RF Modules are optimized for use in US, Canada, Australia, Europe (XBee only)
and Japan (XBee only). Contact Digi for a complete list of agency approvals
Six software images (Coordinator AT, Coordinator API, Router AT, Router API, End Device AT, and
End Device API) are combined into a single software
P3 (DOUT), P4 (DIN), D8 (SleepRq), and D9 (On-Sleep) are now available for I/O sampling
Both pull-up and pull-down resistors can now be applied to pins configured for inputs
A 5 second break will reset the XBee. Then it will boot with default baud settings into command
mode
BD range increased from 0-7 to 0-0x0A, and nonstandard baud rates are permitted, but not
guaranteed
TxOption 0x01 disables retries and route repair. RxOption 0x01 indicates the transmitter disabled
retries
Self addressed fragmentable messages now return the self-addressed Tx Status code (0x23)
instead of simply success (0x00)
XBee ZB
XBee-PRO ZB
Performance
Indoor/Urban Range
Outdoor RF line-of-sight
Range
Up to 2 miles (3200 m)
RF Data Rate
250,000 b/s
Receiver Sensitivity
-101 dBm
Power Requirements
Adjustable Power
Yes
Supply Voltage
2.1 - 3.6 V
2.7 - 3.6 V
2.2 - 3.6 V for Programmable Version
10
Specification
XBee ZB
Power-down Current
< 1 A @ 25C
XBee-PRO ZB
31mA
General
Operating Frequency Band
Form Factor
Dimensions
Operating Temperature
Antenna Options
Number of Channels
Interface Immunity
Channels
11 to 26
Addressing Options
Interface Options
UART
SPI
Agency approvals
The following table provides the agency approvals for the Module.
Note Legacy XBee-PRO SMT (Model: PRO S2C; hardware version 21xx) has different FCC and IC IDs;
see Agency certifications on page 205.
XBee
(Surface Mount)
XBee-PRO
(Surface Mount)
XBee
(Through-hole)
XBee-PRO
(Through-hole)
Industry Canada
(IC)
IC: 1846A-XBS2C
IC: 1846A-PS2CSM
IC: 1846A-S2CTH
IC: 1846A-PS2CTH
Approval
11
XBee
(Surface Mount)
XBee-PRO
(Surface Mount)
XBee
(Through-hole)
XBee-PRO
(Through-hole)
FCC/IC Test
Transmit Power
Output range
-26 to +8 dBm
-26 to +8 dBm
+1 to +19 dBm
Europe (CE)
ETSI
Australia
C-Tick
Japan
R201WW10215369
ANATEL: 0616-151209
RoHS
Compliant
Approval
ETSI
RCM
RCM
RCM
Pending
ANATEL: 1533-151209
UART
The SC1 (Serial Communication Port 1) of the Ember 357 is connected to the UART port. The following
table provides the UART pin assignments.
Specifications
UART Pins
XBee (Through-hole)
DOUT
DIN / CONFIG
CTS / DIO7
25
12
RTS / DIO6
29
16
More information on UART operation is found in the UART section in Module operation on page 34.
SPI
The SC2 (Serial Communication Port 2) of the Ember 357 is connected to the SPI port.
Specifications
SPI Pins
XBee (Through-hole)
SPI_SCLK
14
18
SPI_SSEL
15
17
SPI_MOSI
16
11
SPI_MISO
17
For more information on SPI operation, see the SPI section in Module operation on page 34.
12
GPIO specifications
GPIO specifications
XBee RF modules have 15 General Purpose Input / Output (GPIO) ports available. The exact list will
depend on the module configuration, as some GPIO pads are used for purposes such as serial
communication.
See Enabling GPIO 1 and 2 on page 203 for more information on configuring and using GPIO ports.
GPIO Electrical Specification
Value
Voltage - Supply
2.1 - 3.6 V
-0.5 A
0.5 A
29 k
29 k
Output source/sink current for pad numbers 3, 4, 5, 10, 12, 14, 15, 16, 17, 25, 26, 28,
29, 30, and 32 on the SMT modules
4 mA
Output source/sink current for pin numbers 2, 3, 4, 9, 12, 13, 15, 16, 17, and 19 on the
TH modules
4 mA
Output source/sink current for pad numbers 7, 8, 24, 31, and 33 on the SMT modules
8 mA
Output source/sink current for pin numbers 6, 7, 11, 18, and 20 on the TH modules
8 mA
40 mA
+14mA
+1mA
Sleep current
+0.5A typical
MC9SO8QE32
+26S
VREF Range
1.8VDC to VCC
13
The following mechanical drawings of the XBee/XBee-PRO ZB RF Modules show all dimensions in
inches. The first drawing shows the SMT model (antenna options not shown).
3,1
0$;,080
120,1$/
3,1
,1&/8'(6/$%(/
7239,(:
6,'(9,(:
%277209,(:
3,1
3,1
3,1
5360$
8)/
XBee/XBee-PRO ZB RF Modules User Guide
:,5(:+,3
3&%$17(11$
14
3,1
3,1
3,1
5360$
3&%$17(11$
:,5(:+,3
8)/
Name
Direction
Default State
GND
Ground
VCC
Power Supply
DOUT / DIO13
Both
Output
Both
Input
DIO12
Both
GPIO
RESET
Input
Module Reset
Both
Output
PWM1 / DIO11
Both
Disabled
[reserved]
Disabled
Do Not Connect
10
Both
Input
11
GND
Description
15
Pin #
Name
Direction
Default State
Description
12
Output
Output
13
GND
14
SPI_CLK / DIO18
Input
Input
15
SPI_SSEL / DIO 17
Input
Input
16
SPI_MOSI / DIO16
Input
Input
17
SPI_MISO / DIO15
Output
Output
18
[reserved]*
Disabled
Do Not Connect
19
[reserved]*
Disabled
Do Not Connect
20
[reserved]*
Disabled
Do Not Connect
21
[reserved]*
Disabled
Do Not Connect
22
GND
23
[reserved]
Disabled
Do Not Connect
24
DIO4
Both
Disabled
GPIO
25
CTS / DIO7
Both
Output
26
ON / SLEEP / DIO9
Both
Output
Ground
27
VREF
Input
28
ASSOCIATE / DIO5
Both
Output
29
RTS / DIO6
Both
Input
30
AD3 / DIO3
Both
Disabled
31
AD2 / DIO2
Both
Disabled
32
AD1 / DIO1
Both
Disabled
33
AD0 / DIO0
Both
Input
34
[reserved]
Disabled
35
GND
Ground
36
RF
Both
16
Pin #
Name
Direction
Default State
37
[reserved]
Disabled
Description
Do Not Connect
Name
Direction
Default State
Description
VCC
Power Supply
DOUT / DIO13
Both
Output
Both
Input
UART Data In
DIO12 / SPI_MISO
Both
Disabled
RESET
Input
Input
Module Reset
Both
Output
PWM1 / DIO11
Both
Disabled
GPIO
[reserved]
Do Not Connect
Both
Input
10
GND
Ground
11
SPI_MOSI / DIO4
Both
Disabled
12
CTS / DIO7
Both
Output
13
ON_SLEEP / DIO9
Both
Output
14
VREF
Not connected
15
ASSOCIATE / DIO5
Both
Output
16
RTS / DIO6
Both
Input
17
Both
Disabled
18
Both
Disabled
19
Both
Disabled
20
AD0 / DIO0 / CB
Both
Disabled
17
Other Usage
12
RST
18
PA7
19
PB3
29
16
20
PB4
25
12
21
PA0 / SC2MOSI
16
11
22
PA1 / SC2MISO
17
24
PA2 / SC2SCLK
14
18
25
PA3 / SC2SSEL
15
17
26
PA4 / PTI_EN
32
19
27
PA5 / PTI_DATA /
BOOTMODE
12
NA
29
PA6
30
PB1 / SC1TXD
31
PB2 / SC1RXD
33
26
13
34
PC3 / JTDI
28
15
35
36
PB0
10
38
PC1 / ADC3
30
17
41
PB7 / ADC2
31
18
42
PB6 / ADC1
33
20
43
PB5 / ADC0
Programming
18
Design notes
Design notes
The XBee modules do not specifically require any external circuitry or specific connections for proper
operation. However, there are some general design guidelines that are recommended for help in
troubleshooting and building a robust design.
Board layout
XBee modules are designed to be self sufficient and have minimal sensitivity to nearby processors,
crystals or other PCB components. As with all PCB designs, Power and Ground traces should be
thicker than signal traces and able to comfortably support the maximum current specifications. A
recommended PCB footprint for the module can be found in Manufacturing information on
page 223. No other special PCB design considerations are required for integrating XBee radios except
in the antenna section.
The choice of antenna and antenna location is very important for correct performance. With the
exception of the RF Pad variant, XBees do not require additional ground planes on the host PCB. In
general, antenna elements radiate perpendicular to the direction they point. Thus a vertical antenna
XBee/XBee-PRO ZB RF Modules User Guide
19
Design notes
emits across the horizon. Metal objects near the antenna cause reflections and may reduce the ability
for an antenna to radiate efficiently. Metal objects between the transmitter and receiver can also
block the radiation path or reduce the transmission distance, so external antennas should be
positioned away from them as much as possible. Some objects that are often overlooked are metal
poles, metal studs or beams in structures, concrete (it is usually reinforced with metal rods), metal
enclosures, vehicles, elevators, ventilation ducts, refrigerators, microwave ovens, batteries, and tall
electrolytic capacitors.
20
Design notes
21
Design notes
TH keepout area
22
Design notes
23
24
The following figure shows the programmable connections for the SMT.
25
The following illustration shows the programmable connections for the TH Module.
26
27
Bootloader operation
Upon reset of any kind, the execution control begins with the bootloader.
If the reset cause is Power-On reset (POR), Pin reset (PIN), or Low Voltage Detect (LVD) reset (LVD) the
bootloader will not jump to the application code if the override bits are set to RTS(D7)=1, DTR(D5)=0,
and DIN(B0)=0. Otherwise, the bootloader writes the reset cause NOTHING to the shared data
region, and jumps to the Application.
Reset causes are defined in the file common. h in an enumeration with the following definitions:
typedef enum {
BL_CAUSE_NOTHING
= 0x0000, //PIN, LVD, POR
BL_CAUSE_NOTHING_COUNT
= 0x0001,//BL_Reset_Cause counter
// Bootloader increments cause every reset
BL_CAUSE_BAD_APP
= 0x0010,//Bootloader considers APP invalid
} BL_RESET_CAUSES;
typedef enum {
APP_CAUSE_NOTHING
= 0x0000,
APP_CAUSE_USE001
= 0x0001,
// 0x0000 to 0x00FF are considered valid for APP use.
APP_CAUSE_USE255
= 0x00FF,
APP_CAUSE_FIRMWARE_UPDATE = 0x5981,
APP_CAUSE_BYPASS_MODE
= 0x4682,
APP_CAUSE_BOOTLOADER_MENU = 0x6A18,
} APP_RESET_CAUSES;
Otherwise, if the reset cause is a "watchdog" or other reset, the bootloader checks the shared
memory region for the APP_RESET_CAUSE. If the reset cause is:
1. APP_CAUSE_NOTHING" or 0x0000 to 0x00FF, the bootloader increments the BL_RESET_CAUSES,
verifies that it is still less than BL_CAUSE_BAD_APP, and jumps back to the application. If the
Application does not clear the BL_RESET_CAUSE, it can prevent an infinite loop of running a bad
application that continues to perform illegal instructions or watchdog resets.
2. APP_CAUSE_FIRMWARE_UPDATE", the bootloader has been instructed to update the application
over-the-air from a specific 64-bit address. In this case, the bootloader will attempt to initiate an
Xmodem transfer from the 64-bit address located in shared RAM.
3. APP_CAUSE_BYPASS_MODE, the bootloader executes bypass mode. This mode passes the local
UART data directly to the EM357 allowing for direct communication with the EM357. The only way
to exit bypass mode is to reset or power cycle the module.
If none of the above is true, the bootloader will enter Command mode. In this mode, users can
initiate firmware downloads both wired and over-the-air, check application/bootloader version
strings, and enter Bypass mode.
28
reset vector. The version string pointer and reset vector are used to determine if the application is
valid.
29
30
Bypass mode - B
The bootloader provides a bypass mode of operation that essentially connects the SCI1 serial
communications peripheral of the Freescale mcu to the EM357's serial UART channel. This allows
direct communication to the EM357 radio for the purpose of firmware and radio configuration
changes. Once in bypass mode, the XCTU utility can change modem configuration and/or update
EM357 firmware. Bypass mode automatically handles any baud rate up to 115.2kbps. Note that this
command is unavailable when module is accessed remotely.
Update firmware - F
The F command initiates a firmware download for both wired and over-the-air configurations.
Depending on the source of the command (received via Over the Air or local UART), the download will
proceed via wired or over-the-air respectively.
31
Firmware updates
Wired Updates
A user can update their application using the bootloader in a wired configuration with the following
steps:
1. Plug XBee programmable module into a suitable serial port on a PC.
2. Open a hyperterminal (or similar dumb terminal application) session with 115200 baud, no parity,
and 8 data bits with one stop bit.
3. Press Enter to display the bootloader menu.
4. Press the F key to initiate a wired firmware update.
5. A series of C characters Will be displayed within the hyperterminal window. At this point, select
the transfer->send file menu item. Select the desired flat binary output file.
6. Select Xmodem as the protocol.
7. Click Send on the Send File dialog. The file will be downloaded to the XBee Programmable
module. Upon a successful update, the bootloader will jump to the newly loaded application.
Over-the-air updates
A user can update their application using the bootloader in an over-the-air configuration with the
following stepsisters procedure assumes that the bootloader is running and not the application. The
EM357 baud rate of the programmable module must be set to 115200 baud. The
bootloader only operates at 115200 baud between the Radio and programmable bootloader. The
application must be programmed with some way to support returning to the bootloader in order to
support Over the Air (OTA) updates without local intervention.)
1. The XBee module sending the file OTA (Host module) should be set up with a series 2 XBee
module with transparent mode firmware.
2. The XBee Programmable module receiving the update (remote module) is configured with API
firmware.
3. Open a hyperterminal session to the host module with no parity, no hardware-flow control, 8 data
bits and 1 stop bit. (The host module does not have to operate at the same baud rate as the
remote module.) For faster updates and less latency due to the UART, set the host module to a
faster baud rate. (i.e. 115200)
4. Enter 3 pluses +++ to place the EM357 in command mode. (or XCTUs Modem Configuration tab
can be used to set the correct parameters)
5. Set the Host Module destination address to the target modules 64 bit address that the host
module will update (ATDH aabbccdd, ATDL eeffgghh, ATCN, where aabbccddeeffgghh is the
hexadecimal 64 bit address of the target module).
6. Press Enter and the bootloader command menu will be displayed from the remote module.
Option 2 does not exist for OTA.
7. Press the F key to cause the remote module to request the new firmware file over-the-air.
8. The host module will begin receiving C characters indicating that the remote module is
requesting an Xmodem CRC transfer. Using XCTU or another terminal program, select XMODEM
file transfer. Select the Binary file to upload/transfer. Click Send to start the transfer. At the conconclusion of a successful transfer, the bootloader will jump to the newly loaded application.
XBee/XBee-PRO ZB RF Modules User Guide
32
Bootloader updates
The supplied bootloader requires files in a flat binary format which differs from the default ABS file
produced. The Codewarrior tool also produces a S19 output file. In order to successfully flash new
applications, the S19 file must be converted into the flat binary format. Utilities are available on the
web that will convert S19 output to BIN outputs. Often times, the BIN file conversion will pad the
addresses from 0x0000 to the code space with the same number. (Often 0x00 or 0xFF) These extra
bytes before the APP code starts will need to be deleted from the bin file before the file can be
transferred to the bootloader.
33
Module operation
Serial communications
XBee RF Modules interface to a host device through a serial port. Through its serial port, the module
can communicate with any logic and voltage compatible UART, through a level translator to any serial
device (for example, through a RS-232 or USB interface board), or through a Serial Peripheral
Interface, which is a synchronous interface to be described later.
Two Wire serial Interface (TWI) is also available, but not supported by Digi. For information on the
TWI, see the EM357 specification.
Serial data
Data enters the module UART through the DIN (pin 4) as an asynchronous serial signal. The signal
should idle high when no data is being transmitted.
Each data byte consists of a start bit (low), 8 data bits (least significant bit first) and a stop bit (high).
The following figure illustrates the serial bit pattern of data passing through the module.
34
Serial communications
UART data packet 0x1F (decimal number 31) as transmitted through the RF module
Example Data Format is 8-N-1 (bits - parity - # of stop bits)
Serial communications depend on the two UARTs (the microcontroller's and the RF module's) to be
configured with compatible settings (baud rate, parity, start bits, stop bits, data bits).
The UART baud rate, parity, and stop bits settings on the XBee module can be configured with the BD,
NB, and SB commands respectively. See Serial interfacing (I/O) commands on page 188 for details.
SPI communications
The XBee modules support SPI communications in slave mode. Slave mode receives the clock signal
and data from the master and returns data to the master. The SPI port uses the following signals on
the XBee:
SPI_MOSI (Master Out, Slave In) - inputs serial data from the master
SPI_MISO (Master In, Slave Out) - outputs serial data to the master
The above four pins are standard for SPI. This module also supports an additional pin, which may be
configured to alert the SPI master when it has data to send. This pin is called SPI_ATTN. If the master
monitors this pin (through polling or interrupts), it can know when it needs to receive data from the
module. SPI_ATTN asserts whenever it has data to send and it remains asserted until all available
data has been shifted out to the SPI master.
In this mode, the following apply:
The following illustration shows the frame format for SPI communications.
35
Serial communications
SPI operation
When the slave select (SPI_SSEL) signal is asserted by the master, SPI transmit data is driven to the
output pin (SPI_MISO), and SPI data is received from the input pin SPI_MOSI. The SPI_SSEL pin has to
be asserted to enable the transmit serializer to drive data to the output signal SPI_MISO. A rising edge
on SPI_SSEL resets the SPI slave shift registers.
If the SPI_SCLK is present, the SPI_MISO line is always driven whether with or without the SPI_SSEL
line driven. This is a known issue with the Ember EM357 chip, and makes additional hardware
necessary if multiple slaves are using the same bus as the XBee.
If the input buffer is empty, the SPI serializer transmits a busy token (0xFF). Otherwise, all
transactions on the SPI port use API operation. See ZigBee API Operation on page 133 for more
information.
The SPI slave controller must guarantee that there is time to move new transmit data from the
transmit buffer into the hardware serializer. To provide sufficient time, the SPI slave controller inserts
a byte of padding at the start of every new string of transmit data. Whenever the transmit buffer is
empty and data is placed into the transmit buffer, the SPI hardware inserts a byte of padding onto
the front of the transmission as if this byte were placed there by software.
Serial buffers
The XBee modules maintain small buffers to collect received serial and RF data, which is illustrated in
the figure below. The serial receive buffer collects incoming serial characters and holds them until
they can be processed. The serial transmit buffer collects data that is received via the RF link that will
be transmitted out the UART or SPI port. The following figure shows an internal data flow diagram.
DIN
Serial
Receiver
Buffer
RF TX
Buffer
Transmitter
RF Switch
CTS
Antenna
Port
Processor
DOUT
Serial Transmit
Buffer
RF RX
Buffer
Receiver
RTS
36
Serial communications
37
Serial communications
Note
If the XBee is sending data out the UART when RTS is de-asserted (set high), the XBee could
send up to 5 characters out the UART or SPI port after RTS is de-asserted.
Break control
If break is enabled for over five seconds, the XBee will reset. Then it will boot with default baud
settings into command mode.
This break function will be disabled if either P3 or P4 are not enabled.
Transparent operation
When operating in transparent mode, the modules act as a serial line replacement. All UART or SPI
data received through the DIN or MOSI pin is queued up for RF transmission. When RF data is
received, the data is sent out through the serial port. The module configuration parameters are
configured using the AT command mode interface. Note that transparent operation is not provided
when using the SPI.
Data is buffered in the serial receive buffer until one of the following causes the data to be
packetized and transmitted:
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.
The Command Mode Sequence (GT + CC + GT) is received. Any character buffered in the serial
receive buffer before the sequence is transmitted.
API operation
API operation is an alternative to transparent operation. 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 module is contained in frames that define operations or
events within the module.
Transmit Data Frames (received through the serial port) include:
Command response
The API provides alternative means of configuring modules and routing data at the host application
layer. A host application can send data frames to the module that contain address and payload
information instead of using command mode to modify addresses. The module will send data frames
to the application containing status packets; as well as source, and payload information from
received data packets.
38
Serial communications
The API operation option facilitates many operations such as the examples cited below:
All received serial data is transmitted unless the module is in command mode.
Easy to support
Transmitting RF data to multiple remotes only requires changing the address in the API
frame. This process is much faster than in transparent operation where the application
must enter AT command mode, change the address, exit command mode, and then
transmit data.
Each API transmission can return a transmit status frame indicating the success or
reason for failure.
Advanced ZigBee
addressing support
API transmit and receive frames can expose ZigBee addressing fields including source
and destination endpoints, cluster ID and profile ID. This makes it easy to support ZDO
commands and public profile traffic.
Advanced networking
diagnostics
API frames can provide indication of IO samples from remote devices, and node
identification messages.
Remote Configuration Set / read configuration commands can be sent to remote devices to configure them as
needed using the API.
Generally, API mode is recommended when a device:
receives RF data packets from multiple devices, and the application needs to know which device
sent which packet
must support multiple ZigBee endpoints, cluster IDs, and/or profile IDs
39
Modes of operation
If the above conditions do not apply (e.g. a sensor node, router, or a simple application), then
transparent operation might be suitable. It is acceptable to use a mixture of devices running API
mode and transparent mode in a network.
Modes of operation
Idle Mode
When not receiving or transmitting data, the RF module is in Idle Mode. The module shifts into the
other modes of operation under the following conditions:
Transmit Mode (Serial data in the serial receive buffer is ready to be packetized)
Command Mode (Command Mode Sequence is issued, not available with Smart Energy software
or when using the SPI port)
Transmit Mode
When serial data is received and is ready for packetization, the RF module will exit Idle Mode and
attempt to transmit the data. The destination address determines which node(s) will receive the data.
Prior to transmitting the data, the module ensures that a 16-bit network address and route to the
destination node have been established.
If the destination 16-bit network address is not known, network address discovery will take place. If a
route is not known, route discovery will take place for the purpose of establishing a route to the
destination node. If a module with a matching network address is not discovered, the packet is
discarded. The data will be transmitted once a route is established. If route discovery fails to
establish a route, the packet will be discarded. The following figure shows the Transmit Mode
sequence.
Successful
Transmission
Idle Mode
New
Transmission
16-bit Network
Address Known?
Route Known?
16-bit Network
Address Discovery
No
Transmit Data
No
No
16-bit Network
Address Discovered?
Yes
Yes
Route Discovery
Yes
Route Discovered?
Yes
No
Data Discarded
40
Modes of operation
When data is transmitted from one node to another, a network-level acknowledgment is transmitted
back across the established route to the source node. This acknowledgment packet indicates to the
source node that the data packet was received by the destination node. If a network
acknowledgment is not received, the source node will re-transmit the data.
It is possible in rare circumstances for the destination to receive a data packet, but for the source to
not receive the network acknowledgment. In this case, the source will retransmit the data, which
could cause the destination to receive the same data packet multiple times. The XBee modules do
not filter out duplicate packets. The application should include provisions to address this potential
issue
See Transmission, addressing, and routing on page 64 for more information.
Receive Mode
If a valid RF packet is received, the data is transferred to the serial transmit buffer.
Command Mode
To modify or read RF Module parameters, the module must first enter into Command Mode - a state
in which incoming serial characters are interpreted as commands. Command Mode is only available
over the UART when not using the Smart Energy firmware. ZigBee API Operation on page 133
describes an alternate means for configuring modules which is available with the SPI and with Smart
Energy, as well as over the UART with ZB code.
AT Command Mode
To Enter AT Command Mode:
Send the 3-character command sequence +++ and observe guard times before and after the
command characters. [Refer to the Default AT Command Mode Sequence below.]
Default AT Command Mode Sequence (for transition to Command Mode):
No characters sent for one second [GT (Guard Times) parameter = 0x3E8]
Input three plus characters (+++) within one second [CC (Command Sequence Character)
parameter = 0x2B.]
No characters sent for one second [GT (Guard Times) parameter = 0x3E8]
Once the AT command mode sequence has been issued, the module sends an OK\r out the UART
pad. The OK\r characters can be delayed if the module has not finished transmitting received serial
data.
When command mode has been entered, the command mode timer is started (CT command), and
the module is able to receive AT commands on the UART port.
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. By default,
the BD (Baud Rate) parameter = 3 (9600 b/s).
To send AT commands:
Send AT commands and parameters using the syntax shown below.
41
Modes of operation
AT
Prefix
ASCII
Space
Parameter
Command (optional) (optional, HEX)
Carriage
Return
Sleep Mode
Sleep modes allow the RF module to enter states of low power consumption when not in use. XBee
RF modules support both pin sleep (sleep mode entered on pin transition) and cyclic sleep (module
sleeps for a fixed time). XBee sleep modes are discussed in detail in Managing End Devices on
page 110.
42
ZigBee networks
Introduction to ZigBee
ZigBee is an open global standard built on the IEEE 802.15.4 MAC/PHY. ZigBee defines a network layer
above the 802.15.4 layers to support advanced mesh routing capabilities. The ZigBee specification is
developed by a growing consortium of companies that make up the ZigBee Alliance. The Alliance is
made up of over 300 members, including semiconductor, module, stack, and software developers.
43
Description
PHY
Defines the physical operation of the ZigBee device including receive sensitivity, channel
rejection, output power, number of channels, chip modulation, and transmission rate
specifications. Most ZigBee applications operate on the 2.4 GHz ISM band at a 250kb/s data
rate. See the IEEE 802.15.4 specification for details.
MAC
Manages RF data transactions between neighboring devices (point to point). The MAC includes
services such as transmission retry and acknowledgment management, and collision
avoidance techniques (CSMA-CA).
Network
Adds routing capabilities that allows RF data packets to traverse multiple devices (multiple
"hops") to route data from source to destination (peer to peer).
APS (AF)
Application layer that defines various addressing objects including profiles, clusters, and
endpoints.
ZDO
Application layer that provides device and service discovery features and advanced network
management capabilities.
Selects a channel and PAN ID (both 64-bit and 16-bit) to start the network
Must join a ZigBee PAN before it can transmit, receive, or route data
After joining, can allow routers and end devices to join the network
Must always transmit and receive RF data through its parent, and cannot route data
Can enter low power modes to conserve power and can be battery-powered
44
In ZigBee networks, the coordinator must select a PAN ID (64-bit and 16-bit) and channel to start a
network. After that, it behaves essentially like a router. The coordinator and routers can allow other
devices to join the network and can route data.
After an end device joins a router or coordinator, it must be able to transmit or receive RF data
through that router or coordinator. The router or coordinator that allowed an end device to join
becomes the parent of the end device. Since the end device can sleep, the parent must be able to
buffer or retain incoming data packets destined for the end device until the end device is able to
wake and receive the data.
A module can only operate as one of the three device types. The device type is selected by
configuration rather than by firmware image as was the case on earlier hardware platforms.
By default, the module operates as a router in transparent mode. To select coordinator operation, set
CE to 1. To select end device operation, set SM to a non-zero value. To select router operation, both
CE and SM must be 0.
One complication is that if a device is a coordinator and it needs to be changed into an end device, CE
must be set back to 0 first. If not, the SM configuration will conflict with the CE configuration.
Likewise, to change an end device into a coordinator, it must be changed into a router first.
Another complication is that default parameters for a router build don't always work very well for a
coordinator build. For example:
DH/DL is 0 by default, which allows routers and end devices to send data to the coordinator when
they first come up. If DH/DL is not changed from the default value when the device is changed to a
coordinator, then the device will send data to itself, causing characters to be echoed back to the
screen as they are typed. Since this is probably not the desired operation, DH/DL should be set to the
broadcast address or some specific unicast address when the device is changed to a coordinator.
Another example is EO for smart energy builds. This value should be 08 for routers and end devices
and it should be 02 for the coordinator to designate it as the trust center. Therefore, if using
authentication, which is the normal case for Smart Energy builds, EO should be changed from 02 to
08 when CE is set to 1.
In general, when changing device types, it is the user's responsibility to ensure that parameters are
set to be compatible with the new device type.
PAN ID
ZigBee networks are called personal area networks or PANs. Each network is defined with a unique
PAN identifier (PAN ID). This identifier is common among all devices of the same network. ZigBee
devices are either preconfigured with a PAN ID to join, or they can discover nearby networks and
select a PAN ID to join.
ZigBee supports both a 64-bit and a 16-bit PAN ID. Both PAN IDs are used to uniquely identify a
network. Devices on the same ZigBee network must share the same 64-bit and 16-bit PAN IDs. If
multiple ZigBee networks are operating within range of each other, each should have unique PAN
IDs.
XBee/XBee-PRO ZB RF Modules User Guide
45
The 16-bit PAN ID is used as a MAC layer addressing field in all RF data transmissions between devices
in a network. However, due to the limited addressing space of the 16-bit PAN ID (65,535 possibilities),
there is a possibility that multiple ZigBee networks (within range of each other) could use the same
16-bit PAN ID. To resolve potential 16-bit PAN ID conflicts, the ZigBee Alliance created a 64-bit PAN ID.
The 64-bit PAN ID (also called the extended PAN ID), is intended to be a unique, non-duplicated value.
When a coordinator starts a network, it can either start a network on a preconfigured 64-bit PAN ID,
or it can select a random 64-bit PAN ID. The 64-bit PAN ID is used during joining; if a device has a
preconfigured 64-bit PAN ID, it will only join a network with the same 64-bit PAN ID. Otherwise, a
device could join any detected PAN and inherit the PAN ID from the network when it joins. The 64-bit
PAN ID is included in all ZigBee beacons and is used in 16-bit PAN ID conflict resolution.
Routers and end devices are typically configured to join a network with any 16-bit PAN ID as long as
the 64-bit PAN ID is valid. Coordinators typically select a random 16-bit PAN ID for their network.
Since the 16-bit PAN ID only allows up to 65,535 unique values, and since the 16-bit PAN ID is
randomly selected, provisions exist in ZigBee to detect if two networks (with different 64-bit PAN IDs)
are operating on the same 16-bit PAN ID. If such a conflict is detected, the ZigBee stack can perform
PAN ID conflict resolution to change the 16-bit PAN ID of the network in order to resolve the conflict.
See the ZigBee specification for details.
To summarize, ZigBee routers and end devices should be configured with the 64-bit PAN ID of the
network they want to join. They typically acquire the 16-bit PAN ID when they join a network.
Operating channel
ZigBee uses direct-sequence spread spectrum modulation and operates on a fixed channel. The
802.15.4 PHY defines 16 operating channels (channels 11 to 26) in the 2.4 GHz frequency band. XBee
modules support all 16 channels.
The XBee does not need to interoperate or talk to non-Digi ZigBee devices
The XBee requires network management and discovery capabilities of the ZDO layer
The XBee needs to operate in a public application profile (smart energy, home automation, etc.)
Application profiles
Application profiles specify various device descriptions including required functionality for various
devices. The collection of device descriptions forms an application profile. Application profiles can be
defined as Public or Private profiles. Private profiles are defined by a manufacturer whereas public
profiles are defined, developed, and maintained by the ZigBee Alliance. Each application profile has a
unique profile identifier assigned by the ZigBee Alliance.
XBee/XBee-PRO ZB RF Modules User Guide
46
Home Automation
Smart Energy
The Smart Energy profile, for example, defines various device types including an energy service
portal, load controller, thermostat, in-home display, etc. The Smart Energy profile defines required
functionality for each device type. For example, a load controller must respond to a defined
command to turn a load on or off. By defining standard communication protocols and device
functionality, public profiles allow interoperable ZigBee solutions to be developed by independent
manufacturers.
Digi XBee ZB firmware operates on a private profile called the Digi Drop-In Networking profile.
However, API mode can be used in many cases to talk to devices in public profiles or non-Digi private
profiles. See ZigBee API Operation on page 133 for details.
Clusters
A cluster is an application message type defined within a profile. Clusters are used to specify a unique
function, service, or action. For example, the following are some clusters defined in the home
automation profile:
Level Control - Used to control devices that can be set to a level between on and off
Each cluster has an associated 2-byte cluster identifier (cluster ID). The cluster ID is included in all
application transmissions. Clusters often have associated request and response messages. For
example, a smart energy gateway (service portal) might send a load control event to a load controller
in order to schedule turning on or off an appliance. Upon executing the event, the load controller
would send a load control report message back to the gateway.
Devices that operate in an application profile (private or public) must respond correctly to all required
clusters. For example, a light switch that will operate in the home automation public profile must
correctly implement the On/Off and other required clusters in order to interoperate with other home
automation devices. The ZigBee Alliance has defined a ZigBee Cluster Library (ZCL) that contains
definitions or various general use clusters that could be implemented in any profile.
XBee modules implement various clusters in the Digi private profile. In addition, the API can be used
to send or receive messages on any cluster ID (and profile ID or endpoint). See Explicit Addressing
ZigBee Command frame on page 143 for details.
Endpoints
The APS layer includes supports for endpoints. An endpoint can be thought of as a running
application, similar to a TCP/IP port. A single device can support one or more endpoints. Each
application endpoint is identified by a 1-byte value, ranging from 1 to 240. Each defined endpoint on
a device is tied to an application profile. A device could, for example, implement one endpoint that
supports a Smart Energy load controller, and another endpoint that supports other functionality on a
private profile.
47
capabilities. Endpoint 0 is a reserved endpoint that supports the ZigBee Device Profile. This endpoint
is called the ZigBee Device Objects (ZDO) endpoint.
Channel selection
When starting a network, the coordinator must select a good channel for the network to operate
on. To do this, it performs an energy scan on multiple channels (frequencies) to detect energy levels
on each channel. Channels with excessive energy levels are removed from its list of potential
channels to start on.
PAN ID selection
After completing the energy scan, the coordinator scans its list of potential channels (remaining
channels after the energy scan) to obtain a list of neighboring PANs. To do this, the coordinator sends
a beacon request (broadcast) transmission on each potential channel. All nearby coordinators and
routers (that have already joined a ZigBee network) will respond to the beacon request by sending a
beacon back to the coordinator. The beacon contains information about the PAN the device is on,
including the PAN identifiers (16-bit and 64-bit). This scan (collecting beacons on the potential
channels) is typically called an active scan or PAN scan.
After the coordinator completes the channel and PAN scan, it selects a random channel and unused
16-bit PAN ID to start on.
Security policy
The security policy determines which devices are allowed to join the network, and which device(s) can
authenticate joining devices. See ZigBee Security on page 87 for a detailed discussion of various
security policies.
Persistent data
Once a coordinator has started a network, it retains the following information through power cycle or
reset events:
XBee/XBee-PRO ZB RF Modules User Guide
48
PAN ID
Operating channel
Child table (end device children that are joined to the coordinator).
Binding Table
Group Table
The coordinator will retain this information indefinitely until it leaves the network. When the
coordinator leaves a network and starts a new network, the previous PAN ID, operating channel, and
child table data are lost.
Description
ID
Used to determine the 64-bit PAN ID. If set to 0 (default), a random 64-bit PAN ID will be selected.
SC
Determines the scan channels bitmask (up to 16 channels) used by the coordinator when
forming a network. The coordinator will perform an energy scan on all enabled SC channels. It
SD
Set the scan duration period. This value determines how long the coordinator performs an
ZS
EE
NK
Set the network security key for the network. If set to 0 (default), a random network security key
KY
Set the trust center link key for the network. If set to 0 (default), a random link key will be used.
EO
Allows other devices to join the network for a time (see NJ command)
Sets AI=0
Sends an API modem status frame (coordinator started) out the serial port when using API
mode
49
Command
Description
NJ
D5
LT
Sets the Associate LED blink time when joined. Default is 1 blink per
If any of the command values in the network formation commands table changes, the coordinator
will leave its current network and start a new network, possibly on a different channel. Note that
command changes must be applied (AC or CN command) before taking effect.
Permit joining
The permit joining attribute on the coordinator is configurable with the NJ command. NJ can be
configured to always allow joining, or to allow joining for a short time.
The last two cases enable joining for one minute if NJ is 0x0 or 0xFF. Otherwise, the commissioning
button and the CB2 command enable joining for NJ seconds.
Leaving a network
There are a couple of mechanisms that will cause the coordinator to leave its current PAN and start a
new network based on its network formation parameter values. These include the following:
Change the ID command such that the current 64-bit PAN ID is invalid
50
Change the SC command such that the current channel (CH) is not included in the channel mask
Issue the NR1 command to send a broadcast transmission, causing all devices in the network to
leave and migrate to a different channel
Press the commissioning button 4 times or issue the CB command with a parameter of 4
Note that changes to ID, SC, ZS, and security command values only take effect when changes are
applied (AC or CN commands).
Having two coordinators on the same channel, stack profile, and PAN ID (16-bit and 64-bit)
can cause problems in the network and should be avoided. When replacing a coordinator, the
old coordinator should be turned off before starting the new coordinator.
To replace a coordinator, the following commands should be read from a device on the network:
AT Command
Description
OP
OI
CH
ZS
Each of the commands listed above can be read from any device on the network. (These parameters
will be the same on all devices in the network.) After reading these commands from a device on the
network, these parameter values should be programmed into the new coordinator using the
following commands.
AT Command
Description
ID
II
SC
Set the scan channels bitmask to enable the read operating channel (CH command). For
example, if the operating channel is 0x0B, set SC to 0x0001. If the operating channel is 0x17, set
SC to 0x1000.
ZS
51
Note II is the initial 16-bit PAN ID. Under certain conditions, the ZigBee stack can change the 16-bit
PAN ID of the network. For this reason, the II command cannot be saved using the WR
command. Once II is set, the coordinator leaves the network and starts on the 16-bit PAN ID
specified by II.
52
Is allowing joining
If a valid PAN is not found, the router performs the PAN scan on the next channel in its scan channels
list and continues scanning until a valid network is found, or until all channels have been scanned. If
all channels have been scanned and a valid PAN was not discovered, all channels will be scanned
again.
The ZigBee Alliance requires that certified solutions not send beacon request messages too
frequently. To meet certification requirements, the XBee firmware attempts nine scans per minute
for the first five minutes, and three scans per minute thereafter. If a valid PAN is within range of a
joining router, it should typically be discovered within a few seconds.
Joining a network
Once the router discovers a valid network, it sends an association request to the device that sent a
valid beacon requesting a join on the ZigBee network. The device allowing the join then sends an
association response frame that either allows or denies the join.
When a router joins a network, it receives a 16-bit address from the device that allowed the join. The
16-bit address is randomly selected by the device that allowed the join.
Authentication
In a network where security is enabled, the router must then go through an authentication process.
SeeZigBee Security on page 87 for a discussion on security and authentication.
After the router is joined (and authenticated, in a secure network), it can allow new devices to join the
network.
Persistent data
Once a router has joined a network, it retains the following information through power cycle or reset
events:
PAN ID
Operating channel
Child table (end device children that are joined to the coordinator).
Binding Table
Group Table
The router will retain this information indefinitely until it leaves the network. When the router leaves
a network, the previous PAN ID, operating channel, and child table data are lost.
ZB Router joining
When the router is powered on, if it is not already joined to a valid ZigBee network, it immediately
attempts to find and join a valid ZigBee network.
Note
The DJ command can be set to 1 to disable joining. The DJ parameter cannot be written with
WR, so a power cycle always clears the DJ setting.
53
Command Description
ID
Sets the 64-bit PAN ID to join. Setting ID=0 allows the router to join any 64-bit PAN ID.
SC
Set the scan channels bitmask that determines which channels a router will scan to find a valid
network. SC on the router should be set to match SC on the coordinator. For example, setting SC to
0x281 enables scanning on channels 0x0B, 0x12, and 0x14, in that order.
SD
Set the scan duration, or time that the router will listen for beacons on each channel.
ZS
EE
Enable or disable security in the network. This must be set to match the EE value (security policy) of
the coordinator.
KY
Set the trust center link key. If set to 0 (default), the link key is expected to be obtained
(unencrypted) during joining.
Once the router joins a network, the network configuration settings and child table data persist
through power cycles as mentioned in the Persistent Data section previously. If joining fails, the
status of the last join attempt can be read in the AI command register.
If any of the above command values change, when command register changes are applied (AC or CN
commands), the router will leave its current network and attempt to discover and join a new valid
network.
When a ZB router has successfully joined a network, it:
Sets AI=0
Sends an API modem status frame (associated) out the serial port when using API mode.
Description
NJ
Sets the permit-join time on the router, or the time that it will allow new devices to join
the network, measured in seconds. If NJ=0xFF, permit joining will always be enabled.
D5
LT
Sets the Associate LED blink time when joined. Default is 2 blinks per second (router).
Permit joining
The permit joining attribute on the router is configurable with the NJ command. NJ can be configured
to always allow joining, or to allow joining for a short time.
54
The middle two cases enable joining for one minute if NJ is 0x0 or 0xFF. Otherwise, the
commissioning button and the CB2 command enable joining for NJ seconds.
Network Watchdog
The NW command (network watchdog timeout) can be used for a powered router to periodically
check for the presence of a coordinator to verify network connectivity. The NW command specifies a
timeout in minutes where the router must receive communication from the coordinator or data
collector. The following events restart the network watchdog timer:
If the watchdog timer expires (no valid data received for NW time), the router will attempt to discover
the 64-bit address of the coordinator. If the address cannot be discovered, the router records one
watchdog timeout. Once three consecutive network watchdog timeouts have expired (3 * NW) and
the coordinator has not responded to the address discovery attempts, the router will leave the
network and attempt to join a new network. Anytime a router receives valid data from the
coordinator or data collector, it will clear the watchdog timeouts counter and restart the watchdog
timer. The watchdog timer (NW command) is settable to several days. The network watchdog feature
is disabled by default (NW defaults to 0).
XBee/XBee-PRO ZB RF Modules User Guide
55
Yes
Received RF
Communication from
Coordinator or Data
Collector
No
No
Network Watchdog
Timer Expired?
Yes
Discover Coordinator
Network
Watchdog
Failure Count
=3?
Yes
Coordinator
Found?
No
No
Yes
Leave
Leaving a network
There are a couple of mechanisms that will cause the router to leave its current PAN and attempt to
discover and join a new network based on its network joining parameter values.
These include the following:
Change the ID command such that the current 64-bit PAN ID is invalid
Change the SC command such that the current channel (CH) is not included in the channel mask
Issue the NR1 command to send a broadcast transmission, causing all devices in the network to
leave and migrate to a different channel
Press the commissioning button 4 times or issue the CB command with a parameter of 4
Note that changes to ID, SC, ZS, and security command values only take effect when changes are
applied (AC or CN commands).
56
57
Is allowing joining
Has capacity for additional end devices (see End Device capacity on page 58).
If a valid PAN is not found, the end device performs the PAN scan on the next channel in its scan
channels list and continues this process until a valid network is found, or until all channels have been
scanned. If all channels have been scanned and a valid PAN was not discovered, the end device may
enter a low power sleep state and scan again later.
If scanning all SC channels fails to discover a valid PAN, XBee ZB modules will attempt to enter a low
power state and will retry scanning all SC channels after the module wakes from sleeping. If the
module cannot enter a low power state, it will retry scanning all channels, similar to the router. To
meet ZigBee Alliance requirements, the end device will attempt up to nine scans per minute for the
first five minutes, and three scans per minute thereafter.
Note
The XBee ZB end device will not enter sleep until it has completed scanning all SC channels
for a valid network.
Joining a network
Once the end device discovers a valid network, it joins the network, similar to a router, by sending an
association request (to the device that sent a valid beacon) to request a join on the ZigBee network.
The device allowing the join then sends an association response frame that either allows or denies
the join.
When an end device joins a network, it receives a 16-bit address from the device that allowed the join.
The 16-bit address is randomly selected by the device that allowed the join.
58
In ZB firmware, the NC command (number of remaining end device children) can be used to
determine how many additional end devices can join a router or coordinator. If NC returns 0, then
the router or coordinator device has no more end device capacity (Its child table is full).
Also of note, since routers cannot sleep, there is no equivalent need for routers or coordinators to
track joined routers. Therefore, there is no limit to the number of routers that can join a given router
or coordinator device. There is no router capacity metric.
Authentication
In a network where security is enabled, the end device must then go through an authentication
process; see ZigBee Security on page 87.
Persistent data
The end device can retain its PAN ID, operating channel, and security policy information through a
power cycle. However, since end devices rely heavily on a parent, the end device does an orphan scan
to try and contact its parent. If the end device does not receive an orphan scan response (called a
coordinator realignment command), it will leave the network and try to discover and join a new
network. When the end device leaves a network, the previous PAN ID and operating channel settings
are lost.
Orphan scans
When an end device comes up from a power cycle, it performs an orphan scan to verify it still has a
valid parent. The orphan scan is sent as a broadcast transmission and contains the 64-bit address of
the end device. Nearby routers and coordinator devices that receive the broadcast check their child
tables for an entry that contains the end device's 64-bit address. If an entry is found with a matching
64-bit address, the device sends a coordinator realignment command to the end device that includes
the end device's 16-bit address, 16-bit PAN ID, operating channel, and the parent's 64-bit and 16-bit
addresses.
If the orphaned end device receives a coordinator realignment command, it is considered joined to
the network. Otherwise, it will attempt to discover and join a valid network.
The DJ command can be set to 1 to disable joining. The DJ parameter cannot be written with
WR, so a power cycle always clears the DJ setting.
Similar to a router, the following commands control the end device joining process.
59
Command
Description
ID
Sets the 64-bit PAN ID to join. Setting ID=0 allows the router to join any 64-bit PAN ID.
SC
Set the scan channels bitmask that determines which channels an end device will scan to find a
valid network. SC on the end device should be set to match SC on the coordinator and routers in
the desired network. For example, setting SC to 0x281 enables scanning on channels 0x0B, 0x12,
and 0x14, in that order.
SD
Set the scan duration, or time that the end device will listen for beacons on each channel.
ZS
EE
Enable or disable security in the network. This must be set to match the EE value (security policy)
of the coordinator.
KY
Set the trust center link key. If set to 0 (default), the link key is expected to be obtained
(unencrypted) during joining.
Once the end device joins a network, the network configuration settings can persist through power
cycles as mentioned in Persistent data on page 48. If joining fails, the status of the last join attempt
can be read in the AI command register.
If any of these command values changes, when command register changes are applied, the end
device will leave its current network and attempt to discover and join a new valid network.
When a ZB end device has successfully started a network, it
Sets AI=0
Sends an API modem status frame (associated) out the serial port when using API mode
Command
Description
D5
LT
Sets the Associate LED blink time when joined. Default is 2 blinks per second (end devices).
SM, SP, ST, SN, SO Parameters that configure the sleep mode characteristics. See Managing End Devices on
page 110 for details.
Parent Connectivity
The XBee ZB end device sends regular poll transmissions to its parent when it is awake. These poll
transmissions query the parent for any new received data packets. The parent always sends a MAC
layer acknowledgment back to the end device. The acknowledgment indicates whether the parent
has data for the end device or not.
If the end device does not receive an acknowledgment for 3 consecutive poll requests, it considers
itself disconnected from its parent and will attempt to discover and join a valid ZigBee network. See
Managing End Devices on page 110 for details.
XBee/XBee-PRO ZB RF Modules User Guide
60
Leaving a network
There are a couple of mechanisms that will cause the router to leave its current PAN and attempt to
discover and join a new network based on its network joining parameter values. These include the
following:
The ID command changes such that the current 64-bit PAN ID is invalid
The SC command changes such that the current operating channel (CH) is not included in the
channel mask
The NR1 command is issued to send a broadcast transmission, causing all devices in the network
to leave and migrate to a different channel
The commissioning button is pressed 4 times or the CB command is issued with a parameter of 4
The end device's parent is powered down or the end device is moved out of range of the parent
such that the end device fails to receive poll acknowledgment messages
Note that changes to command values only take effect when changes are applied (AC or CN
commands).
61
9. The joined end device will attempt to enter low power sleep modes based on its sleep
configuration commands (SM, SP, SN, ST, SO).
PAN ID Filtering
Permit Joining
Application Messaging
PAN ID filtering
The XBee can be configured with a fixed PAN ID by setting the ID command to a non-zero value. If the
PAN ID is set to a non-zero value, the XBee will only join a network with the same PAN ID.
Permit joining
The Permit Joining parameter can be disabled in a network to prevent unwanted devices from joining.
When a new device must be added to a network, permit-joining can be enabled for a short time on
the desired network. In the XBee firmware, joining is disabled by setting the NJ command to a value
less than 0xFF on all routers and coordinator devices. Joining can be enabled for a short time using
XBee/XBee-PRO ZB RF Modules User Guide
62
the commissioning push-button (see Network commissioning and diagnostics on page 94 for details)
or the CB command.
Application messaging
If the above mechanisms are not feasible, the application could build in a messaging framework
between the coordinator and devices that join its network. For example, the application code in
joining devices could send a transmission to the coordinator after joining a network, and wait to
receive a defined reply message. If the application does not receive the expected response message
after joining, the application could force the XBee to leave and continue scanning (see the NR
parameter).
63
An address conflict is detected where two devices are found to have the same 16-bit address
A device leaves the network and later joins (it can receive a different address)
All ZigBee transmissions are sent using the source and destination 16-bit addresses. The routing
tables on ZigBee devices also use 16-bit addresses to determine how to route data packets through
the network. However, since the 16-bit address is not static, it is not a reliable way to identify a
device.
To solve this problem, the 64-bit destination address is often included in data transmissions to
guarantee data is delivered to the correct destination. The ZigBee stack can discover the 16-bit
address, if unknown, before transmitting data to a remote.
Interoperate with other ZigBee devices outside of the Digi application profile
64
Data transmission
API mode provides a simple yet powerful interface that can easily send data to any profile ID,
endpoint, and cluster ID combination on any device in a ZigBee network.
Data transmission
ZigBee data packets can be sent as either unicast or broadcast transmissions. Unicast transmissions
route data from one source device to one destination device, whereas broadcast transmissions are
sent to many or all devices in the network.
Broadcast transmissions
Broadcast transmissions within the ZigBee protocol are intended to be propagated throughout the
entire network such that all nodes receive the transmission. To accomplish this, the coordinator and
all routers that receive a broadcast transmission will retransmit the packet three times.
Note When a router or coordinator delivers a broadcast transmission to an end device child, the
transmission is only sent once (immediately after the end device wakes and polls the parent
for any new data). See Parent operation on page 111 for details.
Broadcast data transmission
E
R
Legend
C=Coordinator
R=Router
E=End Device
Each node that transmits the broadcast will also create an entry in a local broadcast transmission
table. This entry is used to keep track of each received broadcast packet to ensure the packets are not
endlessly transmitted. Each entry persists for 8 seconds. The broadcast transmission table holds 8
entries.
For each broadcast transmission, the ZigBee stack must reserve buffer space for a copy of the data
packet. This copy is used to retransmit the packet as needed. Large broadcast packets will require
XBee/XBee-PRO ZB RF Modules User Guide
65
Data transmission
more buffer space. This information on buffer space is provided for general knowledge; the user
does not and cannot change any buffer spacing. Buffer spacing is handled automatically by the XBee
module.
Since broadcast transmissions are retransmitted by each device in the network, broadcast messages
should be used sparingly.
Unicast transmissions
Unicast transmissions are sent from one source device to another destination device. The destination
device could be an immediate neighbor of the source, or it could be several hops away. Unicast
transmissions that are sent along a multiple hop path require some means of establishing a route to
the destination device. See RF packet routing on page 71 for details.
Address resolution
As mentioned previously, each device in a ZigBee network has both a 16-bit (network) address and a
64-bit (extended) address. The 64-bit address is unique and assigned to the device during
manufacturing, and the 16-bit address is obtained after joining a network. The 16-bit address can
also change under certain conditions.
When sending a unicast transmission, the ZigBee network layer uses the 16-bit address of the
destination and each hop to route the data packet. If the 16-bit address of the destination is not
known, the ZigBee stack includes a discovery provision to automatically discover the destination
device's 16-bit address before routing the data.
To discover a 16-bit address of a remote, the device initiating the discovery sends a broadcast
address discovery transmission. The address discovery broadcast includes the 64-bit address of the
remote device whose 16-bit address is being requested. All nodes that receive this transmission
check the 64-bit address in the payload and compare it to their own 64-bit address. If the addresses
match, the device sends a response packet back to the initiator. This response includes the remote's
16-bit address. When the discovery response is received, the initiator will then transmit the data.
Frames may be addressed using either the extended or the network address. If the extended address
form is used, then the network address field should be set to 0xFFFE (unknown). If the network
address form is used, then the extended address field should be set to 0xFFFFFFFFFFFFFFFF
(unknown).
If an invalid 16-bit address is used as a destination address, and the 64-bit address is unknown
(0xFFFFFFFFFFFFFFFF), the modem status message will show a delivery status code of 0x21 (network
ack failure) and a discovery status of 0x00 (no discovery overhead). If a non-existent 64-bit address is
used as a destination address, and the 16-bit address is unknown (0xFFFE), address discovery will be
attempted and the modem status message will show a delivery status code of 0x24 (address not
found) and a discovery status code of 0x01 (address discovery was attempted).
66
Data transmission
Address table
Each ZigBee device maintains an address table that maps a 64-bit address to a 16-bit address. When
a transmission is addressed to a 64-bit address, the ZigBee stack searches the address table for an
entry with a matching 64-bit address, in hopes of determining the destination's 16-bit address. If a
known 16-bit address is not found, the ZigBee stack will perform address discovery to discover the
device's current 16-bit address.
64-bit Address
16-bit Address
0x4414
0x1234
0xC200
0xFFFE (unknown)
The XBee modules can store up to 10 address table entries. For applications where a single device
(e.g. coordinator) may send unicast transmissions to more than 10 devices, the application should
implement an address table to store the 16-bit and 64-bit addresses for each remote device. Any
XBee that will send data to more than 10 remotes should also use API mode. The application can
then send both the 16-bit and 64-bit addresses to the XBee in the API transmit frames which will
significantly reduce the number of 16-bit address discoveries and greatly improve data throughput.
If an application will support an address table, the size should ideally be larger than the maximum
number of destination addresses the device will communicate with. Each entry in the address table
should contain a 64-bit destination address and its last known 16-bit address.
When sending a transmission to a destination 64-bit address, the application should search the
address table for a matching 64-bit address. If a match is found, the 16-bit address should be
populated into the 16-bit address field of the API frame. If a match is not found, the 16-bit address
should be set to 0xFFFE (unknown) in the API transmit frame.
The API provides indication of a remote device's 16-bit address in the following frames:
Rx Data (0x90)
Group table
Each router and the coordinator maintain a persistent group table. Each entry contains an endpoint
value, a two byte group ID, and an optional name string of zero to 16 ASCII characters, and an index
into the binding table. More than one endpoint may be associated with a group ID, and more than
one group ID may be associated with a given endpoint. The capacity of the group table is 16 entries.
The application should always update the 16-bit address in the address table when one of these
frames is received to ensure the table has the most recently known 16-bit address. If a transmission
failure occurs, the application should set the 16-bit address in the table to 0xFFFE (unknown).
67
Data transmission
Binding transmissions
Binding transmissions use indirect addressing to send one or more messages to other destination
devices. An Explicit Addressing ZigBee Command Frame (0x11) using the Indirect Tx Option (0x04) is
treated as a binding transmission request.
Address resolution
The source endpoint and cluster ID values of a binding transmission are used as keys to lookup
matching binding table entries. For each matching binding table entry, the type field of the entry
indicates whether a unicast or a multicast message should be sent.
In the case of a unicast entry, the transmission request is updated with the Destination Endpoint and
MAC Address, and unicast to its destination. In the case of a multicast entry, the message is updated
using the two least significant bytes of the Destination MAC Address as the groupID, and multicast to
its destination(s).
Binding table
Each router and the coordinator maintain a persistent binding table to map source endpoint and
cluster ID values into 64 bit destination address and endpoint values. The capacity of the binding
table is 16 entries.
Multicast transmissions
Multicast transmissions are used to broadcast a message to destination devices which have active
endpoints associated with a common group ID. An explicit transmit request frame (0x11) using the
Multicast Tx Option (0x08) is treated as a multicast transmission request.
Address resolution
The 64 bit destination address value does not matter and it is recommended it be set to
0xFFFFFFFFFFFFFFFF. The 16 bit destination address value should be set to the destination groupID.
Fragmentation
Each unicast transmission may support up to 84 bytes of RF payload. (Enabling security or using
source routing can reduce this number. See the NP command for details.) However, the XBee ZB
firmware supports a ZigBee feature called fragmentation that allows a single large data packet to be
broken up into multiple RF transmissions and reassembled by the receiver before sending data out
its serial port. This is shown in the image below.
68
Data transmission
The transmit frame can include up to 255 bytes of data, which will be broken up into multiple
transmissions and reassembled on the receiving side. If one or more of the fragmented messages are
not received by the receiving device, the receiver will drop the entire message, and the sender will
indicate a transmission failure in the Tx Status API frame.
Applications that do not wish to use fragmentation should avoid sending more than the maximum
number of bytes in a single RF transmission. See Maximum RF payload size on page 79 for details.
If RTS flow control is enabled on the receiving module (using the D6 command) and a fragmented
message is received, then RTS flow control will be ignored.
Note Broadcast transmissions do not support fragmentation. Maximum payload size = up to 84
bytes.
69
Data transmission
5. After setting these command values, all serial characters will be sent as a unicast transmission to
the coordinator.
API firmware
Use the transmit request, or explicit transmit request frame (0x10 and 0x11 respectively) to send data
to the coordinator. The 64-bit address can either be set to 0x0000000000000000, or to the 64-bit
address of the coordinator. The 16-bit address should be set to 0xFFFE when using the 64-bit address
of all 0x00s.
To send an ASCII 1 to the coordinator's 0x00 address, the following API frame can be used:
7E 00 0F 10 01 0000 0000 0000 0000 FFFE 00 00 31 C0
If the explicit transmit frame is used, the cluster ID should be set to 0x0011, the profile ID to 0xC105,
and the source and destination endpoints to 0xE8 (recommended defaults for data transmissions in
the Digi profile.) The same transmission could be sent using the following explicit transmit frame:
7E 00 15 11 01 0000 0000 0000 0000 FFFE E8 E8 0011 C105 00 00 31 18
Notice the 16-bit address is set to 0xFFFE. This is required when sending to a 64-bit address of 0x00s.
Now suppose the coordinator's 64-bit address is 0x0013A200404A2244. The following transmit
request API frame (0x10) will send an ASCII 1 to the coordinator:
7E 00 0F 10 01 0013 A200 404A 2244 0000 0000 31 18
API firmware
This example will use the transmit request API frame (0x10) to send an ASCII 1 in a broadcast
transmission.
To send an ASCII 1 as a broadcast transmission, the following API frame can be used:
7E 00 0F 10 01 0000 0000 0000 FFFF FFFE 00 00 31 C2
Notice the destination 16-bit address is set to 0xFFFE for broadcast transmissions.
70
RF packet routing
command ID 0x00, a ZCL Header of 151E10, transaction number EE, and a ZCL payload of
000102030405.
7E 001E 11 e4 FFFFFFFFFFFFFFFF FFFE E7 FF 0011 C105 00 04 151E10EE000102030405 14
Note The 64 bit destination address has been set to all 0xFF values, and the destination endpoint
set to 0xFF. The Tx Option 0x04 indicates indirect addressing is to be used. The 64 bit
destination address and destination endpoint will be filled in by looking up data associated
with binding table entries which match Example 5: Send a multicast (group ID) broadcast.
RF packet routing
Unicast transmissions may require some type of routing. ZigBee includes several different ways to
route data, each with its own advantages and disadvantages. These are summarized in the table
below.
Routing Approach
Description
When to Use
Ad hoc On-demand
Routing paths are created between source
and destination, possibly traversing
Distance Vector
(AODV) Mesh Routing multiple nodes (hops). Each device
knows who to send data to next to
eventually reach the destination
Source Routing
Note End devices do not make use of these routing protocols. Rather, an end device sends a unicast
transmission to its parent and allows the parent to route the data packet in its behalf.
71
RF packet routing
Note A network cannot revert from Many-to-One routing to AODV routing without first doing a
network reset (NR).
+3 dBm TX power
+18 dBm TX power
Link status (B to A)
Neighbor A:
Outgoing cost: very poor
Incoming cost: very good
Link status (A to B)
Device B
Neighbor B:
Outgoing cost: very good
Incoming cost: very poor
This mechanism enables devices A and B to recognize that the link is not reliable in both directions
and select a different neighbor when establishing routes. (Such links are called asymmetric links,
meaning the link quality is not similar in both directions.)
When a router or coordinator device powers on, it sends link status messages every couple seconds
to attempt to discover link qualities with its neighbors quickly. After being powered on for some time,
the link status messages are sent at a much slower rate (about every 3-4 times per minute).
72
RF packet routing
Destination Address
R3
Router 6
Coordinator
Router 6
Router 5
R5
Router 6
Router 6
When a source node must discover a route to a destination node, it sends a broadcast route request
command. The route request command contains the source network address, the destination
network address and a path cost field (a metric for measuring route quality). As the route request
command is propagated through the network (refer to the Broadcast Transmission), each node that
re-broadcasts the message updates the path cost field and creates a temporary entry in its route
discovery table.
Sample route request (broadcast) transmission where R3 is trying to discover a route to R6:
73
RF packet routing
When the destination node receives a route request, it compares the path cost field against
previously received route request commands. If the path cost stored in the route request is better
than any previously received, the destination node will transmit a route reply packet to the node that
originated the route request. Intermediate nodes receive and forward the route reply packet to the
source node (the node that originated route request).
Sample route reply (unicast) where R6 sends a route reply to R3:
Many-to-One routing
In networks where many devices must send data to a central collector or gateway device, AODV mesh
routing requires significant overhead. If every device in the network had to discover a route before it
could send data to the data collector, the network could easily become inundated with broadcast
route discovery messages.
Many-to-one routing is an optimization for these kinds of networks. Rather than require each device
to do its own route discovery, a single many-to-one broadcast transmission is sent from the data
collector to establish reverse routes on all devices. This is shown in the figure below. The left side
shows the many broadcasts the devices can send when they create their own routes and the route
74
RF packet routing
replies generated by the data collector. The right side shows the benefits of many-to-one routing
where a single broadcast creates reverse routes to the data collector on all routers.
The many-to-one broadcast is a route request message with the target discovery address set to the
address of the data collector. Devices that receive this route request create a reverse many-to-one
routing table entry to create a path back to the data collector. The ZigBee stack on a device uses
historical link quality information about each neighbor to select a reliable neighbor for the reverse
route.
When a device sends data to a data collector, and it finds a many-to-one route in its routing table, it
will transmit the data without performing a route discovery. The many-to-one route request should
be sent periodically to update and refresh the reverse routes in the network.
Applications that require multiple data collectors can also use many-to-one routing. If more than one
data collector device sends a many-to-one broadcast, devices will create one reverse routing table
entry for each collector.
In ZB firmware, the AR command is used to enable many-to-one broadcasting on a device. The AR
command sets a time interval (measured in 10 second units) for sending the many to one broadcast
transmission. (See the command table for details).
Source routing
In applications where a device must transmit data to many remotes, AODV routing would require
performing one route discovery for each destination device to establish a route. If there are more
destination devices than there are routing table entries, established AODV routes would be
overwritten with new routes, causing route discoveries to occur more regularly. This could result in
larger packet delays and poor network performance.
ZigBee source routing helps solve these problems. In contrast to many-to-one routing that
establishes routing paths from many devices to one data collector, source routing allows the
collector to store and specify routes for many remotes.
To use source routing, a device must use the API mode, and it must send periodic many-to-one route
request broadcasts (AR command) to create a many-to-one route to it on all devices. When remote
devices send RF data using a many-to-one route, they first send a route record transmission. The
route record transmission is unicast along the many-to-one route until it reaches the data collector.
As the route record traverses the many-to-one route, it appends the 16-bit address of each device in
the route into the RF payload. When the route record reaches the data collector, it contains the
address of the sender, and the 16-bit address of each hop in the route. The data collector can store
the routing information and retrieve it later to send a source routed packet to the remote. This is
shown in the images below.
75
RF packet routing
76
RF packet routing
2. The data collector can issue a network discovery command (ND command) to force all XBee
devices to send a network discovery response. Each network discovery response will be prefaced
by a route record.
3. Periodic IO sampling can be enabled on remotes to force them to send data at a regular rate. Each
IO sample would be prefaced by a route record. See XBee analog and digital I/O lines on page 126
for details.
4. If the NI string of the remote device is known, the DN command can be issued with the NI string of
the remote in the payload. The remote device with a matching NI string would send a route record
and a DN response.
R1
R4
Coordinator
R5
To send a source-routed packet to R3, the application must send a Create Source Route API frame
(0x21) to the XBee, with a destination of R3, and 2 hops (R1 and R2). If the 64- bit address of R3 is
0x0013A200 404a1234 and the 16-bit addresses of R1, R2, and R3 are:
77
RF packet routing
Device
16-bit address
R1
0xAABB
R2
0xCCDD
R3
0xEEFF
78
Encrypted transmissions
Encrypted transmissions
Encrypted transmissions are routed similar to non-encrypted transmissions with one exception. As
an encrypted packet propagates from one device to another, each device decrypts the packet using
the network key, and authenticates the packet by verifying packet integrity. It then re-encrypts the
packet with its own source address and frame counter values, and sends the message to the next
hop. This process adds some overhead latency to unicast transmissions, but it helps prevent replay
attacks. See ZigBee Security on page 87 for details.
79
Throughput
enabled or not. If security is enabled (EE command), the maximum number of RF payload bytes
decreases since security requires additional overhead.
After reading the NP value, the following conditions can affect the maximum number of data bytes in
a single RF transmission:
If source routing is used, the 16-bit addresses in the source route are inserted into the RF payload
space. For example, if NP returns 84 bytes, and a source route must traverse 3 intermediate hops
(3 16-bit addresses), the total number of bytes that can be sent in one RF packet is 78.
Enabling APS encryption (API TX option bit set) will reduce the number of payload bytes by 4.
Throughput
Throughput in a ZigBee network can vary by a number of variables, including: number of hops,
encryption enabled/disabled, sleeping end devices, failures/route discoveries. Our empirical testing
showed the following throughput performance in a robust operating environment (low interference).
Data throughput1
Configuration
Data Throughput
1 hop, RR, SD
58 kb/s
1 hop, RR, SE
34 kb/s
1 hop, RE, SD
1 hop, RE, SE
1 hop, ER, SD
1 hop, ER, SE
4 hops, RR, SD
4 hops, RR, SE
RR = router to router
RE = router to end device (non-sleeping)
ER = end device (non-sleeping) to router
SD = security disabled
SE = security enabled
4 hops = 5 nodes total, 3 intermediate router nodes
1. Data throughput measurements were made setting the serial interface rate to 115200 b/s, and measuring
the time to send 100,000 bytes from source to destination. During the test, no route discoveries or failures
occurred.
80
1-byte packet:
1-byte packet:
32-byte packet:
32-byte packet:
1-byte packet:
1-byte packet:
32-byte packet:
32-byte packet:
1-byte packet:
1-byte packet:
32-byte packet:
32-byte packet:
ZDO transmissions
ZigBee defines a ZigBee Device Objects layer (ZDO) that can provide device and service discovery and
network management capabilities. This layer is described below.
ZDO
The ZDO is supported to some extent on all ZigBee devices. The ZDO is an endpoint that implements
services described in the ZigBee Device Profile in the ZigBee specification. Each service has an
assigned cluster ID, and most service requests have an associated response. The following table
describes some common ZDO services.
Cluster Name
Cluster ID
Description
0x0000
0x0005
LQI Request
0x0031
0x0032
LQI Response
0x8031
0x8032
Refer to the ZigBee specification for a detailed description of all ZigBee Device Profile services.
81
ZDO transmissions
The first byte of payload in the API frame is an application sequence number (transaction sequence
number) that can be set to any single byte value. This same value will be used in the first byte of the
ZDO response. All remaining payload bytes must be set as required by the ZDO. All multi-byte values
must be sent in little endian byte order.
Example 1: send a ZDO LQI request to read the neighbor table contents of a remote.
Looking at the ZigBee specification, the cluster ID for an LQI Request is 0x0031, and the payload only
requires a single byte (start index). This example will send an LQI request to a remote device with a
64-bit address of 0x0013A200 40401234. The start index will be set to 0, and the transaction
sequence number will be set to 0x76
API frame
7E 0016 11 01 0013A200 40401234 FFFE 00 00 0031 0000 00 00 76 00 CE
0x0016 - length
0x11 - Explicit transmit request
0x01 - frame ID (set to a non-zero value to enable the transmit status message, or set to 0 to disable)
0x0013A200 40401234 - 64-bit address of the remote
0xFFFE - 16-bit address of the remote (0xFFFE = unknown). Optionally, set to the 16-bit address of the
destination if known.
0x00 - Source endpoint
0x00 - Destination endpoint
0x0031 - Cluster ID (LQI Request, or Neighbor table request)
0x0000 - Profile ID (ZigBee Device Profile)
0x00 - Broadcast radius
0x00 - Tx Options
0x76 - Transaction sequence number
0x00 - Required payload for LQI request command
0xCE - Checksum (0xFF - SUM (all bytes after length))
Description
This API frame sends a ZDO LQI request (neighbor table request) to a remote device to obtain data
from its neighbor table. Recall that the AO command must be set correctly on an API device to enable
the explicit API receive frames in order to receive the ZDO response.
82
Transmission timeouts
Example 2: send a ZDO network Address Request to discover the 16-bit address of a
remote.
Looking at the ZigBee specification, the cluster ID for a network Address Request is 0x0000, and the
payload only requires the following:
[64-bit address] + [Request Type] + [Start Index]
This example will send a Network Address Request as a broadcast transmission to discover the 16-bit
address of the device with a 64-bit address of 0x0013A200 40401234. The request type and start
index will be set to 0, and the transaction sequence number will be set to 0x44
API frame
7E 001F 11 01 00000000 0000FFFF FFFE 00 00 0000 0000 00 00 44 34124040 00A21300 00 00 33
0x001F - length
0x11 - Explicit transmit request
0x01 - frame ID (set to a non-zero value to enable the transmit status message, or set to 0 to disable)
0x00000000 0000FFFF - 64-bit address for a broadcast transmission
0xFFFE - Set to this value for a broadcast transmission.
0x00 - Source endpoint
0x00 - Destination endpoint
0x0000 - Cluster ID (Network Address Request)
0x0000 - Profile ID (ZigBee Device Profile)
0x00 - Broadcast radius
0x00 - Tx Options
0x44 - Transaction sequence number
0x34124040 00A21300 00 00 - Required payload for Network Address Request command
0x33 - Checksum (0xFF - SUM (all bytes after length))
Description
This API frame sends a broadcast ZDO Network Address Request to obtain the 16-bit address of a
device with a 64-bit address of 0x0013A200 40401234. Note the bytes for the 64-bit address were
inserted in little endian byte order. All multi-byte fields in the API payload of a ZDO command must
have their data inserted in little endian byte order. Also recall that the AO command must be set
correctly on an API device to enable the explicit API receive frames in order to receive the ZDO
response.
Transmission timeouts
The ZigBee stack includes two kinds of transmission timeouts, depending on the nature of the
destination device. For destination devices such as routers whose receiver is always on, a unicast
timeout is used. The unicast timeout estimates a timeout based on the number of unicast hops the
packet should traverse to get data to the destination device. For transmissions destined for end
devices, the ZigBee stack uses an extended timeout that includes the unicast timeout (to route data
to the end device's parent), and it includes a timeout for the end device to finish sleeping, wake, and
poll the parent for data.
The ZigBee stack includes some provisions for a device to detect if the destination is an end device or
not. The ZigBee stack uses the unicast timeout unless it knows the destination is an end device.
XBee/XBee-PRO ZB RF Modules User Guide
83
Transmission timeouts
The XBee API includes a transmit options bit that can be set to specify if the extended timeout should
be used for a given transmission. If this bit is set, the extended timeout will be used when sending RF
data to the specified destination. To improve routing reliability, applications should set the extended
timeout bit when sending data to end devices if:
The application sends data to 10 or more remote devices, some of which are end devices, AND
The end devices may sleep longer than the unicast timeout
Unicast timeout
The unicast timeout is settable with the NH command. The actual unicast timeout is computed as
((50 * NH) + 100). The default NH value is 30 which equates to a 1.6 second timeout.
The unicast timeout includes 3 transmission attempts (1 attempt and 2 retries). The maximum total
timeout is about:
3 * ((50 * NH) + 100).
For example, if NH=30 (0x1E), the unicast timeout is about
3 * ((50 * 30) + 100), or
3 * (1500 + 100), or
3 * (1600), or
4800 ms, or
4.8 seconds.
Extended timeout
The worst-case transmission timeout when sending data to an end device is somewhat larger than
when transmitting to a router or coordinator. As described Parent operation on page 111, RF data
packets are actually sent to the parent of the end device, who buffers the packet until the end device
wakes to receive it. The parent will buffer an RF data packet for up to (1.2 * SP) time.
To ensure the end device has adequate time to wake and receive the data, the extended transmission
timeout to an end device is:
(50 * NH) + (1.2 * SP)
This timeout includes the packet buffering timeout (1.2 * SP) and time to account for routing through
the mesh network (50 * NH).
If an acknowledgment is not received within this time, the sender will resend the transmission up to
two more times. With retries included, the longest transmission timeout when sending data to an
end device is:
3 * ((50 * NH) + (1.2 * SP))
The SP value in both equations must be entered in millisecond units. (The SP command setting uses
10ms units and must be converted to milliseconds to be used in this equation.)
For example, suppose a router is configured with NH=30 (0x1E) and SP=0x3E8 (10,000 ms), and that it
is either trying to send data to one of its end device children, or to a remote end device. The total
extended timeout to the end device is about:
XBee/XBee-PRO ZB RF Modules User Guide
84
Transmission timeouts
Transmission examples
Example 1: send a unicast API data transmission to the coordinator using 64-bit
address 0, with payload TxData.
API frame
7E 0014 10 01 00000000 00000000 FFFE 00 00 54 78 44 61 74 61 AB
Field composition
0x0014 - length
0x10 - API ID (TX data)
0x01 - frame ID (set greater than 0 to enable the TX-status response)
0x00000000 00000000 - 64-bit address of coordinator (ZB definition)
0xFFFE - Required 16-bit address if sending data to 64-bit address of 0.
0x00 - Broadcast radius (0 = max hops)
0x00 - Tx options
0x54 78 44 61 74 61 - ASCII representation of TxData string
0xAB - Checksum (0xFF - SUM (all bytes after length))
Description
This transmission sends the string TxData to the coordinator, without knowing the coordinator
device's 64-bit address. A 64-bit address of 0 is defined as the coordinator in ZB firmware. If the
coordinator's 64-bit address was known, the 64-bit address of 0 could be replaced with the
coordinator's 64-bit address, and the 16-bit address could be set to 0.
Example 2: send a broadcast API data transmission that all devices can receive
(including sleeping end devices), with payload TxData.
API frame
7E 0014 10 01 00000000 0000FFFF FFFE 00 00 54 78 44 61 74 61 AD
Field composition
0x0014 - length
0x10 - API ID (TX data)
0x01 - frame ID (set to a non-zero value to enable the TX-status response)
0x00000000 0000FFFF - Broadcast definition (including sleeping end devices
0xFFFE - Required 16-bit address to send broadcast transmission.
XBee/XBee-PRO ZB RF Modules User Guide
85
Transmission timeouts
Description
Setting AO=1 is required for the XBee to use the explicit receive API frame (0x91) when RF data
packets are received. This is required if the application needs indication of source or destination
endpoint, cluster ID, and/or profile ID values used in received ZigBee data packets. ZDO messages
can only be received if AO=1.
86
ZigBee Security
ZigBee supports various levels of security that can be configured depending on the needs of the
application. Security provisions include:
The first half of this section describes various security features defined in the ZigBee specification,
while the last half illustrates how the XBee modules can be configured to support these features
Security modes
The ZigBee standard supports three security modes residential, standard, and high security.
Residential security was first supported in the ZigBee 2006 standard. This level of security requires a
network key be shared among devices. Standard security adds a number of optional security
enhancements over residential security, including an APS layer link key. High security adds entity
authentication, and a number of other features not widely supported.
XBee ZB modules primarily support standard security, although end devices that support residential
security can join and interoperate with standard security devices. The remainder of this section
focuses on material that is relevant to standard security.
87
Packets are encrypted and authenticated using 128-bit AES. This is shown in the figure below.
Frame counter
The network header of encrypted packets includes a 32-bit frame counter. Each device in the network
maintains a 32-bit frame counter that is incremented for every transmission. In addition, devices
track the last known 32-bit frame counter for each of its neighbors. If a device receives a packet from
a neighbor with a smaller frame counter than it has previously seen, the packet is discarded. The
frame counter is used to protect against replay attacks.
If the frame counter reaches a maximum value of 0xFFFFFFFF, it does not wrap to 0 and no more
transmissions can be sent. Due to the size of the frame counters, reaching the maximum value is a
very unlikely event for most applications. The following table shows the required time under different
conditions, for the frame counter to reach its maximum value.
Average Transmission Rate
1 / second
136 years
10 / second
13.6 years
To clear the frame counters without compromising security, the network key can be changed in the
network. When the network key is updated, the frame counters on all devices reset to 0. (See the
Network Key Updates section for details.)
88
packet. If the device is not the destination, it then encrypts and authenticates the packet, using its
own frame counter and source address in the network header section.
Since network encryption is performed at each hop, packet latency is slightly longer in an encrypted
network than in a non-encrypted network. Also, security requires 18 bytes of overhead to include a
32-bit frame counter, an 8-byte source address, 4-byte MIC, and 2 other bytes. This reduces the
number of payload bytes that can be sent in a data packet.
89
Trust center
ZigBee defines a trust center device that is responsible for authenticating devices that join the
network. The trust center also manages link key distribution in the network.
90
configured with the link key. Sending the network key unencrypted is not recommended as it can
open a security hole in the network. To maximize security, devices should be pre-configured with the
correct link key.
Enabling security
To enable security on a device, the EE command must be set to 1. If the EE command value is changed
and changes are applied (e.g. AC command), the XBee module will leave the network (PAN ID and
channel) it was operating on, and attempt to form or join a new network.
If EE is set to 1, all data transmissions will be encrypted with the network key. When security is
enabled, the maximum number of bytes in a single RF transmission will be reduced. See the NP
command for details.
Note The EE command must be set the same on all devices in a network. Changes to the EE
command should be written to non-volatile memory (to be preserved through power cycle or
reset events) using the WR command.
91
92
93
Device configuration
XBee modules can be configured locally through serial commands (AT or API), or remotely through
remote API commands. API devices can send configuration commands to set or read the
configuration settings of any device in the network.
Device placement
For a mesh network installation to be successful, the installer must be able to determine where to
place individual XBee devices to establish reliable links throughout the mesh network.
Link testing
A good way to measure the performance of a mesh network is to send unicast data through the
network from one device to another to determine the success rate of many transmissions. To simplify
link testing, the modules support a loopback cluster ID (0x12) on the data endpoint (0xE8). Any data
sent to this cluster ID on the data endpoint will be transmitted back to the sender. This is shown in
the figure below:
94
Device discovery
The configuration steps to send data to the loopback cluster ID depend on the serial port mode as
determined by the AP command.
Transparent Mode
To send data to the loopback cluster ID on the data endpoint of a remote device, set the CI command
value to 0x12. The SE and DE commands should be set to 0xE8 (default value). The DH and DL
commands should be set to the address of the remote (0 for the coordinator, or the 64-bit address of
the remote). After exiting command mode, any received serial characters will be transmitted to the
remote device, and returned to the sender.
API Mode
Send an Explicit Addressing ZigBee Command API frame (0x11) using 0x12 as the cluster ID and 0xE8
as the source and destination endpoint. Data packets received by the remote will be echoed back to
the sender.
RSSI indicators
It is possible to measure the received signal strength on a device using the DB command. DB returns
the RSSI value (measured in dBm) of the last received packet. However, this number can be
misleading. The DB value only indicates the received signal strength of the last hop. If a transmission
spans multiple hops, the DB value provides no indication of the overall transmission path, or the
quality of the worst link it only indicates the quality of the last link and should be used sparingly.
The DB value can be determined in hardware using the RSSI/PWM module pin (pin 6). If the RSSI PWM
functionality is enabled (P0 command), when the module receives data, the RSSI PWM is set to a
value based on the RSSI of the received packet. (Again, this value only indicates the quality of the last
hop.) This pin could potentially be connected to an LED to indicate if the link is stable or not.
Device discovery
Network discovery
The network discovery command can be used to discover all Digi modules that have joined a
network. Issuing the ND command sends a broadcast node discovery command throughout the
network. All devices that receive the command will send a response that includes the devices
95
addressing information, node identifier string (see NI command), and other relevant information.
This command is useful for generating a list of all module addresses in a network.
When a device receives the node discovery command, it waits a random time before sending its own
response. The maximum time delay is set on the ND sender with the NT command. The ND originator
includes its NT setting in the transmission to provide a delay window for all devices in the network.
Large networks may need to increase NT to improve network discovery reliability. The default NT
value is 0x3C (6 seconds).
ZDO discovery
The ZigBee Device Profile includes provisions to discover devices in a network that are supported on
all ZigBee devices (including non-Digi products). These include the LQI Request (cluster ID 0x0031)
and the Network Update Request (cluster ID 0x0038). The LQI Request can be used to read the
devices in the neighbor table of a remote device, and the Network Update Request can be used to
have a remote device do an active scan to discover all nearby ZigBee devices. Both of these ZDO
commands can be sent using the XBee Explicit API transmit frame (0x11). See ZigBee API Operation
on page 133 for details. Refer to the ZigBee specification for formatting details of these two ZDO
frames.
Joining Announce
All ZigBee devices send a ZDO Device Announce broadcast transmission when they join a ZigBee
network (ZDO cluster ID 0x0013). These frames will be sent out the XBee's serial port as an Explicit Rx
Indicator API frame (0x91) if AO is set to 1. The device announce payload includes the following
information:
[Sequence Number] + [16-bit address] + [64-bit address] + [Capability]
The 16-bit and 64-bit addresses are received in little-endian byte order (LSB first). See the ZigBee
specification for details.
96
Commissioning Pushbutton
The commissioning pushbutton definitions provide a variety of simple functions to aid in deploying
devices in a network. The commissioning button functionality on pin 33 (SMT) or pin 20 (TH) is
enabled by setting the D0 command to 1 (enabled by default).
Button
Presses
Button presses may be simulated in software using the ATCB command. ATCB should be issued with
a parameter set to the number of button presses to execute. (e.g. sending ATCB1 will execute the
action(s) associated with a single button press.)
The node identification frame is similar to the node discovery response frame it contains the
devices address, node identifier string (NI command), and other relevant data. All API devices that
receive the node identification frame send it out their serial port as an API Node Identification
Indicator frame (0x95).
Associate LED
The Associate pin (pin 28/SMT, pin 33/TH) can provide indication of the devices network status and
diagnostics information. To take advantage of these indications, an LED can be connected to the
Associate pin as shown in the figure above. The Associate LED functionality is enabled by setting the
D5 command to 1 (enabled by default). If enabled, the Associate pin is configured as an output and
will behave as described in the following sections.
Joined indication
The Associate pin indicates the network status of a device. If the module is not joined to a network,
the Associate pin is set high. Once the module successfully joins a network, the Associate pin blinks at
a regular time interval. The following figure shows the joined status of a device
97
Associate
Device Not Joined
The associate pin can indicate the joined status of a device . Once the device has joined a
network, the associate pin toggles state at a regular interval (t). The time can be set by
using the LT command.
The LT command defines the blink time of the Associate pin. If set to 0, the device uses the default
blink time (500ms for coordinator, 250ms for routers and end devices).
Diagnostics support
The Associate pin works with the commissioning pushbutton to provide additional diagnostics
behaviors to aid in deploying and testing a network. If the commissioning push button is pressed
once, and the device has not joined a network, the Associate pin blinks a numeric error code to
indicate the cause of join failure. The number of blinks is equal to (AI value 0x20). For example, if
AI=0x22, 2 blinks occur.
If the commissioning push button is pressed once, and the device has joined a network, the device
transmits a broadcast node identification packet. If the Associate LED functionality is enabled (D5
command), a device that receives this transmission will blink its Associate pin rapidly for 1 second.
The following figures demonstrate these behaviors.
Associate
(D5 = 1
Device not joined)
AD0/DIO0
A single comm issioning button press when the device has not joined a network that
causes the associate pin to blink to indicate the AI Code where : AI = # blinks + 0x20.
In this example, AI = 0x22.
Associate Pin
(D5 = 1)
AD0/DIO0 Pin
(Remote Device)
A single button press on a remote device causes a broadcast node identification transmission
to be sent. All devices that receive this transmission blink their associate pin rapidly for one
second if the associate LED functionality is enabled. (D5 = 1)
98
Binding
There are three binding request messages supported by the Digi XBee firmware: End Device Bind,
Bind, and Unbind.
End_Device_Bind_req
The End Device Bind request (ZDO cluster 0x0020) is described in the ZigBee Specification.
During a deployment, an installer may need to bind a switch to a light. He presses a commissioning
button sequence on each device. This causes them to send End_Device_Bind_req messages to the
Coordinator within a time window (60 s). The payload of each message is a simple descriptor which
lists input and output clusterIDs. The Coordinator matches the requests by pairing complementary
clusterIDs. After a match has been made, it sends messages to bind the devices together. When the
process is over, both devices will have entries in their binding tables which support indirect
addressing of messages between their bound endpoints.
R1->C End_Device_Bind_req
R2->C End_Device_Bind_req
R1, R2 send End_Device_Bind_req within 60 s of each other to C
C matches the requests.
C tests one to see if binding is already in place:
R2<-C Unbind_req
R2->C Unbind-rsp (status code - NO_ENTRY)
C proceeds to create binding table entries on the two devices.
R1<-C Bind_req
R1->C Bind_rsp
R2<-C Bind_req
R2->C Bind_rsp
C sends responses to the original End_Device_Bind_req messages.
R1-<C End_Device_Bind_rsp
R2-<C End_Device_Bind_rsp
End Device binding sequence (binding)
This message has a toggle action. If the same two devices were to subsequently send
End_Device_Bind_req messages to the Coordinator, the Coordinator would detect they were already
bound, and then send Unbind_req messages to remove the binding.
An installer can use this to remove a binding which was made incorrectly, say from a switch to the
wrong lamp, simply by repeating the commissioning button sequence he used beforehand.
R1->C End_Device_Bind_req
R2->C End_Device_Bind_req
R1, R2 send End_Device_Bind_req within 60 s of each other to C
C matches the requests.
C tests one to see if binding is already in place:
R2<-C Unbind_req
R2->C Unbind-rsp (status code - SUCCESS)
XBee/XBee-PRO ZB RF Modules User Guide
99
Frame Delimiter
0028
Frame Length
11
01
0000000000000000
Coordinator address
fffe
00
00
0020
0000
ProfileID (ZDO)
00
00
Transmit Options
01f2995cb5474000a21300e605c1010100010200
46
Checksum
Here is the RFData (the ZDO payload) broken into labeled fields. Note the multi-byte fields of a ZDO
payload are represented in little-endian format.
01
f299
5cb5474000a21300
e6
05c1
End_Device_Bind_requests
01
100
0100
01
0200
Example of a End_Device_Bind_req
Bind_req
The Bind request (ZDO cluster 0x0021) is described in the ZigBee Specification. A binding may be
coded for either a unicast or a multicast/groupID message.
Unbind_req
The Unbind request (ZDO cluster 0x0022) is described in the ZigBee Specification.
Add Group
The purpose of the Add Group command is to add a group table entry to associate an active endpoint
with a groupID and optionally a groupName. The groupID is a two byte value. The groupName
consists of zero to 16 ASCII characters.
The intent of the example which follows is to add a group table entry which associates endpoint E7
with groupID 1234 and groupName ABCD.
The example packet is given in three parts, the preamble, ZCL Header, and ZCL payload:
101
102
View Group
The purpose of the View Group command is to get the name string which is associated with a
particular endpoint and groupID.
The intent of the example is to get the name string associated with the endpoint E7 and groupID
1234.
The packet:
Preamble = 11 01 +LocalDevice64Addr+FFFE E6 E7 0006 C105 00 00"
The packet is addressed to the local node, using a source endpoint of 0xE6, clusterID of 0x0006, and
profileID of 0xC105. The destination endpoint E7 is the endpoint parameter for the View Group
command.
ZCL_header = 01 ee 01"
The first field is a frame control field which specifies a Cluster Specific command (0x01) using a Client>Server direction(0x00). The second field is a transaction sequence number which is used to
associate the response with the command request. The third field is the command identifier View
Group (0x01) [5].
ZCL_payload = 3412
The two byte value is the groupID in little-endian representation.
The packet in raw hex byte form:
7e001911010013a2004047b55cfffee6e70006c105000001ee013412d4
The response in raw hex byte form, consisting of two packets:
7e001d910013a2004047b55cfffee7e68006c1050009ee01003412044142434424
7e00078b01fffe00000076
The command response in decoded form:
ZigBee Explicit Rx Indicator
API 0x91 64DestAddr 0x0013A2004047B55C 16DestAddr 0xFFFE SrcEP 0xE7 DestEP 0xE6
ClusterID 0x8006 ProfileID 0xC105 Options 0x00
RF_Data 0x09EE010034120441424344
The response in terms of Preamble, ZCL Header, and ZCL payload:
Preamble = 910013a2004047b55cfffee7e68006c10500
The packet has its endpoint values reversed from the request, and the clusterID is 0x8006 indicating a
Group cluster response.
ZCL_header = 09 ee 01"
The first field is a frame control field which specifies a Cluster Specific command (0x01) using a
Server->Client direction (0x08). The second field is a transaction sequence number which is used to
associate the response with the command request. The third field is the command identifier View
Group (0x01) [6].
ZCL_payload = 00 3412 0441424344"
The first byte is a status byte (SUCCESS=0x00)[6][4]. The next two bytes hold the groupID (0x1234) in
little-endian form. The next byte is the name string length (0x04). The remaining bytes are the ASCII
name string characters (ABCD).
103
And here is the decoded second message, which is a Tx Status for the original command request. If
the FrameId value in the original command request had been zero, or if no space was available in the
transmit UART buffer, then no Tx Status message would occur.
ZigBee Tx Status
API 0x8B FrameID 0x01 16DestAddr 0xFFFE
Transmit Retries 0x00 Delivery Status 0x00 Discovery Status 0x00 Success
104
associate the response with the command request. The third field is the command identifier Get
Group Membership (0x02) [8].
ZCL_payload = FF 01 3412"
The first byte is the remaining capacity of the group table. 0xFF means unknown. The XBee returns
this value because the capacity of the group table is dependent on the remaining capacity of the
binding table, thus the capacity of the group table is unknown. The second byte is the group count
(0x01). The remaining bytes are the groupIDs in little-endian representation.
And here is the decoded second message, which is a Tx Status for the original command request. If
the FrameId value in the original command request had been zero, or if no space was available in the
transmit UART buffer, then no Tx Status message would occur.
ZigBee Tx Status
API 0x8B FrameID 0x01 16DestAddr 0xFFFE
Transmit Retries 0x00 Delivery Status 0x00 Discovery Status 0x00 Success
SrcEP 0xE7
DestEP 0xE6
Options 0x00
RF_Data 0x09EE02FF013412
105
FrameID 0x01
16DestAddr 0xFFFE
Transmit Retries 0x00 Delivery Status 0x00 Discovery Status 0x00 Success
Remove Group
The purpose of the Remote Group command is to remove a Group Table entry which associates a
given endpoint with a given groupID.
The intent of the example is to remove the association of groupID [TBD] with endpoint E7.
The example packet is given in three parts, the preamble, ZCL Header, and ZCL payload:
Preamble = 11 01 +LocalDevice64Addr+FFFE E6 E7 0006 C105 00 00"
The packet is addressed to the local node, using a source endpoint of 0xE6, clusterID of 0x0006, and
profileID of 0xC105. The destination endpoint E7 is the endpoint parameter for the Remove Group
command.
ZCL_header = 01 ee 03"
The first field is a frame control field which specifies a Cluster Specific command (0x01) using a Client>Server direction(0x00). The second field is a transaction sequence number which is used to
associate the response with the command request. The third field is the command identifier
Remove Group (0x03) [9].
ZCL_payload = 3412
The two bytes value is the groupID to be removed in little-endian representation.
The packet in raw hex byte form:
7e001911010013a2004047b55cfffee6e70006c105000001ee033412d2
The response in raw hex byte form, consisting of two packets:
7e0018910013a2004047b55cfffee7e68006c1050009ee0300341235
7e00078b01fffe00000076
106
SrcEP 0xE7
DestEP 0xE6
Options 0x00
RF_Data 0x09EE03003412
The response in terms of Preamble, ZCL Header, and ZCL payload:
Preamble = 910013a2004047b55cfffee7e68006c10500
The packet has its endpoint values reversed from the request, and the clusterID is 0x8006 indicating a
Group cluster response.
ZCL_header = 09 ee 03"
The first field is a frame control field which specifies a Cluster Specific command (0x01) using a
Server->Client direction (0x08). The second field is a transaction sequence number which is used to
associate the response with the command request. The third field is the command identifier
Remove Group (0x03) [10].
ZCL_payload = 00 3412"
The first byte is a status byte (SUCCESS=0x00)[10][4]. The next two bytes is the groupID (0x1234) value
in little-endian form.
And here is the decoded second message, which is a Tx Status for the original command request. If
the FrameId value in the original command request had been zero, or if no space was available in the
transmit UART buffer, then no Tx Status message would occur.
ZigBee Tx Status
API 0x8B
FrameID 0x01
16DestAddr 0xFFFE
Transmit Retries 0x00 Delivery Status 0x00 Discovery Status 0x00 Success
107
SrcEP 0xE7
DestEP 0xE6
Options 0x00
RF_Data 0x09ee0400
The response in terms of Preamble, ZCL Header, and ZCL payload.
Preamble = 910013a2004047b55cfffee7e68006c10500
The packet has its endpoints values reversed from the request, and the clusterID is 0x8006 indicating
a Group cluster response.
ZCL_header = 09 ee 04"
The first field is a frame control field which specifies a Cluster Specific command (0x01) using a
Server->Client direction (0x08). The second field is a transaction sequence number which is used to
associate the response with the command request. The third field is the command identifier
Remove All Groups (0x04) [10].
ZCL_payload = 00
The first byte is a status byte (SUCCESS=0x00)[4].
And here is the decoded second message, which is a Tx Status for the original command request. If
the FrameID value in the original command request had been zero, or if no space was available in the
transmit UART buffer, then no Tx Status message would occur.
ZigBee Tx Status
API 0x8B
FrameID 0x01
16DestAddr 0xFFFE
Transmit Retries 0x00 Delivery Status 0x00 Discovery Status 0x00 Success
Default responses
Many errors are returned as a default response. For example, a RFData payload of a response
containing
08010b788b would be decoded as:
ZCL_header = 08 01 03" - general command/server-to-client, transseqnum=1,
default_response_command(0x03)
ZCL_payload = 78 8b - original cmdID, status code (0x8b) EMBER_ZCL_STATUS_NOT_FOUND
108
Bibliography
[1] ZigBee Cluster Library, document 075123r02, section 3.6.
The following cross references all appear in the ZigBee Cluster Library document:
[2] Add Group Command, section [Link].3.
[3] Add Group Response, section [Link].1.
[4] Status Enumerations, section 2.5.3.
[5] View Group Command, section [Link].4.
[6] View Group Response, section [Link].2.
[7] Get Group Membership Command, section [Link].5.
[8] Get Group Membership Response, section [Link].3.
[9] Remove Group Command, section [Link].6.
[10] Remove Group Response, section [Link].4.
[11] Remove All Groups Command, section [Link].7.
109
110
Parent operation
If the end device receives the acknowledgment and finds that the parent has no data for it, the end
device can return to idle mode or sleep. Otherwise, it will remain awake to receive the data. This
polling mechanism allows the end device to enter idle mode and turn its receiver off when RF data is
not expected in order to reduce current consumption and conserve battery life.
The end device can only send data directly to its parent. If an end device must send a broadcast or a
unicast transmission to other devices in the network, it sends the message directly to its parent and
the parent performs any necessary route or address discoveries to route the packet to the final
destination.
Parent operation
Each router or coordinator maintains a child table that contains the addresses of its end device
children. A router or coordinator that has unused entries in its child table is said to have end device
capacity, or the ability to allow new end devices to join. If the child table is completely filled (such that
the number of its end device children matches the number of child table entries), the device cannot
allow any more end devices to join to it.
Since the end device children are not guaranteed to be awake at a given time, the parent is
responsible for managing incoming data packets in behalf of its end device children. If a parent
receives an RF data transmission destined for one of its end device children, and if the parent has
enough unused buffer space, it will buffer the packet. The data packet will remain buffered until a
timeout expires, or until the end device sends a poll request to retrieve the data.
The parent can buffer one broadcast transmission for all of its end device children. When a broadcast
transmission is received and buffered, the parent sets a flag in its child table when each child polls
and retrieves the packet. Once all children have received the broadcast packet, the buffered
broadcast packet is discarded. If all children have not received a buffered broadcast packet and a
new broadcast is received, the old broadcast packet is discarded, the child table flags are cleared, and
the new broadcast packet is buffered for the end device children. This is demonstrated in the figure
below.
When an end device sends data to its parent that is destined for a remote device in the network, the
parent buffers the data packet until it can establish a route to the destination. The parent may
perform a route or 16-bit address discovery in behalf of its end device children. Once a route is
established, the parent sends the data transmission to the remote device.
111
child table. This allows the child table on a router or coordinator to better accommodate mobile end
devices in the network.
Stack broadcasts (e.g. ZDO Device Announce messages when devices join a network)
Applications that use regular broadcasting or that require regular address or route discoveries will
use up a significant number of buffers, reducing the buffer availability for managing packets for end
device children. Applications should reduce the number of required application broadcasts, and
consider implementing an external address table or many-to-one and source routing if necessary to
improve routing efficiency.
Pin Sleep
Cyclic Sleep
Pin sleep allows an external microcontroller to determine when the XBee should sleep and when it
should wake by controlling the Sleep_RQ pin. In contrast, cyclic sleep allows the sleep period and
wake times to be configured through the use of AT commands. Cyclic sleep with pin wake-up is the
same as cyclic sleep except that the module can be awakened before the sleep period expires by
lowering the Sleep_Rq line. The sleep mode is configurable with the SM command.
In both pin and cyclic sleep modes, XBee end devices poll their parent every 100ms while they are
awake to retrieve buffered data. When a poll request has been sent, the end device enables the
receiver until an acknowledgment is received from the parent. (It generally takes less than 10ms from
the time the poll request is sent until the acknowledgment is received.) The acknowledgment
112
indicates if the parent has buffered data for the end device child or not. If the acknowledgment
indicates the parent has pending data, the end device will leave the receiver on to receive the data.
Otherwise, the end device will turn off the receiver and enter idle mode (until the next poll request is
sent) to reduce current consumption (and improve battery life).
Once the module enters sleep mode, the On/Sleep pin (pin 26/SMT, pin13/TH) is de-asserted (low) to
indicate the module is entering sleep mode. If CTS hardware flow control is enabled (D7 command),
the CTS pin (pin 25/SMT, pin 12/TH) is de-asserted (high) when entering sleep to indicate that serial
data should not be sent to the module. If the Associate LED pin is configured (D5 command), the
associate pin will be driven low to avoid using power to light the LED. Finally, the Sleep_Rq pin will be
configured as a pulled-down input so that an external device must drive it high to wake the module.
All other pins will be left unmodified during sleep so that they can operate as previously configured
by the user. The module will not respond to serial or RF data when it is sleeping. Applications that
must communicate serially to sleeping end devices are encouraged to observe CTS flow control.
When the XBee wakes from sleep, the On/Sleep pin is asserted (high), and if flow control is enabled,
the CTS pin is also asserted (low). The associate LED and all other pins resume their former
configured operation. If the module has not joined a network, it will scan all SC channels after waking
to try and find a valid network to join.
Pin sleep
Pin sleep allows the module to sleep and wake according to the state of the Sleep_RQ pin (pin 10/
SMT, pin 9/TH). Pin sleep mode is enabled by setting the SM command to 1.
When Sleep_RQ is asserted (high), the module will finish any transmit or receive operations and enter
a low power state. For example, if the module has not joined a network and Sleep_RQ is asserted
(high), the module will sleep once the current join attempt completes (i.e. when scanning for a valid
network completes). The module will wake from pin sleep when the Sleep_RQ pin is de-asserted
(low). The following figure shows the XBee SMT pin sleep pins.
113
In the figure above, t1, t2, t3 and t4 represent the following events:
t2 - Time when the XBee enters sleep (CTS state change only if hardware flow control is enabled)
The time between t1 and t2 varies depending on the state of the module. In the worst case scenario, if
the end device is trying to join a network, or if it is waiting for an acknowledgment from a data
transmission, the delay could be up to a few seconds. the time between t3 and t4 is 1-2 ms for a
regular module and about 6 ms for a PRO module.
When the XBee is awake and is joined to a network, it sends a poll request to its parent to see if the
parent has any buffered data for it. The end device will continue to send poll requests every 100ms
while it is awake.
114
Cyclic sleep
Cyclic sleep allows the module to sleep for a specified time and wake for a short time to poll its
parent for any buffered data messages before returning to sleep again. Cyclic sleep mode is enabled
by setting the SM command to 4 or 5. SM5 is a slight variation of SM4 that allows the module to be
woken prematurely by asserting the Sleep_RQ pin (pin 10/SMT, pin 9/TH). In SM5, the XBee can wake
after the sleep period expires, or if a high-to-low transition occurs on the Sleep_RQ pin. Setting SM to
4 disables the pin wake option.
In cyclic sleep, the module sleeps for a specified time, and then wakes and sends a poll request to its
parent to discover if the parent has any pending data for the end device. If the parent has buffered
data for the end device, or if serial data is received, the XBee will remain awake for a time. Otherwise,
it will enter sleep mode immediately.
The On/Sleep line is asserted (high) when the module wakes, and is de-asserted (low) when the
module sleeps. If hardware flow control is enabled (D7 command), the CTS pin will assert (low) when
the module wakes and can receive serial data, and de-assert (high) when the module sleeps.
The following figure shows the XBee SMT cyclic sleep pins.
115
The following figures shows the XBee S2C TH cyclic sleep pins.
In the figure above, t1, t2, and t3 represent the following events:
The wake time and sleep time are configurable with software commands as described in the sections
below.
116
DIN
ST = Time Awake
On/Sleep
A cyclic sleep end device enters sleep mode when no serial or RF data is received for ST time .
Legend
On/Sleep
Transmitting Poll
Request
Sleep period
The sleep period is configured based on the SP, SN, and SO commands. The following table lists the
behavior of these commands.
Command
SP
SN
Range
0x20 - 0xAF0 (x 10 ms)
(320 - 28,000 ms)
1 - 0xFFFF
Description
Configures the sleep period of the module.
Configures the number of sleep periods multiplier.
Defines options for sleep mode behavior.
SO
0 - 0xFF
The XBee module supports both a short cyclic sleep and an extended cyclic sleep that make use of
these commands. These two modes allow the sleep period to be configured according to the
application requirements.
117
regular intervals to poll its parent for data without waking an external device for an extended time
(SP * SN time). This following figure shows this.
On/Sleep
(SN = 3)
On/Sleep
(SN = 1)
t = SP * SN
t = SP * SN
Setting SN > 1 allows the XBee to silently poll for data without asserting On /Sleep. If RF data is received
when polling, On/Sleep will immediately assert .
Legend
Sleep_RQ
Transmitting Poll
Request
Note SP controls the packet buffer time on routers and coordinators. SP should be set on all router
and coordinator devices to match the longest end device SP time. See the XBee Router /
Coordinator Configuration section for details.
118
Deep sleep
There are preconditions for maintaining low current draw during sleep:
You must maintain the supply voltage within a valid operating range (2.1 to 3.6 V for the XBee, 3.0
to 3.6 V for the XBee-PRO (S2), 2.7 to 3. V for the XBee-PRO S2B).
Each GPIO input line with a pullup resistor which is driven low draws about 100 uA current
through the internal pullup resistor.
If circuitry external to the XBee drives such input lines low, then the current draw rises above
expected deep sleep levels.
Each GPIO input line that has no pullup or pull-down resistor (is floating) has an indeterminate
voltage which can change over time and temperature in an indeterminate manner.
119
Internal pin pull-ups can pull excess current and cause the sleep current readings to be higher than
desired if you drive or float the pull-ups. Disable all pull-ups for input lines that have a low driven
state during sleep. Enable pull-ups for floating lines or inputs that do not connect to other circuitry. If
you use an analog-to-digital converter (ADC) to read the analog voltage of a pin, it may not be
possible to stop all leakage current unless you can disconnect the voltage during sleep. Each floating
input that is not at a valid high or low level can cause leakage depending on the temperature and
charge buildup that you may not observe at room temperature.
Transmitting RF data
An end device may transmit data when it wakes from sleep and has joined a network. End devices
transmit directly to their parent and then wait for an acknowledgment to be received. The parent will
perform any required address and route discoveries to help ensure the packet reaches the intended
destination before reporting the transmission status to the end device.
Receiving RF data
After waking from sleep, an end device sends a poll request to its parent to determine if the parent
has any buffered data for it. In pin sleep mode, the end device polls every 100ms while the Sleep_RQ
pin is de-asserted (low). In cyclic sleep mode, the end device will only poll once before returning to
sleep unless the sleep timer (ST) is started (serial or RF data is received). If the sleep timer is started,
the end device will continue to poll every 100 ms until the sleep timer expires.
XBee/XBee-PRO ZB RF Modules User Guide
120
This firmware includes an adaptive polling enhancement where, if an end device receives RF data
from its parent, it sends another poll after a very short delay to check for more data. The end device
continues to poll at a faster rate as long as it receives data from its parent. This feature greatly
improves data throughput to end devices. When the end device no longer receives data from its
parent, it resumes polling every 100 ms.
I/O sampling
End devices can be configured to send one or more I/O samples when they wake from sleep. To
enable I/O sampling on an end device, the IR command must be set to a non-zero value, and at least
one analog or digital I/O pin must be enabled for sampling (D0 - D9, P0-P4 commands). If I/O
sampling is enabled, an end device sends an I/O sample when it wakes and starts the ST timer. It will
continue sampling at the IR rate until the sleep timer (ST) has expired. See XBee analog and digital I/O
lines on page 126 for details.
Parent verification
Since an end device relies on its parent to maintain connectivity with other devices in the network,
XBee end devices include provisions to verify its connection with its parent. End devices monitor their
link with their parent when sending poll messages and after a power cycle or reset event as
described below.
When an end device wakes from sleep, it sends a poll request to its parent. In cyclic sleep, if RF or
serial data is not received and the sleep timer is not started, the end device polls one time and
returns to sleep for another sleep period. Otherwise, the end device continues polling every 100ms. If
the parent does not send an acknowledgment response to three consecutive poll request
transmissions, the end device assumes the parent is out of range, and attempts to find a new parent.
After a power-up or reset event, the end device does an orphan scan to locate its parent. If the parent
does not send a response to the orphan scan, the end device attempts to find a new parent.
Rejoining
Once all devices have joined a ZigBee network, the permit-joining attribute should be disabled such
that new devices are no longer allowed to join the network. Permit-joining can be enabled later as
needed for short times. This provides some protection in preventing other devices from joining a live
network.
If an end device cannot communicate with its parent, the end device must be able to join a new
parent to maintain network connectivity. However, if permit-joining is disabled in the network, the
end device will not find a device that is allowing new joins.
To overcome this problem, ZigBee supports rejoining, where an end device can obtain a new parent
in the same network even if joining is not enabled. When an end device joins using rejoining, it
performs a PAN ID scan to discover nearby networks. If a network is discovered that has the same 64bit PAN ID as the end device, it will join the network by sending a rejoin request to one of the
discovered devices. The device that receives the rejoin request will send a rejoin response if it can
allow the device to join the network (i.e. child table not full). The rejoin mechanism can be used to
allow a device to join the same network even if permit-joining is disabled.
121
To enable rejoining, NJ should be set less than 0xFF on the device that will join. If NJ < 0xFF, the device
assumes the network is not allowing joining and first tries to join a network using rejoining. If
multiple rejoining attempts fail, or if NJ=0xFF, the device will attempt to join using association.
Transmission timeout
The value of these timeouts depends on the sleep time used by the end devices. Each of these
timeouts are discussed below.
Adaptive polling
The PO command determines the regular polling rate. However, if RF data has been recently received
by an end device, it is likely that yet more RF data could be on the way. Therefore, the end device will
122
poll at a faster rate, gradually decreasing its adaptive poll rate until polling resumes at the regular
rate as defined by the PO command.
Transmission timeout
As mentioned in Transmission, addressing, and routing on page 64, when sending RF data to a
remote router, since routers are always on, the timeout is based on the number of hops the
transmission may traverse. This timeout it settable using the NH command; see Transmission,
addressing, and routing on page 64 for details.
Since end devices may sleep for lengthy periods of time, the transmission timeout to end devices also
includes some allowance for the sleep period of the end device. When sending data to a remote end
device, the transmission timeout is calculated using the SP and NH commands. If the timeout occurs
and an acknowledgment has not been received, the source device will resend the transmission until
an acknowledgment is received, up to two more times.
The transmission timeout per attempt is:
3 * ((unicast router timeout) + (end device sleep time)), or
3 * ((50 * NH) + (1.2 * SP)), where SP is measured in 10ms units.
Sleep examples
This section covers some sample XBee configurations to support different sleep modes. Several AT
commands are listed with suggested parameter values. The notation in this section includes an '='
sign to indicate what each command register should be set to - for example, SM=4. This is not the
correct notation for setting command values in the XBee. In AT command mode, each command is
issued with a leading 'AT' and no '=' sign - for example ATSM4. In the API, the two byte command is
used in the command field, and parameters are populated as binary values in the parameter field.
Example 1: configure a device to sleep for 20 seconds, but set SN such that the On/
sleep line will remain de-asserted for up to 1 minute.
The following settings should be configured on the end device.
XBee/XBee-PRO ZB RF Modules User Guide
123
Sleep examples
124
Sleep examples
IR = 0x800 (send 1 IO sample after waking). At least one analog or digital IO sample should be
enabled for IO sampling.
With these settings, the end device will wake after 4 minutes and send 1 IO sample. It will then
remain awake for 2 seconds before returning to sleep.
SP and SN should be set to the same values on all routers and coordinators that could allow the end
device to join. This will ensure the parent does not timeout the end device from its child table too
quickly.
The SI command can optionally be sent to the end device to cause it to sleep before the sleep timer
expires.
125
Module Pin
DOUT/DIO13
P3
0, 1, 3-5
DIN/CONFIG/DIO14
P4
0, 1, 3-5
PWM RSSI/DIO10
P0
0, 1, 3-5
PWM1/DIO11
P1
0, 1, 3-5
DTR/Slp_Rq/DIO8
10
D8
0, 1, 3-5
PTI_DATA/SPI_Attn/ADC5/DIO19
12
P9
0, 1, 6
SPI_SClk/DIO18
14
P8
0, 1
SPI_SSel/DIO17
15
P7
0, 1
SPI_MOSI/DIO16
16
P6
0, 1
SPI_MISO/DIO15
17
P5
0,1
JTMS/SWDIO/DIO12/CD
21
P2
0, 3-5
JTRst/DIO4
24
D4
0, 3-5
CTS/DIO7
25
D7
0, 1, 3-7
JTDO/On_SLP/DIO9
26
D9
0, 1, 3-5
JTDI/Assoc/DIO5
28
D5
0, 1, 3-5
RTS/DIO6/SClk2
29
D6
0, 1, 3-5
AD3/DIO3
30
D3
0, 2-5
126
I/O configuration
Module Pin
AD2/DIO2
31
D2
0, 2-5
PTI_En/AD1/DIO1
32
D1
0, 2-6
AD0/DIO0/Comm
33
D0
0-5
Module Pin
AT Command
DIO13/DOUT
P3
0, 1, 3-5
DIO14/DIN/nCONFIG
P4
0, 1, 3-5
DIO12/PWM2/SWDIO/SPI_MISO
P2
0, 1, 3-5
DIO10/PWM RSSI/DAC0
P0
0, 1, 3-5
DIO11/PWM1/DAC1
P1
0, 1, 3-5
DIO8/nDTR/SLP_RQ
D8
0, 1, 3-5
DIO4/SPI_MOSI
11
D4
0, 1, 3-5
DIO7/nCTS
12
D7
0, 1, 3-7
DIO9/On/nSLEEP/SWO
13
D9
0, 1, 3-5
DIO5/ASSOC/JTDI
15
D5
0, 1, 3-5
DIO6/nRTS
16
D6
0, 1, 3-5
DIO3/AD3/SPI_nSSEL
17
D3
0-5
DIO2/AD2/SPI_SCLK
18
D2
0-5
DIO1/AD1/SPI_nATTN
19
D1
0-6
DIO0/AD0/CommBtn
20
D0
0-5
Command Range
I/O configuration
To enable an analog or digital I/O function on one or more XBee module pin(s), the appropriate
configuration command must be issued with the correct parameter. After issuing the configuration
command, changes must be applied on the module for the I/O settings to take effect.
Pin Command Parameter
Description
Peripheral control
Analog
127
I/O sampling
Description
>7
Unsupported
When the pin command parameter is a 0 or a 3, it operates the same on this platform, except that the
pin will not be monitored by I/O sampling if the parameter is 0.
Inputs have three variations:
floating
pulled-up
pulled-down
A floating input is appropriate if the pin is attached to an output that always drives the line. In this
case, a pull-up or pull-down resistor would cause more current to be drawn.
A pulled-up input is useful where there might not always be an external source to drive the pin and it
is desirable to have the line read high in the absence of an external driver.
Likewise, a pulled-down input is useful when there is not always an external source to drive the pin
and it is desirable to have the line read low in the absence of an external driver.
Two commands are available to configure the input type:
PR determines whether or not an input is pulled. If the corresponding bit in PR is set, then the
signal will be pulled. If it is clear, then the signal will be floating
PD determines the pull direction. It only applies when the corresponding bit in PR is set. The bit in
PD should be set to enable an internal pull-up resistor. It should be cleared to enable an internal
pull-down resistor
I/O sampling
The XBee ZB modules have the ability to monitor and sample the analog and digital I/O lines. I/O
samples can be read locally or transmitted to a remote device to provide indication of the current I/O
line states. API mode must be enabled on the receiving device in order to send I/O samples out the
serial port. If this mode is not enabled, then remote I/O samples will be discarded
There are three ways to obtain I/O samples, either locally or remotely:
Queried Sampling
Periodic Sampling
128
I/O sampling
Bytes
Name
Description
Sample Sets
Digital Channel
Mask
Indicates which digital IO lines have sampling enabled. Each bit corresponds to
one digital IO line on the module.
bit 0 = AD0/DIO0
bit 1 = AD1/DIO1
bit 2 = AD2/DIO2
bit 3 = AD3/DIO3
bit 4 = DIO4
bit 5 = ASSOC/DIO5
bit 6 = RTS/DIO6
bit 7 = CTS/GPIO7
bit 8 = Slp_Rq/DIO8
bit 9 = On_Slp/DIO9
bit 10 = RSSI/DIO10
bit 11 = PWM/DIO11
bit 12 = CD/DIO12
bit 13 = DOUT/DIO13
bit 14 = DIN/DIO14
For example, a digital channel mask of 0x002F means DIO0,1,2,3, and 5 are
enabled as digital I/O.
Analog Channel
Mask
Indicates which lines have analog inputs enabled for sampling. Each bit in the
analog channel mask corresponds to one analog input channel.
bit 0 = AD0/DIO0
bit 1 = AD1/DIO1
bit 2 = AD2/DIO2
bit 3 = AD3/DIO3
bit 7 = Supply Voltage
Variable
Sampled Data
Set
A sample set consisting of 1 sample for each enabled ADC and/or DIO channel,
which has voltage inputs of 1143.75 and 342.1875mV.
If any digital I/O lines are enabled, the first two bytes of the data set indicate the
state of all enabled digital I/O. Only digital channels that are enabled in the Digital
Channel Mask bytes have any meaning in the sample set. If no digital I/O are
enabled on the device, these 2 bytes will be omitted.
Following the digital I/O data (if any), each enabled analog channel will return 2
bytes. The data starts with AIN0 and continues sequentially for each enabled
analog input channel up to AIN3, and the supply voltage (if enabled) at the end.
129
I/O sampling
The sampled data set will include 2 bytes of digital I/O data only if one or more I/O lines on the device
are configured as digital I/O. If no pins are configured as digital IO, these 2 bytes will be omitted. Pins
are configured as digital I/O by setting them to a value of 3, 4, or 5.
The digital I/O data is only relevant if the same bit is enabled in the digital I/O mask.
Analog samples are returned as 10-bit values. The analog reading is scaled such that 0x0000
represents 0 V, and 0x3FF = 1.2 V. (The analog inputs on the module cannot read more than 1.2 V.)
Analog samples are returned in order starting with AIN0 and finishing with AIN3, and the supply
voltage. Only enabled analog input channels return data as shown in the figure below.
To convert the A/D reading to mV, do the following:
AD(mV) = (A/D reading * 1200mV) / 1023
The reading in the sample frame represents voltage inputs of 1143.75 and 342.1875 mV for AD0 and
AD1 respectively.
Queried sampling
The IS command can be sent to a device locally, or to a remote device using the API remote command
frame (see ZigBee API Operation on page 133 for details). When the IS command is sent, the receiving
device samples all enabled digital IO and analog input channels and returns an IO sample. If IS is sent
locally, the IO sample is sent out the serial port. If the IS command was received as a remote
command, the IO sample is sent over-the-air to the device that sent the IS command.
If the IS command is issued in command mode, the module returns a carriage return-delimited list
containing the above-listed fields. If the IS command is issued in API mode, an API command
response contains the same information.
The following table shows an example of the fields in an IS response.
Example
Sample AT Response
0x01
[1 sample set]
0x0C0C
0x03
0x0408
0x03D0
0x0124
130
RSSI PWM
RSSI PWM
The XBee module features an RSSI/PWM pin (pin 7/SMT, pin 6/TH) that, if enabled, will adjust the
PWM output to indicate the signal strength of the last received packet. The P0 (P-zero) command is
used to enable the RSSI pulse width modulation (PWM) output on the pin. If P0 is set to 1 (and P1 is
not set to 1), the RSSI/PWM pin will output a pulse width modulated signal where the frequency is
adjusted based on the received signal strength of the last packet. Otherwise, for all other P0 settings,
the pin can be used for general purpose IO.
When a data packet is received, if P0 is set to enable the RSSI/PWM feature, the RSSI PWM output is
adjusted based on the RSSI of the last packet. The RSSI/PWM output will be enabled for a time based
on the RP command. Each time an RF packet is received, the RSSI/PWM output is adjusted based on
the RSSI of the new packet, and the RSSI timer is reset. If the RSSI timer expires, the RSSI/PWM pin is
driven low. RP is measured in 100ms units and defaults to a value of 40 (4 seconds).
The RSSI PWM runs at 12MHz and has 2400 total counts (200us period).
RSSI (in dBm) is converted to PWM counts using the following equation:
PWM counts = (41 * RSSI_Unsigned) - 5928
I/O examples
Example 1: configure the following I/O settings on the XBee
Configure AD1/DIO1 as a digital input with pullup resistor enabled
Configure AD2/DIO2 as an analog input
Configure DIO4 as a digital output, driving high.
To configure AD1/DIO1 as an input, issue the ATD1 command with a parameter of 3 (ATD13). To
enable pull-up resistors on the same pin, the PR command should be issued with bit 3 set (e.g. ATPR8,
ATPR1FFF, etc.).
The ATD2 command should be issued with a parameter of 2 to enable the analog input (ATD22).
Finally, DIO4 can be set as an output, driving high by issuing the ATD4 command with a parameter
value of 5 (ATD45).
After issuing these commands, changes must be applied before the module IO pins will be updated
to the new states. The AC or CN commands can be issued to apply changes (e.g. ATAC).
Example 2: calculate the PWM counts for a packet received with an RSSI of -84dBm
RSSI = -84 = 0xAC = 172 decimal (unsigned)
PWM counts = (41 * 172) - 5928
PWM counts = 1124
With a total of 2400 counts, this yields an ON time of (1124 / 2400) = 46.8%
131
PWM1
Example 3: configure the RSSI/PWM pin to operate for 2 seconds after each received
RF packet
First, ensure the RSSI/PWM functionality is enabled by reading the P0 (P-zero) command. It should be
set to 1 (default).
To configure the duration of the RSSI/PWM output, set the RP command. To achieve a 2 second PWM
output, set RP to 0x14 (20 decimal, or 2 seconds) and apply changes (AC command).
After applying changes, all received RF data packets should set the RSSI timer for 2 seconds.
PWM1
When P1 is configured for peripheral operation by setting the value to 1, it outputs a 50% duty cycle
PWM with a clock rate of 32,787 Hz, which is a period of 30.5 s. The main purpose of the PWM
output is to provide a clock for the PLUS processor, although it may also be used for other purposes.
*When this feature is enabled, the RSSI PWM output is automatically disabled, even if it is configured.
132
AP = 1: API Operation
0x7E
Length
(Bytes 2-3)
MSB
LSB
Frame Data
(Bytes 4-n)
Checksum
(Byte n + 1)
API-specific Structure
1 Byte
133
Length
(Bytes 2-3)
0x7E
MSB
LSB
Frame Data
(Bytes 4-n)
Checksum
(Byte n + 1)
API-specific Structure
1 Byte
0x7D Escape
0x11 XON
0x13 XOFF
In the above example, the length of the raw data (excluding the checksum) is 0x0002 and the
checksum of the non-escaped data (excluding frame delimiter and length) is calculated as:
0xFF - (0x23 + 0x11) = (0xFF - 0x34) = 0xCB.
Length
The length field has a two-byte value that specifies the number of bytes that will be contained in the
frame data field. It does not include the checksum field.
Frame data
The following figure shows the serial port data frame and API-specific structure:
Start Delimiter
(Byte 1)
0x7E
Length
(Bytes 2-3)
MSB
LSB
Frame Data
(Bytes 4-n)
Checksum
(Byte n + 1)
API-specific Structure
1 Byte
API Identifier
Identifier-specific Data
cmdID
cmdData
134
The cmdID frame (API-identifier) indicates which API messages will be contained in the cmdData
frame (Identifier-specific data). Note that multi-byte values are sent big [Link] XBee modules
support the following API frames:
API Frame Names
API ID
AT Command
0x08
0x09
0x10
0x11
0x17
0x21
AT Command Response
0x88
Modem Status
0x8A
0x8B
0x90
0x91
0x92
0x94
0x95
0x97
0x98
0xA0
0xA1
0xA3
Checksum
To test data integrity, a checksum is calculated and verified on non-escaped data.
To calculate: Not including frame delimiters and length, add all bytes keeping only the lowest 8 bits
of the result and subtract the result from 0xFF.
To verify: Add all bytes (include checksum, but not the delimiter and length). If the checksum is
correct, the sum will equal 0xFF.
135
API examples
Example: create an API AT command frame to configure an XBee to allow joining (set
NJ to 0xFF).
The frame should look like:
0x7E 0x00 0x05 0x08 0x01 0x4E 0x4A 0xFF 5F
Where 0x0005 = length
0x08 = AT Command API frame type
0x01 = Frame ID (set to non-zero value)
0x4E4A = AT Command ('NJ')
0xFF = value to set command to
0x5F = Checksum
The checksum is calculated as [0xFF - (0x08 + 0x01 + 0x4E + 0x4A + 0xFF)]
136
Remote AT commands
The following image shows the API frame exchanges that take place at the serial port when sending a
remote AT command. A remote command response frame is not sent out the serial port if the
remote device does not receive the remote command.
137
Source routing
The following image shows the API frame exchanges that take place at the serial port when sending a
source routed transmission.
138
API frames
API frames
The following sections illustrate the types of frames encountered while using the API.
AT command
Frame Type: 0x08
Used to query or set module parameters on the local device. This API command applies changes after
executing the command. (Changes made to module parameters take effect once changes are
applied.) The API example below illustrates an API frame when modifying the NJ parameter value of
the module
Frame Fields
Offset Example
Start
Delimiter
Length
MSB 1 0x00
Framespecific Data
Description
0x7E
Number of bytes between the length and the checksum
LSB 2
0x04
Frame Type
0x08
Frame ID
0x52 (R)
Identifies the serial port data frame for the host to correlate
with a subsequent ACK (acknowledgment). If set to 0, no
response is sent.
AT Command
0x4E (N)
0x4A (J)
139
API frames
Frame Fields
Offset Example
Parameter
Value
(optional)
Checksum
Description
If present, indicates the requested parameter value to set
the given register.
If no characters present, register is queried.
0x0D
Offset Example
Start
Delimiter
Length
MSB 1 0x00
Framespecific Data
0x7E
Number of bytes between the length and the checksum
LSB 2
0x05
Frame Type
0x09
Frame ID
0x01
Identifies the serial port data frame for the host to correlate
with a subsequent ACK (acknowledgment). If set to 0, no
response is sent.
AT Command
0x42 (B)
0x44 (D)
0x07
0x68
Parameter
Value
(ATBD7 =
115200 baud)
Checksum
Description
Note In this example, the parameter could have been sent as a zero-padded 2-byte or 4-byte value.
140
API frames
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x16
0x10
Framespecific Data
Frame Type
Description
141
API frames
Frame Fields
Offset
Example
Description
Frame ID
0x01
64-bit
Destination
MSB 5
0x00
Address
0x13
0xA2
0x00
0x40
10
0x0A
11
0x01
LSB 12
0x27
MSB 13
0xFF
LSB 14
0xFE
15
0x00
16-bit
Destination
Network
Address
Broadcast
Radius
Checksum
Options
16
0x00
RF Data
17
0x54
18
0x78
19
0x44
20
0x61
21
0x74
22
0x61
23
0x30
24
0x41
25
0x13
API frames
Example: The example above shows how to send a transmission to a module where escaping is
disabled (AP=1) with destination address 0x0013A200 40014011, payload TxData1B. If escaping is
enabled (AP=2), the frame should look like:
0x7E 0x00 0x16 0x10 0x01 0x00 0x7D 0x33 0xA2 0x00 0x40 0x0A 0x01 0x27
0xFF 0xFE 0x00 0x00 0x54 0x78 0x44 0x61 0x74 0x61 0x30 0x41 0x7D 0x33
The checksum is calculated (on all non-escaped bytes) as [0xFF - (sum of all bytes from API frame type
through data payload)].
Example: Send a transmission to the coordinator without specifying the coordinator's 64-bit address.
The API transmit request frame should look like:
0x7E 0x00 0x16 0x10 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFE 0x00 0x00 0x54 0x78
032 0x43 0x6F 0x6F 0x72 0x64 0xFC
Where 0x16 = length (22 bytes excluding checksum)
0x10 = ZigBee Transmit Request API frame type
0x01 = Frame ID (set to non-zero value)
0x0000000000000000 = Coordinator's address (can be replaced with coordinator's actual 64-bit
address if known
0xFFFE = 16-bit Destination Address
0x00 = Broadcast radius
0x00 = Options
0x547832436F6F7264 = Data payload (Tx2Coord)
0xFC = Checksum
143
API frames
Frame Fields
Offset
Example
Description
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x1A
Frame Type
0x11
Frame ID
0x01
64-bit
Destination
MSB 5
0x00
0x00
0x00
0x00
0x00
10
0x00
11
0x00
12
0x00
Framespecific Data
Address
LSB 14
0xFE
Source
Endpoint
15
0xA0
Destination
Endpoint
16
0xA1
Cluster ID
17
0x15
18
0x54
19
0xC1
20
0x05
21
0x00
16-bit
Destination
Network
Address
Profile ID
Broadcast
Radius
MSB 13 0xFF
144
API frames
Frame Fields
Transmit
Options
Offset
22
Example
0x00
Description
Bitfield of supported transmission options. Supported
values include the following:
0x01 - Disable retries
0x04- Indirect Addressing
0x08- Multicast Addressing
0x20 - Enable APS encryption (if EE=1)
0x40 - Use the extended transmission timeout for this
destination
Enabling APS encryption decreases the maximum number
of RF payload bytes by 4 (below the value reported by NP).
Setting the extended timeout bit causes the stack to set the
extended transmission timeout for the destination
address. See Transmission, addressing, and routing on
page 64.
All unused and unsupported bits must be set to 0.
Data Payload
Checksum
23
0x54
24
0x78
25
0x44
26
0x61
27
0x74
28
0x61
29
0x3A
Example: Send a data transmission to the coordinator (64-bit address of 0x00s) using a source
endpoint of 0xA0, destination endpoint 0xA1, cluster ID =0x1554, and profile ID 0xC105. Payload will
be TxData.
145
API frames
Offset
Example
Description
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x10
Frame Type
0x17
Frame ID
0x01
64-bit
Destination
MSB 5
0x00
0x13
0xA2
0x00
0x40
10
0x40
11
0x11
LSB 12
0x22
MSB 13
0xFF
LSB 14
0xFE
15
0x02
Bitfield to enable various remote command options.
(apply
Supported values include:
changes) 0x01 - Disable ACK
0x02 - Apply changes on remote. (If not set, AC command
must be sent before changes will take effect.)
0x40 - Use the extended transmission timeout for this
destination.
Setting the extended timeout bit causes the stack to set
the extended transmission timeout for the destination
address. See Transmission, addressing, and routing on
page 64.
All unused and unsupported bits must be set to 0.
Address
Framespecific Data
16-bit
Destination
Network
Address
Remote
Command
Options
146
API frames
Frame Fields
AT Command
Framespecific data
Command
Parameter
Checksum
Offset
Example
Description
16
0x42 (B)
17
0x48 (H)
18
0x01
19
0xF5
Example: Send a remote command to change the broadcast hops register on a remote device to 1
(broadcasts go to 1-hop neighbors only), and apply changes so the new configuration value
immediately takes effect. In this example, the 64-bit address of the remote is 0x0013A200 40401122,
and the destination 16-bit address is unknown.
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x14
Frame Type
0x21
Frame ID
0x00
64-bit
Destination
MSB 5
0x00
0x13
0xA2
0x00
0x40
10
0x40
11
0x11
LSB 12
0x22
Address
Framespecific Data
Description
147
API frames
Frame Fields
Offset
Example
16-bit
Destination
MSB
13
0x33
Network
Address
LSB 14
0x44
Route
Command
Options
15
0x00
Set to 0.
Number of
Addresses
16
0x03
Address 1
17
0xEE
(neighbor of destination)
18
0xFF
19
0xCC
20
0xDD
21
0xAA
22
0xBB
23
0x01
Framespecific
Data
Address 2
(closer hop
Address 3
Checksum
Description
Set to the 16-bit address of the destination device, if
known. Set to 0xFFFE if the address is unknown, or if
sending a broadcast.
(neighbor of source)
Example: Intermediate hop addresses must be ordered starting with the neighbor of the destination,
and working closer to the source. For example, suppose a route is found between A and E as shown
below.
A'B'C'D'E
If device E has the 64-bit and 16-bit addresses of 0x0013A200 40401122 and 0x3344, and if devices B,
C, and D have the following 16-bit addresses:
B = 0xAABB
C = 0xCCDD
D = 0xEEFF
The example above shows how to send the Create Source Route frame to establish a source route
between A and E.
148
API frames
AT Command Response
Frame Type: 0x88
In response to an AT Command message, the module will send an AT Command Response message.
Some commands will send back multiple frames (for example, the ND (Node Discover) command).
Frame Fields
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1 0x00
Framespecific Data
LSB 2
0x05
Frame Type
0x88
Frame ID
0x01
Description
AT Command
Command
Status
5
6
0x00
0 = OK
1 = ERROR
2 = Invalid Command
3 = Invalid Parameter
4 = Tx Failure
Command
Data
Checksum
0xF0
Suppose the BD parameter is changed on the local device with a frame ID of 0x01. If successful
(parameter was valid), the above response would be received.
149
API frames
Modem Status
Frame Type: (0x8A)
RF module status messages are sent from the module in response to specific conditions.
The following API frame is returned when an API coordinator forms a network.
Frame Fields
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1 0x00
Framespecific Data
LSB 2
0x02
Frame Type
0x8A
Status
0x06
Description
0 = Hardware reset
1 = Watchdog timer reset
2 =Joined network (routers and end devices)
3 =Disassociated
6 =Coordinator started
7 = Network security key was updated
0x0D = Voltage supply limit exceeded (PRO only)
0x11 = Modem configuration changed while join in progress
0x80+ = Ember ZigBee stack error
Checksum
0x6F
Note New modem status codes may be added in future firmware releases.
150
API frames
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1 0x00
LSB 2
0x07
Frame Type
0x8B
Frame ID
0x01
Description
16-bit address
of destination
Framespecific
Data
Checksum
0x7D
0x84
Transmit Retry 7
Count
0x00
Delivery
Status
0x00
0x00 = Success
0x01 = MAC ACK Failure
0x02 = CCA Failure
0x15 = Invalid destination endpoint
0x21 = Network ACK Failure
0x22 = Not Joined to Network
0x23 = Self-addressed
0x24 = Address Not Found
0x25 = Route Not Found
0x26 = Broadcast source failed to hear a neighbor relay the
message
0x2B = Invalid binding table index
0x2C = Resource error lack of free buffers, timers, etc.
0x2D = Attempted broadcast with APS transmission
0x2E = Attempted unicast with APS transmission, but EE=0
0x32 = Resource error lack of free buffers, timers, etc.
0x74 = Data payload too large
0x75 = Indirect message unrequested
Discovery
Status
0x01
10
0x71
151
API frames
Suppose a unicast data transmission was sent to a destination device with a 16-bit address of
0x7D84. (The transmission could have been sent with the 16-bit address set to 0x7D84 or 0xFFFE.)
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x11
Frame Type
0x90
64-bit Source
Address
MSB 4
0x00
0x13
0xA2
0x00
0x40
0x52
10
0x2B
LSB 11
0xAA
Framespecific Data
16-bit Source
MSB 12 0x7D
Network
Address
LSB 13
0x84
Receive
Options
14
0x01
Description
152
API frames
Frame Fields
Received Data
Framespecific Data
Checksum
Offset
Example
15
0x52
16
0x78
17
0x44
18
0x61
19
0x74
20
0x61
21
0x0D
Description
Received RF data
Suppose a device with a 64-bit address of 0x0013A200 40522BAA, and 16-bit address 0x7D84 sends a
unicast data transmission to a remote device with payload RxData. If AO=0 on the receiving device,
it would send the above example frame out its serial port.
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x18
Frame Type
0x91
64-bit Source
MSB 4
0x00
Address
0x13
0xA2
0x00
0x40
0x52
10
0x2B
LSB 11
0xAA
MSB 12
0x7D
LSB 13
0x84
Framespecific Data
16-bit Source
Network
Address
Description
153
API frames
Frame Fields
Offset
Checksum
Description
Source
Endpoint
14
0xE0
Destination
Endpoint
15
0xE0
Cluster ID
16
0x22
17
0x11
18
0xC1
19
0x05
Receive
Options
20
0x02
Received Data
21
0x52
Received RF data
22
0x78
23
0x44
24
0x61
25
0x74
26
0x61
27
0x52
Profile ID
Framespecific Data
Example
Suppose a device with a 64-bit address of 0x0013A200 40522BAA, and 16-bit address 0x7D84 sends a
broadcast data transmission to a remote device with payload RxData. Suppose the transmission
was sent with source and destination endpoints of 0xE0, cluster ID=0x2211, and profile ID=0xC105. If
AO=1 on the receiving device, it would send the above frame out its serial port.
154
API frames
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x14
Frame Type
0x92
64-bit Source
Address
MSB 4
0x00
0x13
0xA2
0x00
0x40
0x52
10
0x2B
LSB 11
0xAA
Framespecific Data
Description
16-bit Source
Network
Address
MSB 12 0x7D
LSB 13
0x84
Receive
Options
14
0x01
Number of
Samples
15
0x01
Digital
Channel
Mask*
16
0x00
17
0x1C
Analog
Channel
Mask**
18
0x02
Digital
Samples (if
included)
19
0x00
20
0x14
155
API frames
Frame Fields
Framespecific Data
Offset
Analog
Sample
Checksum
**
Example
Description
21
0x02
22
0x25
23
0xF5
N/A
N/A
N/A
CD/DIO
12
CTS/DI RTS/DI ASSOC/ DIO4
O7
O6
DIO5
Supply
Voltage
N/A
N/A
AD3
N/A
AD2
AD1
AD0
Suppose an IO sample is received with analog and digital IO, from a remote with a 64-bit address of
0x0013A200 40522BAA and a 16-bit address of 0x7D84. If pin AD1/DIO1 is enabled as an analog
input, AD2/DIO2 and DIO4 are enabled as a digital inputs (currently high), and AD3/DIO3 is enabled
as a digital output (low) the IO sample is shown in the API example in the table above.
156
API frames
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1 0x00
LSB 2
0x17
Frame Type
0x94
64-bit Source
MSB 4 0x00
Address
0x13
0xA2
0x00
0x40
0x52
10
0x2B
LSB
11
0xAA
MSB
12
0xDD
LSB
13
0x6C
Receive
Options
14
0x01
1-Wire
Sensors
15
Framespecific Data
16-bit Source
Network
Address
Description
0x03
157
API frames
Frame Fields
A/D Values
Framespecific Data
Temperature
Offset
Example
16
0x00
17
0x02
(A, B, C, D)
18
0x00
19
0xCE
20
0x00
21
0xEA
22
0x00
23
0x52
24
0x01
25
0x6A
26
0x8B
Read
Checksum
Description
0xFF - the 0x8 bit sum of bytes from offset 3 to this byte.
Suppose a 1-wire sensor sample is received from a device with a 64-bit address of 0x0013A200
40522BAA and a 16-bit address of 0xDD6C. If the sensor sample was taken from a 1-wire humidity
sensor, the API frame could look like this (if AO=0):
For convenience, let's label the A/D and temperature readings as AD0, AD1, AD2, AD3, and T. Using
the data in this example:
AD0 = 0x0002
AD1 = 0x00CE
AD2 = 0x00EA
AD3 = 0x0052
T = 0x016A
To convert these to temperature and humidity values, the following equations should be used.
Temperature (C) = (T / 16), for T < 2048
= - (T & 0x7FF) / 16, for T >= 2048
Vsupply = (AD2 * 5.1) / 255
Voutput = (AD3 * 5.1) / 255
Relative Humidity = ((Voutput / Vsupply) - 0.16) / (0.0062)
True Humidity = Relative Humidity / (1.0546 - (0.00216 * Temperature (C)))
Looking at the sample data, we have:
Vsupply = (234 * 5.1 / 255) = 4.68
Voutput = (82 * 5.1 / 255) = 1.64
Temperature = (362 / 16) = 22.625C
Relative H = (161.2903 * ((1.64/4.68) - 0.16)) = 161.2903 * (0.19043) = 30.71%
True H = (30.71 / (1.0546 - (0.00216 * 22.625))) = (30.71 / 1.00573) = 30.54%
XBee/XBee-PRO ZB RF Modules User Guide
158
API frames
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x20
Frame Type
0x95
64-bit Source
MSB 4
0x00
Address
0x13
0xA2
0x00
0x40
0x52
10
0x2B
LSB 11
0xAA
16-bit Source
MSB 12
0x7D
Network
Address
LSB 13
0x84
Receive
Options
14
0x02
Source 16-bit
15
0x7D
address
16
0x84
Framespecific Data
Description
159
API frames
Frame Fields
Offset
64-bit
Network
address
17
0x00
18
0x13
19
0xA2
20
0x00
21
0x40
22
0x52
23
0x2B
24
0xAA
25
0x20
26
0x00
Parent 16-bit
27
0xFF
address
28
0xFE
Device Type
29
0x01
NI String
Framespecific Data
Example
Description
Indicates the 64-bit address of the remote module that
transmitted the node identification frame.
Source Event
30
0x01
Digi Profile ID
Manufacturer
ID
Checksum
31
0xC1
32
0x05
33
0x10
34
0x1E
35
0x1B
If the commissioning push button is pressed on a remote router device with 64-bit address
0x0013A200 40522BAA, 16-bit address 0x7D84, and default NI string, the following node
identification indicator would be received.
160
API frames
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x13
Frame Type
0x97
Frame ID
0x55
Description
64-bit Source
MSB 5
0x00
(remote)
Address
0x13
0xA2
0x00
0x40
10
0x52
11
0x2B
Framespecific Data
LSB 12 0xAA
16-bit Source
(remote)
Address
MSB
13
0x7D
LSB 14 0x84
Set to 0xFFFE if
unknown.
AT Commands 15
0x53
16
0x4C
17
0x00
Command
Status
0 = OK
1 = ERROR
2 = Invalid Command
3 = Invalid Parameter
4 = Remote Command Transmission Failed
161
API frames
Frame Fields
Framespecific Data
Command
Data
Checksum
Offset
Example
18
0x40
19
0x52
20
0x2B
21
0xAA
22
0xF0
Description
Register data in binary format. If the register was set, then
this field is not returned.
If a remote command is sent to a remote device with 64-bit address 0x0013A200 40522BAA and 16bit address 0x7D84 to query the SL command, and if the frame ID=0x55, the response is shown in the
example API frame in the table above.
Offset
Example
Start
Delimiter
Length
MSB 1 0x00
Framespecific Data
Checksum
Description
0x7E
Number of bytes between the length and the checksum
LSB 1
0x03
Frame Type
0x98
Status Code
0x0B
Status Data
0x03
0x5C
162
API frames
AT Mode
String
Description
Status Data
Data
0x00
Rejoin
rejoinState(1)
0x01
Stack Status
emberNetworkSt
ate(1)
Description
The rejoinState is a count of join
attempts.
0x00 - no network;
0x01 - joining;
0x02 - joined; 0
0x03 - joined (no parent);
0x04 - leaving
0x90 - Network is up and ready to
receive/transmit.
0x91 - Network is down and
cannot receive/transmit.
0x94 - Join attempt failed.
0x96 - A node's attempt to reestablish contact with the network
after moving failed.
0x98 - A join attempt as a router
failed due to a ZigBee 2006 versus
ZigBee PRO 2007 incompatibility.
Try to join as an end device.
0x99 - The network ID has
changed.
0x9A - The PAN ID has changed.
0x9B - The channel has changed.
0xAB - No beacons were received
in response to a beacon request.
0x02
Joining
An association request
is being made.
radioChannel(1)
radioTxPower(1)
panid(2)
extendedPanId(8)
163
API frames
Status Code
AT Mode
String
Status Data
Description
0x03
Joined
Joined - Coordinator
Formed:, Router/End
Device Joined
0x04
Beacon
Response
Data
Description
allowingJoin(1)
0x05
Reject ZS
Not an association
candidate because ZS
does not match that
given in the beacon
response.
0x06
Reject ID
Not an association
candidate because
configured pan ID does
not match that given in
the beacon response.
0x07
Reject NJ
Not an association
candidate because it is
not allowing joins.
0x08
panID Match
radioChannel(1)
panid(2)
rssi(1)
lqi
panId(2)
164
API frames
AT Mode
String
Status Code
Status Data
Description
0x09
Reject
LQIRSSI
0x0A
Beacon
Saved
Data
Description
radioChannel(1)
radioTxPower(1)
panid(2)
extendedPanId(8)
0x0B
AI
AIStatusCode(1)
0x0C
Permit Join
value(1)
0x0D
Scanning
ChannelMask(4)
0x0E
Scan Error
An error occurred
during active scan.
StatusCode(1)
The following is an example of a successful association where Verbose Join was enabled in AT
Command Mode.
Note that comments are interspersed with the trace messages to explain the content, and are
preceded by an ellipsis ....
+++OK
atid3151
OK
...configured pan identifier has been changed
atdc10
OK
...and verbose join enabled
atac
OK
XBee/XBee-PRO ZB RF Modules User Guide
165
API frames
Offset Example
Start
Delimiter
Length
MSB 1 0x00
LSB 2
Description
0x7E
Number of bytes between the length and the checksum
0x16
166
API frames
Frame Fields
Framespecific Data
Offset Example
Frame Type
64-bit Source
MSB 4 0x00
(remote)
Address
0x13
0xA2
0x00
0x40
0x3E
10
0x07
LSB
11
0x50
16-bit
Destination
Address
12
0x00
13
0x00
Receive
Options
14
0x01
Bootloader
Message Type
15
Description
0xA0
The address of the remote radio returning this response.
0x52
0x06 - ACK
0x15 - NACK
0x40 - No Mac ACK
0x51 - Query (received if the bootloader is not active on the
target)
0x52 - Query Response
Checksum
Block Number 16
0x00
64-bit Target
Address
17
0x00
18
0x13
19
0xA2
20
0x00
21
0x40
22
0x52
23
0x2B
24
0xAA
25
0x66
167
API frames
If a query request returns a 0x15 (NACK) status, the target is likely waiting for a firmware update
image. If no messages are sent to it for about 75 seconds, the target will timeout and accept new
query messages.
If a query returns a 0x51 (QUERY) status, then the target's bootloader is not active and will not
respond to query messages.
Offset
Example
Description
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x13
Frame Type
0xA1
64-bit Source
Address
MSB 4
0x00
0x13
0xA2
0x00
0x40
0x40
10
0x11
LSB 11
0x22
12
0x33
13
0x44
Receive
Options
14
0x01
Number of
Addresses
15
0x03
Address 1
16
0xEE
(neighbor of
17
0xFF
destination)
18
0xCC
19
0xDD
Framespecific Data
Source
(updater)
16-bit Address
Address 2
(closer hop
168
API frames
Frame Fields
Offset
Example
Address n
Framespecific Data (neighbor of
source)
20
0xAA
21
0xBB
Checksum
22
0x80
Description
Two bytes per 16-bit address.
Suppose device E sends a route record that traverses multiple hops en route to data collector device
A as shown below.
ABCDE
If device E has the 64-bit and 16-bit addresses of 0x0013A200 40401122 and 0x3344, and if devices B,
C, and D have the following 16-bit addresses:
B = 0xAABB
C = 0xCCDD
D = 0xEEFF
The data collector will send the above API frame out its serial port.
Offset
Example
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x0C
Frame Type
0xA3
64-bit Source
MSB 4
0x00
Address
0x13
0xA2
0x00
0x40
0x40
10
0x11
LSB 11
0x22
Framespecific Data
Source 16-bit
Address
MSB 12 0x00
LSB 13
0x00
Description
169
Frame Fields
Framespecific Data
Reserved
Checksum
Offset
Example
Description
14
0x00
Set to 0.
15
0xF4
Example: Suppose a device with a 64-bit address of 0x0013A200 40401122 and 16-bit address of
0x0000 sends a many-to-one route request. All remote routers operating in API mode that receive
the many-to-one broadcast would send the above example API frame out their serial port.
Cluster ID
0x0000
0x0001
0x0002
0x0004
0x0005
0x0006
0x0031
0x0032
0x0034
0x0036
0x0038
The Explicit Transmit API frame (0x11) is used to send ZigBee Device Objects commands to devices in
the network. Sending ZDO commands with the Explicit Transmit API frame requires some formatting
of the data payload field.
When sending a ZDO command with the API, all multiple byte values in the ZDO command (API
payload) (e.g. u16, u32, 64-bit addresses) must be sent in little endian byte order for the command to
be executed correctly on a remote device.
170
For an API XBee to receive ZDO responses, the AO command must be set to 1 to enable the explicit
receive API frame.
The following table shows how the Explicit API frame can be used to send an Active Endpoints
request to discover the active endpoints on a device with a 16-bit address of 0x1234.
Frame Fields
Offset
Example
Description
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x17
Frame Type
0x11
Frame ID
0x01
64-bit
Destination
MSB 5
0x00
0x00
0x00
0x00
0x00
10
0x00
11
0xFF
12
0xFF
MSB 13
0xFF
LSB 14
0xFE
Source
Endpoint
15
0x00
Destination
Endpoint
16
0x00
Cluster ID
MSB 17
0x00
LSB 18
0x05
MSB 19
0x00
LSB 20
0x00
Address
Framespecific Data
16-bit
Destination
Network
Address
Profile ID
171
Frame Fields
Framespecific Data
Offset
Example
Description
Broadcast
Radius
21
0x00
Transmit
Options
22
0x00
Transaction
Sequence
Number
23
0x01
ZDO Payload
24
0x34
25
0x12
Data Payload
Checksum
26
0xA6
Cluster ID
Identify (0x00)
Identify Query (0x01)
Time (0x0000)
Time (0x000A)
Thermostat (0x0201)
The ZCL defines a number of profile-wide commands that can be supported on any profile, also
known as general commands. These commands include the following.
172
Description
The Explicit Transmit API frame (0x11) is used to send ZCL commands to devices in the network.
Sending ZCL commands with the Explicit Transmit API frame requires some formatting of the data
payload field.
When sending a ZCL command with the API, all multiple byte values in the ZCL command (API
Payload) (e.g. u16, u32, 64-bit addresses) must be sent in little endian byte order for the command to
be executed correctly on a remote device.
Note When sending ZCL commands, the AO command should be set to 1 to enable the explicit
receive API frame. This will provide indication of the source 64- and 16-bit addresses, cluster
ID, profile ID, and endpoint information for each received packet. This information is required
to properly decode received data.
The following table shows how the Explicit API frame can be used to read the hardware version
attribute from a device with a 64-bit address of 0x0013A200 40401234 (unknown 16-bit address).
This example uses arbitrary source and destination endpoints. Recall the hardware version attribute
(attribute ID 0x0003) is part of the basic cluster (cluster ID 0x0000). The Read Attribute general
command ID is 0x00.
173
Frame Fields
Offset
Example
Description
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x19
Frame Type
0x11
Frame ID
0x01
64-bit
Destination
Address
MSB 5
0x00
0x13
0xA2
0x00
0x40
10
0x40
11
0x12
12
0x34
Framespecific
Data
16-bit
Destination
MSB 13 0xFF
LSB 14
0xFE
Source
Endpoint
15
0x41
Destination
Endpoint
16
0x42
Cluster ID
MSB 17 0x00
Network
Address
LSB 18
Profile ID
MSB 19 0xD1
LSB 20
0x00
0x23
174
Frame Fields
Offset
Example
Description
Broadcast
Radius
21
0x00
Transmit
Options
22
0x00
23
0x00
Transacti 24
on
Sequence
Number
0x01
Comman
d ID
25
0x00
Attribute
ID
26
0x03
27
0x00
28
0xFA
Data
Payload
ZCL
Frame
Header
Framespecific
Data
ZCL
Payload
Frame
Control
Checksum
In the previous example, the Frame Control field (offset 23) was constructed as follows:
Name
Bits
Frame Type
0-1
Manufacturer Specific
0 - The manufacturer code field is omitted from the ZCL Frame Header.
Direction
0 - The command is being sent from the client side to the server side.
Reserved
5-7
Set to 0.
175
Offset
Example
Description
Start
Delimiter
0x7E
Length
MSB 1
0x00
LSB 2
0x19
Frame Type
0x11
Frame ID
0x01
64-bit
Destination
MSB 5
0x00
0x13
0xA2
0x00
0x40
10
0x40
11
0x12
12
0x34
Framespecific
Data
Address
16-bit
Destination
Network
Address
MSB 13 0x56
LSB 14
0x78
176
Frame Fields
Offset
Description
Source
Endpoint
15
0x41
Destination
Endpoint
16
0x42
Cluster ID
MSB 17 0x07
LSB 18
Profile ID
Framespecific
Data
Example
0x01
MSB 19 0x01
LSB 20
0x09
Broadcast
Radius
21
0x00
Transmit
Options
22
0x00
Frame
Control
23
0x09
Transaction
Sequence
Number
24
0x01
25
0x00
Data
Payload
ZCL
Frame
Header
177
Frame Fields
Offset
Issuer Event
ID
ZCL
Payload Load
Control
Event
Data
Description
26
0x78
27
0x56
28
0x34
29
0x12
30
0x14
31
0x00
Utility
Enrollment
Group
32
0x00
Start Time
33
0x00
34
0x00
35
0x00
36
0x00
Duration in
Minutes
37
0x01
38
0x00
Criticality
Level
39
0x04
Cooling
40
Temperature
0xFF
Heating
41
Temperature
Offset
0xFF
Cooling
42
Temperature
43
Set Point
0x00
Device Class
Framespecific
Data
Example
0x80
178
Frame Fields
Offset
ZCL
Payload Load
Control
Event
Data
Framespecific
Data
Example
Heating
44
Temperature
45
Set Point
0x80
Average
Load
Adjustment
Percentage
46
0x80
Duty Cycle
47
0xFF
Duty Cycle
Event
Control
48
0x00
49
0x5B
Checksum
0x00
Description
Requested heating set point in 0.01
degrees Celsius.
A value of 0x8000 means the set
point field is not used in this event.
Note the 0x80000 is sent in little
endian byte order.
In the previous example, the Frame Control field (offset 23) was constructed as follows:
Name
Bits
Frame Type
0-1
Manufacturer Specific
0 - The manufacturer code field is omitted from the ZCL Frame Header.
Direction
1 - The command is being sent from the server side to the client side.
Reserved
5-7
Set to 0.
179
Parameter Range
Default
DH
0 - 0xFFFFFFFF
DL
0 - 0xFFFFFFFF
0xFFFF(Coordina
tor)
MY
0 - 0xFFFE
[read-only]
0xFFFE
MP
0 - 0xFFFE
[read-only]
0xFFFE
NC
0 - MAX_CHILDREN
read-only
0 - 0xFFFFFFFF
[read-only]
SH
0 (Router/End
Device)
(maximum varies)
factory-set
180
Addressing commands
AT
Command
Parameter Range
Default
SL
0 - 0xFFFFFFFF
[read-only]
factory-set
NI
20-Byte printable
ASCII string
ASCII space
character (0x20)
SE
0 - 0xFF
0xE8
DE
0 - 0xFF
0xE8
CI
0 - 0xFFFF
0x11
TO
0 - 0xFF
0x00
181
Networking commands
AT
Command
NP
Parameter Range
Default
0 - 0xFFFF
[read-only]
0 - 0xFFFFFFFF
0xA0000
1-0x3F
CR
Networking commands
AT
Command
CH
Parameter Range
Default
XBee
[read-only]
0, 0x0B - 0x1A
XBee-PRO
0, 0x0B - 0x19
(Channels 11-25)
CE
0 - Not a
coordinator
1 - Coordinator
(SM must be 0 in
order to set CE to 1.)
182
Networking commands
AT
Command
Parameter Range
Default
ID
Extended PAN ID. Set/read the 64-bit extended PAN ID. If set
to 0, the coordinator will select a random extended PAN ID,
and the router / end device will join any extended PAN ID.
Changes to ID should be written to non-volatile memory
using the WR command to preserve the ID setting if a power
cycle occurs.
00
0xFFFFFFFFFFFFFFFF
OP
0x01 [read-only]
0xFFFFFFFFFFFFFFFF
NH
0 - 0xFF
0x1E
BH
0 - 0x1E
OI
Operating 16-bit PAN ID. Read the 16-bit PAN ID. The OI
value reflects the actual 16-bit PAN ID the module is running
on.
0 - 0xFFFF
[read-only]
ND
20-byte printable
ASCII string
ASCII space
character
(0x20)
0x3C (60d)
183
Networking commands
AT
Command
NO
Parameter Range
Default
0 - 0x03 [bitfield]
1 - 0xFFFF [bitfield]
7FFF
0 (0x0B)
1 (0x0C)
2 (0x0D)
3 (0x0E)
184
Networking commands
AT
Command
SD
Parameter Range
Default
0 - 7 [exponent]
0-2
NJ
0 - 0xFF
[x 1 sec]
0xFF
(always
allows
joining)
185
Security commands
AT
Command
Parameter Range
0
0 - Channel
verification disabled
0 - 0x64FF
JN
0-1
AR
0xFF
(disabled)
JV
NW
Default
1 - Channel
verification enabled
0 (disabled)
[x 1 minute]
(up to over 17 days)
Security commands
AT
Command
Parameter Range
Default
EE
0 - Encryption disabled
1 - Encryption enabled
EO
0 - 0xFF
186
RF interfacing commands
AT
Command
Parameter Range
Default
NK
128-bit value
KY
Link Key. Set the 128-bit AES link key. This command is write
only; KY cannot be read. Setting KY to 0 will cause the
coordinator to transmit the network key in the clear to joining
devices, and will cause joining devices to acquire the network
key in the clear when joining.
128-bit value
RF interfacing commands
AT
Command Name and Description
Parameter Range
Default
PL
XBee
(boost mode
disabled)
0 = -5 dBm
1 = -1 dBm
2 = +1 dBm
3 = +3 dBm
4 = +5 dBm
XBee-PRO
(Boost mode
enabled)
4 =+18 dBM
3 = +16 dBm
(approx.)
2 = +14 dBm
(approx.)
1 = +12 dBm
(approx.)
0 = 0 dBm (approx.)
PM
Power Mode (XBee only). Set/read the power mode of the device.
Enabling boost mode will improve the receive sensitivity by 2dB
and increase the transmit power by 3dB
Note: This command is disabled on the XBee-PRO. It is forced on
by the software to provide the extra sensitivity. Boost mode
imposes a slight increase in current draw. See section 1.2 for
details.
0-1,
0= -Boost mode
disabled, 1= Boost
mode enabled.
187
AT
Command Name and Description
Parameter Range
DB
0 - 0xFF
PP
Default
[read
only]
Parameter Range
Default
AP
0 = API-disabled
AO
(operate in
transparent mode)
1 = API-enabled
2 = API-enabled
(w/escaped control
characters)
0
BD
0 - 0x0A
0 = 1200 b/s
1 = 2400
2 = 4800
3 = 9600
4 = 19200
5 = 38400
6 = 57600
7 = 115200
8 = 230400
9 = 460800
A = 921600
188
AT
Comma
nd
Name and Description
Parameter Range
Default
NB
0 = No parity
1 = Even parity
2 = Odd parity
3 = Mark parity
SB
0 = 1 stop bit
1 = 2 stop bits
RO
0 - 0xFF
[x character times]
D7
D6
189
I/O commands
I/O commands
AT
Command Name and Description
Parameter Range
Default
IR
0, 0x32:0xFFFF (ms)
IC
P0
8 (DIO8)
1 (DIO1) 5 (DIO5)
9 (DIO9)
2 (DIO2) 6 (DIO6)
10 (DIO10)
3 (DIO3) 7 (DIO7)
11 (DIO11)
1 = RSSI PWM
3 - Digital input, monitored
4 - Digital output, default low
5 - Digital output, default high
P1
P2
1 - SPI_MISO*
3- Digital input, monitored
4- Digital output, default low
5- Digital output, default high
190
I/O commands
AT
Command Name and Description
Parameter Range
Default
P3
P4
D0
1 - Commissioning button
enabled
2 - Analog input, single ended
3 - Digital input
4 - Digital output, low
5 - Digital output, high
191
I/O commands
AT
Command Name and Description
Parameter Range
Default
D1
D2
1 SPI_SCLK*
2 Analog input, single ended
3 Digital input
4 Digital output, low
5 Digital output, high
D3
1 SPI_nSSEL*
2 Analog input, single ended
3 Digital input
4 Digital output, low
5 Digital output, high
D4
1 SPI_MOSI*
3 Digital input
4 Digital output, low
5 Digital output, high
D5
192
I/O commands
AT
Command Name and Description
D8
Parameter Range
Default
LT
PR
0 - 0x7FFF
0x1FFF
0x1FBF
Bits:
0 - DIO4 (Pin 24/SMT, Pin 11/TH)
1 - AD3 / DIO3 (Pin 30/SMT, Pin 17/TH)
2 - AD2 / DIO2 (Pin 31/SMT, Pin 18/TH)
3 - AD1 / DIO1 (Pin 32/SMT, Pin 19/TH)
4 - AD0 / DIO0 (Pin 33/SMT, Pin 20/TH)
5 - RTS / DIO6 (Pin 29/SMT, Pin 16/TH)
6 - DTR / Sleep Request / DIO8 (Pin 10/SMT, Pin 9/TH)
7 - DIN / Config (Pin 4/SMT, Pin 3/TH)
8 - Associate / DIO5 (Pin 28/SMT, Pin 15/TH)
9 - On/Sleep / DIO9 (Pin 26/SMT, Pin 13/TH)
10 - DIO12 (Pin 5/SMT, Pin 4/TH)
11 - PWM0 / RSSI / DIO10 (Pin 7/SMT, Pin 6/TH)
12 - PWM1 / DIO11 (Pin 8/SMT, Pin 7/TH)
13 - CTS / DIO7 (Pin 25/SMT, Pin 12/TH)
14 - DOUT / DIO13 (Pin 3/SMT, Pin 2/TH)
PD
193
I/O commands
AT
Command Name and Description
Parameter Range
Default
RP
0x28
(40d)
DC
Device Controls.
0-0xFFFF
0x00
0x00-0xFF
0x00
Device Options.
Bit0 - Reserved.
Bit1 - Reserved for Smart Energy devices.
Bit2 - 0/1 = First or Best Join. First join means the
device will join the network through the first
acceptable Beacon response it receives. Best join
means the device will join the network through the
strongest Beacon response it receives after searching
all search mask channels.
Bit3 - Disable NULL Transport Key (Coordinator
Only).
Bit4 - Disable Tx Packet Extended Timeout.
Bit5 - Disable ACK for End Device I/O Sampling.
Bit6 - Enable High Ram Concentrator.
Bit7 - Enable ATNW to find new network before
leaving the network.
%V
194
Diagnostics commands
AT
Command Name and Description
Parameter Range
Default
V+
0-0xFFFF
TP
0x0-0xFFFF
* indicates that the option is available on the TH module, but not the SMT module.
** indicates that the command is available on the SMT module, but not the TH module.
Diagnostics commands
AT
Command
Parameter
Range
Default
VR
0 - 0xFFFF
[read-only]
Factory
-set
VL
N/A
N/A
195
AT command options
AT
Command
Parameter
Range
Default
HV
0 - 0xFFFF
Hardware Version. Read the hardware version of the [Link]
[read-only]
of the module. This command can be used to distinguish among
different hardware platforms. The upper byte returns a value that is
unique to each module type. The lower byte indicates the hardware
revision.
The regular XBee returns a value of 0x22xx for this command. the XBeePRO returns a value of 0x21xx.
Factory
-set
AI
--
0 - 0xFF
[read-only]
AT command options
AT
Command
Parameter Range
Default
CT
0x64
(100d)
CN
--
--
196
Sleep commands
AT
Command
Parameter Range
Default
GT
1 - 0x0CE4 [x 1 ms]
(max of 3.3 decimal
sec)
0x3E8
(1000d)
CC
0 - 0xFF
0x2B
(+ ASCII)
Sleep commands
AT
Command
SM
Parameter Range
Default
0-Sleep disabled
(router)
0 - Router
1-Pin sleep
enabled
4 - End
Device
4-Cyclic sleep
enabled
5 - Cyclic sleep, pin
wake
SN
1 - 0xFFFF
SP
Sleep Period. This value determines how long the end device
will sleep at a time, up to 28 seconds. (The sleep time can
effectively be extended past 28 seconds using the SN
command.) On the parent, this value determines how long the
parent will buffer a message for the sleeping end device. It
should be set at least equal to the longest SP time of any child
end device.
0x20
0x20 - 0xAF0 x
10ms (Quarter
second resolution)
ST
Time Before Sleep Sets the time before sleep timer on an end
[Link] timer is reset each time serial or RF data is received.
Once the timer expires, an end device may enter low power
operation. Applicable for cyclic sleep end devices only.
1 - 0xFFFE (x 1ms)
0x1388 (5
seconds)
SO
Command
0 - 0xFF
197
Execution commands
AT
Command
Parameter Range
Default
WH
Wake Host. Set/Read the wake host timer value. If the wake
host timer is set to a non-zero value, this timer specifies a time
(in millisecond units) that the device should allow after waking
from sleep before sending data out the serial port or
transmitting an I/O sample. If serial characters are received, the
WH timer is stopped immediately.
0 - 0xFFFF (x 1ms)
SI
PO
Polling Rate. Set/Read the end device poll rate. Setting this to 0
(default) enables polling at 100 ms (default rate), advancing in 10
msec increments. Adaptive polling may allow the end device to
poll more rapidly for a short time when receiving RF data.
0 - 0x3E8
0x00 (100
msec)
Execution commands
Where most AT commands set or query register values, execution commands cause an action to be
executed on the module. Execution commands are executed immediately and do not require
changes to be applied.
AT
Command Name and Description
Parameter
Range
AC
AS
Active Scan. Scans the neighborhood for beacon responses. The ATAS
command is only valid as a local command. Response frames are
structured as:
AS_type unsigned byte = 2 - ZB firmware uses a different format than
Wi-Fi XBee, which is type 1
Channel unsigned byte
PAN unsigned word in big endian format
Extended PAN eight unsigned bytes in bit endian format
Allow Join unsigned byte 1 indicates join is enabled, 0 that it is disabled
Stack Profile unsigned byte
LQI unsigned byte, higher values are better
RSSI signed byte, lower values are better
WR
Default
--
--
--
--
198
Execution commands
AT
Command Name and Description
Parameter
Range
Default
FR
--
--
NR
0-1
--
1,2,4
--
CB
&X
Clear Binding and Group Tables. This command resets the binding and
group tables.
199
Execution commands
AT
Command Name and Description
Parameter
Range
ND
optional 20Byte
NI or MY
value
--
up to 20-Byte
printable
ASCII string
--
--
--
Default
IS
Force Sample. Forces a read of all enabled digital and analog input lines.
200
Add IP-connectivity to your network via Cellular, Ethernet or Wi-Fi with a ConnectPort X Gateway
Extend the range of your network with the XBee Wall Router
Make deployment easy by enabling the Commissioning Pushbutton (pin 20) and AssociateLED
(pin 15) to operate with the Network Commissioning Tool software
201
XBee Bootloader
Interface with standard RS-232, USB, Analog and Digital I/O, RS-485, and other industrial devices
using XBee Adapters
Monitor and manage your network securely from remote locations with Device Cloud
XBee Bootloader
XBee modules use a modified version of Embers bootloader. This bootloader version supports a
custom entry mechanism that uses module pins DIN (pin 4/SMT, pin 3/TH), DTR / SLEEP_RQ (pin 10/
SMT, pin9/TH), and RTS (pin 29/SMT, pin16/TH). To invoke the bootloader, do the following:
1. Set DTR / SLEEP_RQ low (TTL 0V) and RTS high.
2. Send a serial break to the DIN pin and power cycle or reset the module.
3. When the module powers up, DTR / SLEEP_RQ and DIN should be low (TTL 0V) and RTS should be
high.
4. Terminate the serial break and send a carriage return at 115200b/s to the module.
5. If successful, the module will send the Ember bootloader menu out the DOUT pin at 115200b/s.
6. Commands can be sent to the bootloader at 115200b/s.
Note Hardware flow control should be disabled when entering and communicating with the Ember
357 bootloader.
202
Over 1 minute passes after the command to send the firmware image and the first block of the
image has not yet been sent
Regulatory compliance
XBee modules are FCC and ETSI certified for operation on all 16 channels. The EM357 output power
can be configured up to 8 dBm with boost mode enabled on channels 11 through 25. On channel 26
you must reduce the power to 3 dBm.
XBee-PRO modules are FCC certified for operation on all 16 channels. The XBee-PRO contains a
power compensation method to adjust the output power near 18 dBm on channels 11 through 25.
You must configure the EM357 with an output power such that the module outputs 18 dBm or less
on channels 11 through 25. On channel 26, you must reduce the power to no more than 0 dBm. The
end product is responsible to adhere to these requirements.
GPIO_PxCFGH/L
Description
Analog
0x0
Input (floating)
0x4
203
GPIO Mode
GPIO_PxCFGH/L
Description
0x8
Output (push-pull)
0x1
Output (open-drain)
0x5
Alternate Output
(push-pull)
0x9
Alternate Output
(open-drain)
0xD
For more information on configuring and setting GPIOs, consult the EM357 specification.
JTCK
18
N/A
N/A
JTDO
19
26
ON / SLEEP / DIO9
JTDI
20
28
ASSOCIATE / DIO5
JTMS
21
DIO12
204
Agency certifications
United States FCC
The XBee RF Modules comply with Part 15 of the FCC rules and regulations. Compliance with the
labeling requirements, FCC notices and antenna usage guidelines is required.
To fulfill FCC Certification, the OEM must comply with the following regulations:
1. The system integrator must ensure that the text on the external label provided with this device is
placed on the outside of the final product.
2. XBee ZB RF Modules may only be used with antennas that have been tested and approved for use
with the modules [refer to the antenna tables in this section].
205
Required FCC Label for OEM products containing the XBee S2C TH RF Module
Contains FCC ID:MCQ-S2CTH
This device complies with Part 15 of the FCC Rules. Operation is subject to the following two
conditions: (1.) this device may not cause harmful interference and (2.) this device must accept any
interference received, including interference that may cause undesired operation.
Required FCC Label for OEM products containing the XBee-PRO S2C TH RF Module
Contains FCC ID: MCQ-PS2CTH
This device complies with Part 15 of the FCC Rules. Operation is subject to the following two
conditions: (1.) this device may not cause harmful interference and (2.) this device must accept any
interference received, including interference that may cause undesired operation.
FCC notices
IMPORTANT: The XBee and XBee-PRO RF Modules have been certified by the FCC for use with other
products without any further certification (as per FCC section 2.1091). Modifications not expressly
approved by Digi could void the user's authority to operate the equipment.
IMPORTANT: OEMs must test final product to comply with unintentional radiators (FCC section
15.107 & 15.109) before declaring compliance of their final product to Part 15 of the FCC Rules.
IMPORTANT: The RF module has been certified for remote and base radio applications. If the module
will be used for portable applications, the device must undergo SAR testing.
This equipment has been tested and found to comply with the limits for a Class B digital device,
pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection
against harmful interference in a residential installation. This equipment generates, uses and can
radiate radio frequency energy and, if not installed and used in accordance with the instructions, may
cause harmful interference to radio communications. However, there is no guarantee that
interference will not occur in a particular installation.
If this equipment does cause harmful interference to radio or television reception, which can be
determined by turning the equipment off and on, the user is encouraged to try to correct the
interference by one or more of the following measures: Re-orient or relocate the receiving antenna,
Increase the separation between the equipment and receiver, Connect equipment and receiver to
outlets on different circuits, or Consult the dealer or an experienced radio/TV technician for help.
206
Agency certifications
The antennas in the tables below have been approved for use with this module. Cable loss is required when using gain antennas as
shown in the tables. Digi does not carry all of these antenna variants. Contact Digi Sales for available antennas. The following table
shows the antennas approved for use with the XBee ZB Surface Mount RF Module.
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel
26
Integral Antennas
29000313
0.0 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-QI
1.5 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HASM-450
2.1 dBi
Fixed
20 cm
N/A
N/A
A24-HABSM
2.1 dBi
Fixed
20 cm
N/A
N/A
29000095
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HABUF-P5I
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HASM-525
2.1 dBi
Fixed
20 cm
N/A
N/A
Dipole Antennas
Omni-directional Antennas
A24-F2NF
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-F3NF
3.0 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-F5NF
5.0 dBi
Fixed
20 cm
N/A
N/A
A24-F8NF
8.0 dBi
Fixed
2m
N/A
N/A
A24-F9NF
9.5 dBi
Fixed
2m
N/A
N/A
A24-F10NF
2m
N/A
N/A
207
Agency certifications
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel
26
A24-F12NF
2m
N/A
2.0 dB
A24-W7NF
7.2 dBi
Fixed
2m
N/A
N/A
A24-M7NF
7.2 dBi
Fixed
2m
N/A
N/A
A24-F15NF
2m
N/A
5.0 dB
A24-P8SF
Flat Panel
8.5 dBi
Fixed
2m
N/A
3.0 dB
A24-P8NF
Flat Panel
8.5 dBi
Fixed
2m
N/A
3.0 dB
A24-P13NF
Flat Panel
2m
N/A
7.5 dB
A24-P14NF
Flat Panel
2m
N/A
8.5 dB
A24-P15NF
Flat Panel
2m
N/A
9.5 dB
A24-P16NF
Flat Panel
2m
N/A
10.5 dB
A24-P19NF
Flat Panel
2m
N/A
13.5 dB
A24-Y6NF
Yagi (6-element)
8.8 dBi
Fixed
2m
N/A
2.8 dB
A24-Y7NF
Yagi (7-element)
9.0 dBi
Fixed
2m
N/A
3.0 dB
A24-Y9NF
Yagi (9-element)
2m
N/A
4.0 dB
A24-Y10NF
Yagi (10-element)
2m
N/A
5.0 dB
A24-Y12NF
Yagi (12-element)
2m
N/A
6.0 dB
A24-Y13NF
Yagi (13-element)
2m
N/A
6.0 dB
Panel Antennas
Yagi Antennas
208
Agency certifications
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel
26
A24-Y15NF
Yagi (15-element)
2m
N/A
6.5 dB
A24-Y16NF
Yagi (16-element)
2m
N/A
7.5 dB
A24-Y16RM
2m
N/A
7.5 dB
A24-Y18NF
Yagi (18-element)
2m
N/A
9.0 dB
The following table shows antennas approved for use with the XBee ZB Through Hole RF Module.
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel
26
Integral Antennas
29000294
-0.5 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-QI
1.5 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HASM-450
2.1 dBi
Fixed
20 cm
N/A
N/A
A24-HABSM
2.1 dBi
Fixed
20 cm
N/A
N/A
29000095
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HABUF-P5I
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HASM-525
2.1 dBi
Fixed
20 cm
N/A
N/A
Dipole Antennas
209
Agency certifications
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel
26
Omni-directional Antennas
A24-F2NF
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-F3NF
3.0 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-F5NF
5.0 dBi
Fixed
20 cm
N/A
N/A
A24-F8NF
8.0 dBi
Fixed
2m
N/A
2.0 dB
A24-F9NF
9.5 dBi
Fixed
2m
N/A
3.5 dB
A24-F10NF
2m
N/A
4.0 dB
A24-F12NF
2m
N/A
6.0 dB
A24-W7NF
7.2 dBi
Fixed
2m
N/A
1.2 dB
A24-M7NF
7.2 dBi
Fixed
2m
N/A
1.2 dB
A24-F15NF
2m
N/A
9.0 dB
A24-P8SF
Flat Panel
8.5 dBi
Fixed
2m
N/A
2.5 dB
A24-P8NF
Flat Panel
8.5 dBi
Fixed
2m
N/A
2.5 dB
A24-P13NF
Flat Panel
2m
N/A
7.0 dB
A24-P14NF
Flat Panel
2m
N/A
8.0 dB
A24-P15NF
Flat Panel
2m
N/A
9.0 dB
A24-P16NF
Flat Panel
2m
N/A
10.0 dB
A24-P19NF
Flat Panel
2m
N/A
13.0 dB
Panel Antennas
210
Agency certifications
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel
26
Yagi Antennas
A24-Y6NF
Yagi (6-element)
8.8 dBi
Fixed
2m
N/A
2.8 dB
A24-Y7NF
Yagi (7-element)
9.0 dBi
Fixed
2m
N/A
3 dB
A24-Y9NF
Yagi (9-element)
2m
N/A
4 dB
A24-Y10NF
Yagi (10-element)
2m
N/A
5 dB
A24-Y12NF
Yagi (12-element)
2m
N/A
6.5 dB
A24-Y13NF
Yagi (13-element)
2m
N/A
6.5 dB
A24-Y15NF
Yagi (15-element)
2m
N/A
6.5 dB
A24-Y16NF
Yagi (16-element)
2m
N/A
7.5 dB
A24-Y16RM
2m
N/A
7.5 dB
A24-Y18NF
Yagi (18-element)
2m
N/A
9.0 dB
211
Agency certifications
The following table shows antennas approved for use with the XBee-PRO ZB Surface Mount RF Module.
Part Number
Type (Description)
Gain
Application*
Min
Separation
Channel 26
Internal Antennas
29000313
0.0 dBi
Fixed/Mobile 20 cm
N/A
N/A
A24-QI
1.5 dBi
Fixed/Mobile 20 cm
N/A
N/A
A24-HASM-450
2.1 dBi
Fixed
20 cm
N/A
N/A
A24-HABSM
2.1 dBi
Fixed
20 cm
N/A
N/A
29000095
2.1 dBi
Fixed/Mobile 20 cm
N/A
N/A
2.1 dBi
Fixed/Mobile 20 cm
N/A
N/A
A24-HASM-525
2.1 dBi
Fixed
20 cm
N/A
N/A
Dipole Antennas
Omni-directional Antennas
A24-F2NF
2.1 dBi
Fixed/Mobile 20 cm
N/A
N/A
A24-F3NF
3.0 dBi
Fixed/Mobile 20 cm
N/A
N/A
A24-F5NF
5.0 dBi
Fixed
20 cm
N/A
N/A
A24-F8NF
8.0 dBi
Fixed
2m
N/A
1.3 dB
A24-F9NF
9.5 dBi
Fixed
2m
N/A
2.8 dB
A24-F10NF
10 dBi
Fixed
2m
N/A
3.3 dB
A24-F12NF
12 dBi
Fixed
2m
1.7 dB
5.3 dB
A24-W7NF
7.2 dBi
Fixed
2m
N/A
0.5 dB
212
Agency certifications
Part Number
Type (Description)
Gain
Application*
Min
Separation
Channel 26
A24-M7NF
7.2 dBi
Fixed
2m
N/A
0.5 dB
A24-F15NF
15.0 dBi
Fixed
2m
4.7 dB
8.3 dB
A24-P8SF
Flat Panel
8.5 dBi
Fixed
2m
2.8 dB
4.5 dB
A24-P8NF
Flat Panel
8.5 dBi
Fixed
2m
2.8 dB
4.5 dB
A24-P13NF
Flat Panel
13.0 dBi
Fixed
2m
7.3 dB
9 dB
A24-P14NF
Flat Panel
14.0 dBi
Fixed
2m
8.3 dB
10 dB
A24-P15NF
Flat Panel
15.0 dBi
Fixed
2m
9.3 dB
11 dB
A24-P16NF
Flat Panel
16.0 dBi
Fixed
2m
10.3 dB
12 dB
A24-P19NF
Flat Panel
19.0 dBi
Fixed
2m
13.3 dB
15 dB
A24-Y6NF
Yagi (6-element)
8.8 dBi
Fixed
2m
2.4 dB
4.2 dB
A24-Y7NF
Yagi (7-element)
9.0 dBi
Fixed
2m
2.6 dB
4.4 dB
A24-Y9NF
Yagi (9-element)
10.0 dBi
Fixed
2m
3.6 dB
5.4 dB
A24-Y10NF
Yagi (10-element)
11.0 dBi
Fixed
2m
4.6 dB
6.4 dB
A24-Y12NF
Yagi (12-element)
12.0 dBi
Fixed
2m
5.6 dB
7.4 dB
A24-Y13NF
Yagi (13-element)
12.0 dBi
Fixed
2m
5.6 dB
7.4 dB
A24-Y15NF
Yagi (15-element)
12.5 dBi
Fixed
2m
6.1 dB
7.9 dB
A24-Y16NF
Yagi (16-element)
13.5 dBi
Fixed
2m
7.1 dB
8.9 dB
A24-Y16RM
13.5 dBi
Fixed
2m
7.1 dB
8.9 dB
A24-Y18NF
Yagi (18-element)
15.0 dBi
Fixed
2m
8.6 dB
10.4 dB
Panel Antennas
Yagi Antennas
213
Agency certifications
The following table shows the antennas approved for use with the XBee-PRO ZB Through Hole RF Module.
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel 26
Integral Antennas
29000294
-0.5 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-QI
1.5 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HASM-450
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-HABSM
2.1 dBi
Fixed
20 cm
N/A
N/A
29000095
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
2.1 dBi
Fixed
20 cm
N/A
N/A
A24-HASM-525
2.1 dBi
Fixed/ Mobile 20 cm
N/A
N/A
Dipole Antennas
Omni-directional Antennas
A24-F2NF
2.1 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-F3NF
3.0 dBi
Fixed/Mobile
20 cm
N/A
N/A
A24-F5NF
5.0 dBi
Fixed
20 cm
N/A
N/A
A24-F8NF
8.0 dBi
Fixed
2m
N/A
N/A
A24-F9NF
9.5 dBi
Fixed
2m
N/A
N/A
A24-F10NF
2m
N/A
N/A
A24-F12NF
2m
N/A
0.9 dB
A24-W7NF
7.2 dBi
2m
N/A
N/A
Fixed
214
Agency certifications
Part Number
Type (Description)
Gain
Application*
Min.
Separation
Channel 26
A24-M7NF
7.2 dBi
Fixed
2m
N/A
N/A
A24-F15NF
2m
2.5 dB
3.9 dB
A24-P8SF
Flat Panel
8.5 dBi
Fixed
2m
1 dB
1.6 dB
A24-P8NF
Flat Panel
8.5 dBi
Fixed
2m
1 dB
1.6 dB
A24-P13NF
Flat Panel
13 dBi
Fixed
2m
5.5 dB
6.1 dB
A24-P14NF
Flat Panel
14 dBi
Fixed
2m
6.5 dB
7.1 dB
A24-P15NF
Flat Panel
2m
7.5 dB
8.1 dB
A24-P16NF
Flat Panel
2m
8.5 dB
9.1 dB
A24-19NF
Flat Panel
2m
11.5 dB
12.1 dB
A24-Y6NF
Yagi (6-element)
8.8 dBi
Fixed
2m
0.3 dB
N/A
A24-Y7NF
Yagi (7-element)
9.0 dBi
Fixed
2m
0.5 dB
N/A
A24-Y9NF
Yagi (9-element)
2m
1.5 dB
1 db
A24-Y10NF
Yagi (10-element)
2m
2.5 dB
2 dB
A24-Y12NF
Yagi (12-element)
2m
3.5 dB
3 dB
A24-Y13NF
Yagi (13-element)
2m
3.5 dB
3 dB
A24-Y15NF
Yagi (15-element)
2m
4.0 dB
3.5 dB
A24-Y16NF
Yagi (16-element)
2m
5.0 dB
4.5 dB
A24-Y16RM
2m
5.0 dB
4.5 dB
A24-Y18NF
Yagi (18-element)
2m
6.5 dB
6 dB
Panel Antennas
Yagi Antennas
215
RF exposure
* If using the RF module in a portable application (for example - if the module is used in a handheld
device and the antenna is less than 20cm from the human body when the device is in operation): The
integrator is responsible for passing additional SAR (Specific Absorption Rate) testing based on FCC
rules 2.1091 and FCC Guidelines for Human Exposure to Radio Frequency Electromagnetic Fields, OET
Bulletin and Supplement C. The testing results will be submitted to the FCC for approval prior to
selling the integrated unit. The required SAR testing measures emissions from the module and how
they affect the person.
RF exposure
CAUTION! To satisfy FCC RF exposure requirements for mobile transmitting devices, a separation
distance of 20 cm or more should be maintained between the antenna of this device and
persons during device operation. To ensure compliance, operations at closer than this
distance are not recommended. The antenna used for this transmitter must not be colocated in conjunction with any other antenna or transmitter.
The preceding statement must be included as a CAUTION statement in OEM product manuals in
order to alert users of FCC RF Exposure compliance.
Europe (ETSI)
The XBee ZB modules (non-PRO versions only) have been tested for use in several European
countries. For a complete list, refer to [Link].
If the modules are incorporated into a product, the manufacturer must ensure compliance of the
final product to the European harmonized EMC and low-voltage/safety standards. A Declaration of
Conformity must be issued for each of these standards and kept on file as described in Annex II of
the R&TTE Directive.
Furthermore, the manufacturer must maintain a copy of the XBee user manual documentation and
ensure the final product does not exceed the specified power ratings, antenna specifications, and/or
installation requirements as specified in the user manual. If any of these specifications are exceeded
in the final product, a submission must be made to a notified body for compliance testing to all
required standards.
The CE mark shall consist of the initials CE taking the following form:
If the CE marking is reduced or enlarged, the proportions given in the above graduated drawing
must be respected
The CE marking must have a height of at least 5mm except where this is not possible on account
of the nature of the apparatus
216
Canada (IC)
Restrictions
France: Outdoor use limited to 10 mW EIRP within the band 2454-2483.5 MHz.
Norway: Norway prohibits operation near Ny-Alesund in Svalbard. More information can be found at
the Norway Posts and Telecommunications site ([Link]).
Italy: For private use, a general authorization is required if WAS/RLANs are used outside own
premises. For public use, a general authorization is required.
Russian Federation:
Maximum mean EIRP density is 20 mW/MHz, maximum 100 mW EIRP permitted to use SRD for
outdoor applications only, for purposes of gathering telemetry information for automated
monitoring and resources accounting systems or security systems
Maximum mean EIRP density is 10 mW/MHz, maximum 100 mW EIRP for indoor applications
Ukraine: EIRP must be less than or equal to 100 mW with built-in antenna, with amplification factor
up to 6 dBi.
Declarations of Conformity
Digi has issued Declarations of Conformity for the XBee RF Modules concerning emissions, EMC and
safety. Files can be obtained by contacting Digi Support.
Important Note:
Digi does not list the entire set of standards that must be met for each country. Digi customers
assume full responsibility for learning and meeting the required guidelines for each country in their
distribution market. For more information relating to European compliance of an OEM product
incorporating the XBee RF Module, contact Digi, or refer to the following web sites:
CEPT ERC 70-03E - Technical Requirements, European restrictions and general requirements:
Available at [Link]/.
R&TTE Directive - Equipment requirements, placement on market: Available at [Link]/.
Antennas
The following antennas have been tested and approved for use with the XBee ZB RF Module:
Dipole (2.1 dBi, Omni-directional, Articulated RPSMA, Digi part number A24-HABSM)
Canada (IC)
Labeling requirements
Labeling requirements for Industry Canada are similar to those of the FCC. A clearly visible label on
the outside of the final product enclosure must display the following text.
217
Australia (RCM/C-Tick)
The integrator is responsible for its product to comply with IC ICES-003 & FCC Part 15, Sub. B Unintentional Radiators. ICES-003 is the same as FCC Part 15 Sub. B and Industry Canada accepts FCC
test report or CISPR 22 test report for compliance with ICES-003.
Detachable antenna
To reduce potential radio interference to other users, the antenna type and gain should be so chosen
that the equivalent, isotropically radiated power (EIRP) is not more than permitted for successful
communication.
Australia (RCM/C-Tick)
These modules comply with requirements to be used in end products in Australia. All products with
EMC and radio communications must have a registered RCM/C-Tick mark. Registration to use the
compliance mark will only be accepted from Australian manufacturers or importers, or their agent, in
Australia.
In order to have a RCM/C-Tick mark on an end product, a company must comply with a or b below.
a. have a company presence in Australia.
b. have a company/distributor/agent in Australia that will sponsor the importing of the end
product.
Contact Digi for questions related to locating a contact in Australia.
218
219
Pin mapping
Mapping of the Surface Mount (SMT) pads to the Through-hole (TH) pins is shown in the table below.
The pin names are from the S2C SMT module.
SMT Pin #
Name
GND
VCC
DOUT / DIO13
DIO12
RESET
PWM1 / DIO11
[reserved]
10
11
GND
10
12
13
GND
14
SPI_CLK / DIO18
15
SPI_SSEL / DIO17
16
SPI_MOSI / DIO16
TH Pin #
220
Mounting
SMT Pin #
Name
TH Pin #
17
SPI_MISO / DIO15
18
[reserved]
19
[reserved]
20
[reserved]
21
[reserved]
22
GND
23
[reserved]
24
DIO4
11
25
CTS / DIO7
12
26
ON / SLEEP / DIO9
13
27
VREF
14
28
ASSOCIATE / DIO5
15
29
RTS / DIO6
16
30
AD3 / DIO3
17
31
AD2 / DIO2
18
32
AD1 / DIO1
19
33
AD0 / DIO0
20
34
[reserved]
35
GND
36
RF
37
[reserved]
Mounting
One of the important differences between the Surface Mount and the Through-hole modules is the
way they mount to the PCB. Different mounting techniques are required.
Digi International has designed a footprint which will allow either module to be attached to a PCB.
The layout is shown below. All dimensions are in inches.
221
Mounting
The round holes in the diagram are for the Through-hole design, and the semi-oval pads are for the
SMT design. Pin 1 of the Through-hole design is lined up with pad 1 of the SMT design, but the pins
are actually offset by one pad (see Pin Mapping above). By using diagonal traces to connect the
appropriate pins, the layout will work for both modules.
Information on attaching the SMT module is included in Manufacturing information on page 223.
222
Manufacturing information
The XBee is designed for surface mount on the OEM PCB. It has castellated pads to allow for easy
solder attach inspection. The pads are all located on the edge of the module, so that there are no
hidden solder joints on these modules.
Temperature (degrees C)
30
65
60
100
90
135
120
160
150
195
180
240
210
260
223
c. The time between the opening of the sealed bag and the start of the reflow process cannot
exceed 168 hours if condition b) is met.
d. Baking is required if conditions b) or c) are not met.
e. Baking is required if the humidity indicator inside the bag indicates a RH of 10% more.
f. If baking is required, bake modules in trays stacked no more than 10 high for 4-6 hours at
125C.
Recommended footprint
It is recommended that you use the PCB footprint shown below for surface mounting. Dimensions
are in inches.
The solder footprint should be matched to the copper pads, but may need to be adjusted depending
on the specific needs of assembly and product standards. Recommended stencil thickness is
0.15mm/0.005. The component should be placed last and placement speed set to the slowest
setting.
While the underside of the module is mostly coated with solder resist, it is recommended that the
copper layer directly below the module be left open to avoid unintended contacts. Copper or vias
must not interfere with the three exposed RF test points on the bottom of the module (see below).
Furthermore, these modules have a ground plane in the middle on the back side for shielding
purposes, which can be affected by copper traces directly below the module.
224
&233(5
.((3287
Cleaning with liquids can result in liquid remaining under the shield or in the gap between the
module and the OEM PCB. This can lead to unintended connections between pads on the module
The residual moisture and flux residue under the module are not easily seen during an inspection
process
Factory recommended best practice is to use a no clean solder paste to avoid the issues above and
ensure proper module operation.
Reworking
Rework should never be performed on the module itself. The module has been optimized to give the
best possible performance, and reworking the module itself will void warranty coverage and
certifications. We recognize that some customers will choose to rework and void the warranty; the
following information is given as a guideline in such cases to increase the chances of success during
rework, though the warranty is still voided.
The module may be removed from the OEM PCB by the use of a hot air rework station, or hot plate.
Care should be taken not to overheat the module. During rework, the module temperature may rise
above its internal solder melting point and care should be taken not to dislodge internal components
from their intended positions.
225
Definitions
Definitions
ZigBee Node Types
Coordinator A node that has the unique function of forming a network. The coordinator is responsible for
establishing the operating channel and PAN ID for an entire network. Once established, the
coordinator can form a network by allowing routers and end devices to join to it. Once the
network is formed, the coordinator functions like a router (it can participate in routing packets
and be a source or destination for data packets).
Establishes/Organizes PAN
Mains-powered
226
Definitions
Router
A node that creates/maintains network information and uses this information to determine the
best route for a data packet. A router must join a network before it can allow other routers and
end devices to join to it.
A router can participate in routing packets and is intended to be a mains-powered node.
Mains-powered
End devices must always interact with their parent to receive or transmit data. (See joining
definition.) They are intended to sleep periodically and therefore have no routing capacity.
An end device can be a source or destination for data packets but cannot route packets. End
devices can be battery-powered and offer low-power operation.
ZigBee Protocol
PAN
Personal Area Network - A data communication network that includes a coordinator and
one or more routers/end devices.
Joining
The process of a node becoming part of a ZigBee PAN. A node becomes part of a network
by joining to a coordinator or a router (that has previously joined to the network). During
the process of joining, the node that allowed joining (the parent) assigns a 16-bit address
to the joining node (the child).
Network Address
The 16-bit address assigned to a node after it has joined to another node. The coordinator
always has a network address of 0.
Operating Channel The frequency selected for data communications between nodes. The operating channel
is selected by the coordinator on power-up.
Energy Scan
A scan of RF channels that detects the amount of energy present on the selected
channels. The coordinator uses the energy scan to determine the operating channel.
Route Request
Route Reply
Unicast transmission sent back to the originator of the route request. It is initiated by a
node when it receives a route request packet and its address matches the Destination
Address in the route request packet.
227
Definitions
Route Discovery
The process of establishing a route to a destination node when one does not exist in the
Routing Table. It is based on the AODV (Ad-hoc On-demand Distance Vector routing)
protocol.
ZigBee Stack
ZigBee is a published specification set of high-level communication protocols for use with
small, low-power modules. The ZigBee stack provides a layer of network functionality on
top of the 802.15.4 specification.
For example, the mesh and routing capabilities available to ZigBee solutions are absent in
the 802.15.4 protocol.
228