XBee®/XBee‐PRO® SMT ZB RF Modules
XBee®/XBee-PRO® SMT ZB RF Modules
This manual describes the operation of the XBee® /XBee-PRO® SMT ZB RF module, which consists of ZigBee
firmware loaded onto XBee® S2C and S2C PRO hardware. The XBee® /XBee-PRO® SMT ZB RF Modules are
designed to operate within the ZigBee protocol and support the unique needs of low-cost, low-power wireless
sensor networks. The modules require minimal power and provide reliable delivery of data between remote
devices. The modules operate within the ISM 2.4 GHz frequency band.
Digi International Inc.
11001 Bren Road East
Minnetonka, MN 55343 877 912-3444 or 952 912-3444
© 2010 Digi International, Inc. Page 1
XBee®/XBee‐PRO® SMT ZB RF Modules
http://www.digi.com
© 2010 Digi International, Inc. All rights reserved
No part of the contents of this manual may be transmitted or reproduced in any form or by any means without the
written permission of Digi International, Inc.
ZigBee® is a registered trademark of the ZigBee Alliance.
XBee® and XBee-PRO® are registered trademarks of Digi International, Inc.
Technical Support: Phone: (866) 765-9885 toll-free U.S.A. & Canada
(801) 765-9885 Worldwide
8:00 am - 5:00 pm [U.S. Mountain Time]
Live Chat: www.digi.com
Online Support: http://www.digi.com/support/eservice/login.jsp
Email: rf-experts@digi.com
© 2010 Digi International, Inc. Page 2
XBee®/XBee‐PRO® SMT ZB RF Modules
Contents
1. Overview ....................................................................................................................................... 13
Specifications .................................................................................................................................... 13
General Specifications ................................................................................................................... 13
RF Specifications ............................................................................................................................ 13
Electrical Specifications .................................................................................................................. 14
Environmental Specifications ......................................................................................................... 14
Serial Communications Specifications ............................................................................................ 14
Network and Security .................................................................................................................... 15
GPIO Specifications ........................................................................................................................ 15
Agency Approvals .......................................................................................................................... 16
Hardware Specifications for Programmable Variant ....................................................................... 16
What’s New ....................................................................................................................................... 17
Firmware ....................................................................................................................................... 17
Manual .......................................................................................................................................... 17
Pin Signals ......................................................................................................................................... 18
EM357 Pin Mappings ......................................................................................................................... 19
Design Notes ..................................................................................................................................... 19
Power Supply ................................................................................................................................. 19
Recommended Pin Connections..................................................................................................... 20
Board Layout ................................................................................................................................. 20
Module Operation for Programmable Variant ................................................................................ 23
XBEE Programmable Bootloader ........................................................................................................ 25
Overview ....................................................................................................................................... 25
Bootloader Software Specifics........................................................................................................ 25
Bootloader Menu Commands ........................................................................................................ 30
Firmware Updates ......................................................................................................................... 31
Output File Configuration .............................................................................................................. 32
1. RF Module Operation .................................................................................................................... 33
Serial Communications ...................................................................................................................... 33
UART Communications .................................................................................................................. 33
SPI Communications ...................................................................................................................... 34
© 2010 Digi International, Inc. Page 3
XBee®/XBee‐PRO® SMT ZB RF Modules
Serial Buffers ................................................................................................................................. 35
Serial Flow Control ......................................................................................................................... 36
Serial Interface Protocols ............................................................................................................... 36
Modes of Operation .......................................................................................................................... 39
Idle Mode ...................................................................................................................................... 39
Transmit Mode .............................................................................................................................. 39
Receive Mode ................................................................................................................................ 40
Command Mode ............................................................................................................................ 40
Sleep Mode ................................................................................................................................... 42
3. XBee ZigBee Networks ....................................................................................................................... 43
Introduction to ZigBee ....................................................................................................................... 43
ZigBee Stack Layers............................................................................................................................ 43
Networking concepts ......................................................................................................................... 43
Device Types .................................................................................................................................. 43
PAN ID ........................................................................................................................................... 44
Operating Channel ......................................................................................................................... 45
ZigBee Application Layers: In Depth ................................................................................................... 45
Application Support Sublayer (APS) ................................................................................................ 45
Application Profiles ........................................................................................................................ 45
Clusters ......................................................................................................................................... 46
Endpoints ...................................................................................................................................... 46
ZigBee Device Profile ..................................................................................................................... 47
ZigBee Device Objects (ZDO) .......................................................................................................... 47
Coordinator Operation ...................................................................................................................... 47
Forming a Network ........................................................................................................................ 47
Channel Selection .......................................................................................................................... 47
PAN ID Selection ............................................................................................................................ 47
Security Policy ............................................................................................................................... 47
Persistent Data .............................................................................................................................. 47
XBee ZB Coordinator Startup ............................................................................................................. 48
Permit Joining ................................................................................................................................ 49
Resetting the Coordinator .............................................................................................................. 49
© 2010 Digi International, Inc. Page 4
XBee®/XBee‐PRO® SMT ZB RF Modules
Leaving a Network ......................................................................................................................... 49
Replacing a Coordinator (Security Disabled Only) ........................................................................... 50
Example: Starting a Coordinator .................................................................................................... 50
Example: Replacing a Coordinator (security disabled) .................................................................... 51
Router Operation .............................................................................................................................. 51
Discovering ZigBee Networks ........................................................................................................ 51
Joining a Network ......................................................................................................................... 51
Authentication .............................................................................................................................. 52
Persistent Data .............................................................................................................................. 52
XBee ZB Router Joining ................................................................................................................. 52
Permit Joining ............................................................................................................................... 53
Joining Always Enabled ................................................................................................................. 53
Joining Temporarily Enabled ......................................................................................................... 53
Router Network Connectivity ........................................................................................................ 53
Leaving a Network ........................................................................................................................ 55
Resetting the Router ..................................................................................................................... 56
Example: Joining a Network ......................................................................................................... 56
End Device Operation ....................................................................................................................... 56
Discovering ZigBee Networks ........................................................................................................ 56
Joining a Network ......................................................................................................................... 57
Parent Child Relationship .............................................................................................................. 57
End Device Capacity ...................................................................................................................... 57
Authentication .............................................................................................................................. 57
Persistent Data .............................................................................................................................. 57
Orphan Scans ................................................................................................................................ 57
XBee: ZB End Device Joining .......................................................................................................... 57
Parent Connectivity ....................................................................................................................... 58
Resetting the End Device .............................................................................................................. 59
Leaving a Network ........................................................................................................................ 59
Example: Joining a Network .......................................................................................................... 59
Channel Scanning .............................................................................................................................. 60
Managing Multiple ZigBee Networks ................................................................................................ 60
© 2010 Digi International, Inc. Page 5
XBee®/XBee‐PRO® SMT ZB RF Modules
Pan ID Filtering.................................................................................................................................. 60
Preconfigured Security Keys .......................................................................................................... 60
Permit Joining ............................................................................................................................... 60
Application Messaging .................................................................................................................. 60
4. Transmission, Addressing, and Routing ............................................................................................ 62
Addressing ........................................................................................................................................ 62
64-bit device Address .................................................................................................................... 62
16-bit Device Address ................................................................................................................... 62
Application Layer Addressing ........................................................................................................ 62
Data Transmission ......................................................................................................................... 62
Broadcast Transmissions ............................................................................................................... 62
Unicast Transmissions ................................................................................................................... 63
DATA Transmission Examples ....................................................................................................... 65
RF Packet Routing ............................................................................................................................. 66
Link Status Transmission ................................................................................................................... 67
AODV Mesh Routing ......................................................................................................................... 68
Many-to-One Routing ....................................................................................................................... 70
Source Routing .................................................................................................................................. 71
Acquiring Source Routes ............................................................................................................... 72
Storing Source Routes ....................................................................................................................... 72
Sending a Source Routed Transmission ......................................................................................... 72
Repairing Source Routes ............................................................................................................... 73
Retries and Acknowledgments ...................................................................................................... 73
Encrypted Transmissions .................................................................................................................. 74
Maximum RF Payload Size ................................................................................................................ 74
Throughput ....................................................................................................................................... 74
ZDO Transmissions ............................................................................................................................ 75
ZigBee Device Objects (ZDO) ......................................................................................................... 75
Sending a ZDO Command .............................................................................................................. 76
Receiving ZDO Commands and Responses .................................................................................... 76
Transmission Timeouts ..................................................................................................................... 77
Unicast Timeout ............................................................................................................................ 78
© 2010 Digi International, Inc. Page 6
XBee®/XBee‐PRO® SMT ZB RF Modules
Extended Timeout ......................................................................................................................... 78
Transmission Examples ................................................................................................................. 79
5. Security ......................................................................................................................................... 81
Security Modes ................................................................................................................................. 81
ZigBee Security Model ...................................................................................................................... 81
Network Layer Security ................................................................................................................. 81
Frame Counter .............................................................................................................................. 82
Message Integrity code ................................................................................................................. 82
Network Layer Encryption and Decryption ................................................................................... 82
Network Key Updates ................................................................................................................... 82
APS Layer Security ......................................................................................................................... 82
Message Integrity Code ................................................................................................................. 83
APS Link Keys ................................................................................................................................ 83
APS Layer Encryption and Decryption ........................................................................................... 83
Network and APS Layer Encryption ............................................................................................... 83
Trust Center .................................................................................................................................. 84
Forming and Joining a secure Network ......................................................................................... 84
Implementing Security on the XBee .................................................................................................. 84
Enabling Security ........................................................................................................................... 84
Setting the Network Security Key ................................................................................................. 85
Setting the APS Trust Center Link Key ........................................................................................... 85
Enabling APS Encryption ............................................................................................................... 85
Using a Trust Center ...................................................................................................................... 85
XBee Security Examples .................................................................................................................... 86
Example 1: Forming a network with security (pre-configured link keys) ....................................... 86
Example 1: Forming a network with security (obtaining keys during joining) ............................... 86
6. Network Commissioning and Diagnostics ..................................................................................... 88
Device Configuration......................................................................................................................... 88
Device Placement ............................................................................................................................. 88
Link Testing ................................................................................................................................... 88
RSSI Indicators .............................................................................................................................. 89
Device Discovery ............................................................................................................................... 89
© 2010 Digi International, Inc. Page 7
XBee®/XBee‐PRO® SMT ZB RF Modules
Network Discovery ........................................................................................................................ 89
ZDO Discovery ............................................................................................................................... 89
Joining Announce .......................................................................................................................... 89
Commissioning Pushbutton and Associate LED ................................................................................. 89
Commissioning Pushbutton .......................................................................................................... 90
Associate LDE ................................................................................................................................ 90
7. Managing End Devices .................................................................................................................. 93
End Device Operation ....................................................................................................................... 93
Parent Operation .............................................................................................................................. 93
End Device Poll Timeouts .............................................................................................................. 94
Packet Buffer Usage ...................................................................................................................... 94
Non-Parent Device Operation ........................................................................................................... 94
XBee End Device Configuration ......................................................................................................... 95
Pin Sleep ....................................................................................................................................... 95
Cyclic Sleep ................................................................................................................................... 97
Transmitting RF Data................................................................................................................... 100
Receiving RF Data ........................................................................................................................ 100
IO Sampling ................................................................................................................................. 101
Waking End Devices with the Commissioning Pushbutton.......................................................... 101
Parent Verification ...................................................................................................................... 101
Rejoining ..................................................................................................................................... 101
XBee Router/Coordinator Configuration......................................................................................... 101
RF Packet Buffering Timeout ....................................................................................................... 102
Child Poll Timeout ....................................................................................................................... 102
Transmission Timeout ................................................................................................................. 102
Putting it all Together ..................................................................................................................... 102
Short Sleep Periods ..................................................................................................................... 102
Extended Sleep Periods ............................................................................................................... 103
Sleep Examples ............................................................................................................................... 103
Configure a device to sleep for 20 seconds, but set SN such that the On/Sleep line will remain
deasserted for up to 1 minute. .................................................................................................... 103
© 2010 Digi International, Inc. Page 8
XBee®/XBee‐PRO® SMT ZB RF Modules
Configure an end device to sleep for 20 seconds, send 4 IO samples in 2 seconds, and return to
sleep. .......................................................................................................................................... 103
Configure a device for extended sleep: to sleep for 4 minutes. .................................................. 104
8. XBee Analog and Digital IO Lines................................................................................................. 105
IO Configuration.............................................................................................................................. 105
IO Sampling ..................................................................................................................................... 106
Queried Sampling........................................................................................................................ 107
Periodic IO Sampling ................................................................................................................... 108
Change Detection Sampling ........................................................................................................ 108
RSSI PWM ....................................................................................................................................... 108
IO Examples .................................................................................................................................... 109
Example 1: Configure the following IO settings on the XBee....................................................... 109
Example 2: Calculate the PWM counts for a packet received with an RSSI of -84dBm. ............... 109
Example 3: Configure the RSSI/PWM pin to operate for 2 seconds after each received RF packet.
.................................................................................................................................................... 109
9. API Operation ............................................................................................................................. 110
API Frame Specifications ................................................................................................................. 110
API Operation (AP parameter = 1) ............................................................................................... 110
API Operation-with Escape Characters (AP parameter = 2) ......................................................... 110
API Examples ............................................................................................................................... 112
API UART and SPI Exchanges ........................................................................................................... 112
AT Commands ............................................................................................................................. 112
Transmitting and Receiving RF Data ............................................................................................ 113
Remote AT commands ................................................................................................................ 113
Source Routing ............................................................................................................................ 114
Supporting the API .......................................................................................................................... 114
API Frames ...................................................................................................................................... 115
AT Command............................................................................................................................... 115
AT Command-Queue Parameter Value ....................................................................................... 115
ZigBee Transmit Request............................................................................................................. 116
Explicit Addressing ZigBee Command Frame ............................................................................... 118
Remote AT Command Request ................................................................................................... 120
© 2010 Digi International, Inc. Page 9
XBee®/XBee‐PRO® SMT ZB RF Modules
Create Source Route ................................................................................................................... 120
AT Command Response .............................................................................................................. 122
Modem Status ............................................................................................................................. 122
ZigBee Transmit Status ................................................................................................................ 123
ZigBee Receive Packet ................................................................................................................. 124
ZigBee Explicit RX Indicator ......................................................................................................... 125
ZigBee IO Data Sample RX Indicator ............................................................................................ 126
XBee Sensor Read Indicator ........................................................................................................ 127
Node Identification Indicator ...................................................................................................... 129
Remote Command Response ...................................................................................................... 130
Over-the-Air Firmware Update Status......................................................................................... 131
Route Record Indicator ............................................................................................................... 132
Many-to-One Route Request Indicator ....................................................................................... 133
Sending ZigBee device objects (ZDO) Commands with the API ................................................... 134
Sending ZigBee Cluster Library (ZCL) Commands with the API .................................................... 136
Sending Public Profile Commands with the API .......................................................................... 139
10. XBee Command Reference Tables ........................................................................................... 142
Addressing ...................................................................................................................................... 142
Networking ..................................................................................................................................... 143
Security ........................................................................................................................................... 145
RF Interfacing .................................................................................................................................. 146
Serial Interfacing ............................................................................................................................. 148
Serial Interfacing ............................................................................................................................. 149
Diagnostics Interfacing .................................................................................................................... 152
AT Command Options ..................................................................................................................... 153
Sleep Commands ............................................................................................................................ 153
Execution Commands ..................................................................................................................... 154
11. Module Support ...................................................................................................................... 156
X-CTU Configuration Tool ................................................................................................................ 156
Customizing XBee ZB Firmware....................................................................................................... 156
Design Considerations for Digi Drop-In Networking ........................................................................ 156
XBee Bootloader ............................................................................................................................. 156
© 2010 Digi International, Inc. Page 10
XBee®/XBee‐PRO® SMT ZB RF Modules
Programming XBee Modules........................................................................................................... 157
Serial Firmware Updates ............................................................................................................. 157
Invoke XBee Bootloader .............................................................................................................. 157
Send Firmware Image ................................................................................................................. 157
Writing Custom Firmware ............................................................................................................... 158
Regulatory Compliance ............................................................................................................... 158
Configuring GPIOs ....................................................................................................................... 159
Detecting XBee vs. XBee-PRO...................................................................................................... 159
12. Agency Certifications ............................................................................................................... 160
United States FCC ............................................................................................................................ 160
OEM Labeling Requirements ....................................................................................................... 160
FCC Notices ................................................................................................................................. 160
FCC-Approved Antennas (2.4 GHz) .............................................................................................. 161
RF Exposure................................................................................................................................. 164
Europe (ETSI) ................................................................................................................................... 165
OEM Labeling Requirements ....................................................................................................... 165
Restrictions ................................................................................................................................. 165
Declarations of Conformity ......................................................................................................... 165
Approved Antennas .................................................................................................................... 166
XBee RF Module .......................................................................................................................... 166
Canada (IC) ...................................................................................................................................... 167
Transmitters with Detachable Antennas ..................................................................................... 167
Detachable Antenna ................................................................................................................... 167
Australia (C-Tick) ............................................................................................................................. 167
13. Migrating from XBee S2B to XBee S2C .................................................................................... 168
Pin Mapping .................................................................................................................................... 168
Mounting ........................................................................................................................................ 168
14. Manufacturing Information ..................................................................................................... 170
Recommended Solder Reflow Cycle ................................................................................................ 170
Recommended Footprint ................................................................................................................ 171
Flux and Cleaning ............................................................................................................................ 171
Reworking ....................................................................................................................................... 172
© 2010 Digi International, Inc. Page 11
XBee®/XBee‐PRO® SMT ZB RF Modules
15. Warranty Information ............................................................................................................. 173
1-Year Warranty ............................................................................................................................. 173
Appendix A: Definitions ..................................................................................................................... 174
Definitions ...................................................................................................................................... 174
ZigBee Node Types ...................................................................................................................... 174
ZigBee Protocol ........................................................................................................................... 175
© 2010 Digi International, Inc. Page 12
1. Overview
XBee® and XBee-PRO® S2C SMT ZB embedded RF modules provide wireless connectivity to end-point
devices in ZigBee mesh networks. Utilizing the ZigBee PRO Feature Set, these modules are interoperable
with other ZigBee devices, including devices from other vendors. With XBee, users can have their ZigBee
network up-and-running in a matter of minutes without configuration or additional development. The
programmable XBee® and XBee-PRO® S2C SMT ZB modules incorporate a Freescale SO8 microprocessor
for customization and application development.
XBee® and XBee-PRO® ZB Modules are compatible with other devices that use XBee® “ZB" technology.
These include ConnectPort X gateways, XBee® and XBee-PRO® Adapters, XBee Wall Routers, XBee
Sensors, and other products when designated with the "ZB" product name. Devices that do not have the
"ZB" product name, including Digi's line of DigiMesh and 802.15.4 XBee products, are not compatible with
XBee® and XBee-PRO® ZB Modules.
Network interoperability with ZigBee devices from other vendors requires that the ZigBee Feature Set or
ZigBee PRO Feature Set be deployed on all devices. Contact Digi Support for details.
XBee®/XBee‐PRO® SMT ZB RF Modules
Specifications
General Specifications
Specification XBee (S2C) XBee-PRO (S2C)
Performance
Dimensions 0.866 X 1.3" (2.199 X 3.302 cm)
Operating Temperature -40 to 85° C (Industrial)
Antenna Options RF Pad, PCB Antenna, or U.FL Connector
RF Specifications
Specification
Performance
Frequency ISM 2.4-2.5GHz
Number of Channels 16 Direct Sequence Channels 16
Channels 11 to 26 11 to 26
Adjustable Power Yes
Interface immunity
Indoor/Urban Range 200 ft 300 Ft
Outdoor RF line-of-sight
Range
XBee
up to 4000 ft (1200m) Up to 2 miles
(S2C) XBee-PRO
DSSS (Direct Sequence Spread Spectrum)
(S2C)
Transmit Power Output
© 2010 Digi International, Inc. Page 13
2mW (3dBm) Normal mode
Channel 26 max power is 3dBm
360mW (18dBm)
XBee®/XBee‐PRO® SMT ZB RF Modules
RF Data Rate 250,000 bps
Receiver Sensitivity
-
-100dBm, Normal mode
Electrical Specifications
-101dBm, Boost mode
99dBm, Normal mode
Specification
XBee® (S2C) XBee-PRO® (S2C)
Performance
Supply Voltage
2.2 – 3.6V for Programmable
2.7 -3.6V
Version
(transmit, max output power)
45mA (@3.3V Boost mode
33mA (@3.3V, Normal mode)
100mA at 18dBm
31mA
(Receive)
28mA (@3.3V, Normal mode)
Idle Current (Receiver off) 9mA 9mA
Power-down Current <1uA @25C <1uA @ 25C
Environmental Specifications
Specification XBee (S2C) XBee-PRO (S2C)
Performance
ESD 3000 V HBM >4000 V HBM
MSL 3 3
ROHS Compliant
Serial Communications Specifications
The XBee® /XBee-PRO® SMT ZB RF modules support both UART (Universal Asynchronous
Receiver/Transmitter) and SPI (Serial Peripheral Interface, in master or slave mode) serial connections.
UART
The SC1 (Serial Communication Port 1) of the Ember 357 is connected to the UART port.
UART Pin Assignments
Specification XBee (S2C) XBee-PRO (S2C)
UART Pins Module Pin Number
DOUT 3
DIN/nCONFIG 4
nCTS/DIO7 25
nRTS/DIO6 29
© 2010 Digi International, Inc. Page 14
XBee®/XBee‐PRO® SMT ZB RF Modules
PAN ID and Addresses, Cluster IDs
More information on UART operation is found in the UART section in chapter 2
SPI
The SC2 (Serial Communication Port 2) of the Ember 357 is connected to the SPI port.
SPI Pin Assignments
Specification XBee (S2C) XBee-PRO (S2C)
SPI Pins Module Pin Number
SPI_SCLK/DIO18 14
SPI_nSSEL/DIO17 15
SPI_MOSI/DIO16 16
SPI_MISO/DIO15 17
For more information on SPI operation see the SPI section in chapter 2
Network and Security
Specification XBee (S2C) XBee-PRO (S2C)
Performance
Supported Network
Topologies
Point-to-point, Point-to-multipoint,
Peer-to-peer, and Mesh
Addressing Options
and Endpoints (optional)
GPIO Specifications
The XBee® /XBee-PRO® SMT ZB RF modules have 16 GPIO (General Purpose Input Output) ports available.
Those available will depend on the module configuration as some GPIO pads are consumed by serial
communication, etc.
See GPIO section for more information on configuring and using GPIO ports
Electrical Specification for GPIO pads
Specification XBee (S2C) XBee-PRO (S2C)
Performance Module Pin Number
Voltage Supply 2.1 to 3.6V
Low Schmitt switching
threshold
threshold
Input current for logic 0
Input current for logic 1 0.5uA
Input pull-up resistor value 29kΩ
0.42 to 0.5 X VDD
0.62 to 0.8 X VDD
-0.5uA
© 2010 Digi International, Inc. Page 15
XBee®/XBee‐PRO® SMT ZB RF Modules
Input pull-down resistor value 29kΩ
Output voltage for logic 0 0.18 X VDD (Max)
Output voltage for logic 1 0.82 X VDD (Min)
Output source current for pad
numbers 3, 4, 5, 10, 12, 14,
4mA
16, 17, 26, 28, 29, 30, and 32
Output sink current for pad
numbers 3, 4, 5, 10, 12, 14,
4mA
16, 17, 26, 28, 29, 30, and 33
Output source current for pad
numbers 7,8,24,31, and 33
Output sink current for pad
numbers 7,8,24,31, and 34
Total output current (for I/O
Pads)
8mA
8mA
40mA
Agency Approvals
Specification XBee (S2C) XBee-PRO (S2C)
Performance
United States (FCC Part
15.247)
FCC ID: MCQ-XBS2C FCC ID: MCQ-XBPS2C
Industry Canada (IC) IC: 1846A-XBS2C IC: 1846A-XBPS2C
Europe (DC) ETSI
Australia C-Tick C-Tick
Japan Pending
FCC Approval (USA) Refer to Chapter 12 FCC Requirements. Systems that contain XBee®/ XBee-PRO® ZB RF Modules inherit Digi
Certifications.
Hardware Specifications for Programmable Variant
The following specifications need to be added to the current measurement of the previous table if the module
has the programmable secondary processor. For example, if the secondary processor is running and constantly
collecting DIO samples at a rate while having the RF portion of the XBEE sleeping the new current will be I total
= Ir2 + Is. Where Ir2 is the runtime current of the secondary processor and is the sleep current of the RF
portion of the module of the XBEE-PRO (S2B) listed in the table below.
Specifications of the programmable secondary processor
© 2010 Digi International, Inc. Page 16
XBee®/XBee‐PRO® SMT ZB RF Modules
Runtime current for 32K running at 1MHz
For additional Specifications see Freescale
Minimum Reset low pulse time for EM357
Optional Secondary Processor Specification
Datasheet and Manual
What’s New
Firmware
Manual
specifications (Add to RX, TX and Sleep
currents depending on mode of
operation)
MC9S08QE32
© 2010 Digi International, Inc. Page 17
XBee®/XBee‐PRO® SMT ZB RF Modules
Pin Signals
Pin Assignments for the XBee S2C and XBee S2C Pro modules
(Low-asserted signals are distinguished with a lower case n before the signal name.)
Pin # Name Direction Default State Description
1 GND - - Ground
2 VCC - - Power Supply
3 DOUT/DIO13 Both Output Uart Data out/GPIO
4 Din/nConfig/DIO14 Both Input Uart Data In/GPIO
5 DIO12 Both GPIO
6 nRESET Both Module Reset
7 RSSI PWM/ DIO10 Both RX Signal Strength Indicator/ GPIO
8 PWM1/DIO11 Both Pulse Width Modulator/GPIO
9 reserved - Disabled Do Not Connect
10 nDTR/SLEEP_RQ/DIO8 Both Input Pin Sleep Control line /GPIO
11 GND - - Ground
12 SPI_Attn/nBOOTMODE Output Output
13 GND - - Ground
14 SPI_CLK/DIO18 Both Serial Peripheral Interface Clock/GPIO
15 SPI_nSSEL/DIO17 Both
16 SPI_MOSI/DOI16 Both
17 SPI_MOSO/DOI15 Both
18 JTCK/SWCLK Input JTAG Clock/Serial Wire Clock
19 JTDO/SWO Output
20 JTDI Input JTAG Data Input
21 JTMS/SWDIO Both
22 GND - - Ground
23 reserved - Disabled Do Not Connect
24 DIO4 Both GPIO
25 nCTS/DIO7 Both Output Clear-to-Send Flow Control/GPIO
26 On /SLEEP/DIO9 Output Output Module Status Indicator/GPIO
27 VREF Input -
28 Associate/DIO5 Both Output Associate Indicator/GPIO
29 nRTS/DIO6/SCLK2 Both Input Request-to-Send Flow Control/GPIO
30 AD3/DIO3 Both Analog Input/GPIO
31 AD2/DIO2 Both Analog Input/GPIO
32 AD0/DIO0 Both Analog Input/GPIO
33 AD1/DIO2 Both Analog Input/GPIO
34 reserved - Disabled Do Not Connect
35 GND - - Ground
36 RF Both - RF IO for RF Pad Variant
37 reserved - Disabled Do Not Connect
Serial Peripheral
Do not tie low on reset
Serial Peripheral Interface not
Select/GPIO
Serial Peripheral Interface Data
Input/GPIO
Serial Peripheral Interface Data
Output/GPIO
JTAG Data Output/Serial Wire Data
Output
Not used for EM357. Used for
programmable
secondary processor.
For compatibility with other XBEE
modules, we
recommend connecting this pin to the
voltage reference
if Analog sampling is desired.
Otherwise, connect to GND.
© 2010 Digi International, Inc. Page 18
XBee®/XBee‐PRO® SMT ZB RF Modules
EM357 Pin Mappings
The Following table shows how the EM357 pins are used on the XBee.
EM357 Pin # EM357 Name XBee Pin # Other Usage
12 nRst 6 Programming
18 GPIO PB3 8
19 GPIO PA7 29
20 GPIO PB4 25
21 GPIO PA0/SC2MOSI 16
22 GPIO PA1/SC2MOSO 17
24 GPIO PA2/SC2SCLK 14
25 GPIO PA3/SC2nSSEL 15
26 GPIO PA4 32 Programming
27 GPIO PA5/nBOOTMODE 12 Programming
29 GPIO PA6 7
30 GPIO PB1 3
31 GPIO PB2 4
32 SWCLK,JTCK 18 Programming
33 GPIO PC2/JTDO/SWO 19 Programming
34 GPIO PC3/JTDI 20 Programming
35 GPIO PC4/JTMS/SWDIO 21 Programming
36 GPIO PB0 10
38 GPIO PC1 30
41 GPIO PB7,ADC2 31
42 GPIO PB6,ADC1 33
43 GPIO PB5,ADC0 Temp Sensor on PRO Version
NOTE: Some lines may not go to the external XBEE pads in the programmable secondary processor version
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.
Power Supply
Poor power supply can lead to poor radio performance especially if the supply voltage is not kept within
tolerance or is excessively noisy. To help reduce noise a 1uF and 8.2pF capacitor are recommended to be
placed as near to pin1 on the PCB as possible. If using a switching regulator for your power supply, switching
frequencies above 500 kHz are preferred. Power supply ripple should be limited to a maximum 250mV peak to
peak.
© 2010 Digi International, Inc. Page 19
XBee®/XBee‐PRO® SMT ZB RF Modules
Note – For designs using the programmable modules an additional 10uF decoupling cap is recommended near
pin 1 of the module. The nearest proximity to pin 1 of the 3 caps should be in the following order: 8.2pf, 1uF
followed by 10uF.
Recommended Pin Connections
The only required pin connections are VCC, GND, DOUT and DIN. To support serial firmware updates, VCC,
GND, DOUT, DIN, RTS, and DTR should be connected.
All unused pins should be left disconnected. All inputs on the radio can be pulled high with 30k internal pull-up
resistors using the PR software command. No specific treatment is needed for unused outputs.
For applications that need to ensure the lowest sleep current, inputs should never be left floating. Use internal
or external pull-up or pull-down resistors, or set the unused I/O lines to outputs.
Other pins may be connected to external circuitry for convenience of operation including the Associate LED
pad (pad 28) and the Commissioning pad (pad 33). The Associate LED pin will flash differently depending on
the state of the module to the network, and a pushbutton attached to pad 33 can enable various join
functions without having to send UART commands. Please see the commissioning pushbutton and associate
LED section in chapter 7 for more details. The source and sink capabilities are limited to 4mA for pad numbers
3, 4, 5, 10, 12, 14, 15, 16, 17, 25, 26, 28, 29, 30, and 32, and 8mA for pad numbers 7, 8, 24, 31, and 33 on the
module.
The VREF pin (pad 27) is not used on this module. For compatibility with other XBee modules, we recommend
connecting this pin to a voltage reference if analog sampling is desired. Otherwise, connect to GND.
Board Layout
XBee modules do not have any specific sensitivity to nearby processors, crystals or other PCB components.
Other than mechanical considerations, no special PCB placement is required for integrating XBee radios except
for those with integral antennas. In general, Power and GND traces should be thicker than signal traces and be
able to comfortably support the maximum currents.
The radios are also designed to be self sufficient and work with the integrated and external antennas without
the need for additional ground planes on the host PCB. However, considerations should be taken on the
choice of antenna and antenna location. Metal objects that are near an antenna cause reflections and may
reduce the ability for an antenna to efficiently radiate. Using an integral antenna in an enclosed metal box will
greatly reduce the range of a radio. For this type of application an external antenna would be a better choice.
External antennas should be positioned away from metal objects as much as possible. Metal objects next to
the antenna or between transmitting and receiving antennas can often block or reduce the transmission
distance. 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 and microwave ovens.
Antennas should reside above or away from any metal objects like batteries, tall electrolytic capacitors or
metal enclosures. Antenna elements radiate perpendicular to the direction they point. Thus a vertical
antenna emits across the horizon.
© 2010 Digi International, Inc. Page 20
XBee®/XBee‐PRO® SMT ZB RF Modules
PCB Antennas should not have any ground planes or metal objects above or below the module at the antenna
location. For best results the module should be in a plastic enclosure, instead of metal one. It should be placed
at the edge of the PCB to which it is mounted. The ground, power and signal planes should be vacant
immediately below the antenna section (See drawing for recommended keep out area).
© 2010 Digi International, Inc. Page 21
XBee®/XBee‐PRO® SMT ZB RF Modules
© 2010 Digi International, Inc. Page 22
XBee®/XBee‐PRO® SMT ZB RF Modules
Module Operation for Programmable Variant
The S2C modules with the programmable option have a secondary processor with 32k of flash and 2k of RAM.
This allows module integrators to put custom code on the XBEE module to fit their own unique needs. The
DIN, DOUT, RTS, CTS, and RESET lines are intercepted by the secondary processor to allow it to be in control of
the data transmitted and received. All other lines are in parallel and can be controlled by either the EM357 or
the MC9SO8QE micro (see Block Diagram for details). The EM357 by default has control of certain lines. These
lines can be released by the EM357 by sending the proper command(s) to disable the desired DIO line(s) (see
XBEE Command Reference Tables).
In order for the secondary processor to sample with ADCs, the XBEE pin 27 (VREF) needs to be connected to a
reference voltage.
Digi provides a bootloader that can take care of programming the processor over the air or through the serial
interface. This means that over the air updates can be supported through an XMODEM protocol. The
processor can also be programmed and debugged through a one wire interface BKGD (Pin 9).
© 2010 Digi International, Inc. Page 23
XBee®/XBee‐PRO® SMT ZB RF Modules
© 2010 Digi International, Inc. Page 24
XBee®/XBee‐PRO® SMT ZB RF Modules
XBEE Programmable Bootloader
Overview
The XBee Programmable module is equipped with a Freescale MC9S08QExx application processor. This
application processor comes with a supplied bootloader. The following section describes how to interface the
customer's application code running on this processor to the XBee Programmable module's supplied
bootloader. This section discusses how to initiate firmware updates using the supplied bootloader for wired
and over-the-air updates.
Bootloader Software Specifics
Memory Layout
Figure 1 shows the memory map for the MC9S08QE32 application processor.
The supplied bootloader occupies the bottom pages of the flash from 0xF200 to 0xFFFF. Application code
cannot write to this space.
The application code can exist in Flash from address 0x8400 to 0xF1BC. 1k of Flash from 0x8000 to 0x83FF is
reserved for Non Volatile Application Data that will not be erased by the bootloader during a flash update.
A portion of RAM is accessible by both the application and the bootloader. Specifically, there is a shared data
region used by both the application and the bootloader that is located at RAM address 0x200 to 0x215.
Application code should not write anything to AppResetCause or BLResetCause unless informing the
bootloader of the impending reset reason.
© 2010 Digi International, Inc. Page 25
XBee®/XBee‐PRO® SMT ZB RF Modules
© 2010 Digi International, Inc. Page 26
XBee®/XBee‐PRO® SMT ZB RF Modules
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 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 EM250 allowing for direct communication with the EM250. The only way
© 2010 Digi International, Inc. Page 27
XBee®/XBee‐PRO® SMT ZB RF Modules
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.
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.
Application Version String
Figure 1 shows an "Application version string pointer" area in application flash which holds the pointer to where
the application version string resides. The application's linker command file ultimately determines where this
string is placed in application flash.
It is preferable that the application version string be located at address 0x8400 for MC9S08QE32 parts. The
application string can be any characters terminated by the NULL character (0x00). There is not a strict limit on the
number of characters in the string, but for practical purposes should be kept under 100 bytes including the
terminating NULL character. During an update the bootloader erases the entire application from 0x8400 on. The
last page has the vector table specifically the redirected reset vector. The version string pointer and reset vector
are used to determine if the application is valid.
Application Interrupt Vector Table and Linker Command File
Since the bootloader flash region is read-only, the interrupt vector table is redirected to the region 0xF1C0 to
0xF1FD so that application developers can use hardware interrupts. Note that in order for Application interrupts to
function properly, the Application's linker command file (*.prm extension) must be modified appropriately to allow
the linker to place the developers code in the correct place in memory. For example, the developer desires to use
the serial communications port SCI1 receive interrupt. The developer would add the following line to the
Codewarrior linker command file for the project…
VECTOR ADDRESS 0x0000F1E0 vSci1Rx
This will inform the linker that the interrupt function "vSci1Rx()" should be placed at address 0x0000F1E0. Next,
the developer should add a file to their project "vector_table.c" that creates an array of function pointers to the
ISR routines used by the application…Eg.
extern void _Startup(void);/* _Startup located in Start08.c */
extern void vSci1Rx(void);/* sci1 rx isr */
extern short iWriteToSci1(unsigned char *);
void vDummyIsr(void);
#pragma CONST_SEG VECTORS
void (* const vector_table[])(void) = /* Relocated Interrupt vector table */{
vDummyIsr,/* Int.no. 0 Vtpm3ovf (at F1C0)Unassigned */
vDummyIsr, /* Int.no. 1 Vtpm3ch5 (at F1C2) Unassigned */
© 2010 Digi International, Inc. Page 28
XBee®/XBee‐PRO® SMT ZB RF Modules
vDummyIsr, /* Int.no. 2 Vtpm3ch4 (at F1C4) Unassigned */
vDummyIsr, /* Int.no. 3 Vtpm3ch3 (at F1C6) Unassigned */
vDummyIsr, /* Int.no. 4 Vtpm3ch2 (at F1C8) Unassigned */
vDummyIsr, /* Int.no. 5 Vtpm3ch1 (at F1CA) Unassigned */
vDummyIsr, /* Int.no. 6 Vtpm3ch0 (at F1CC) Unassigned */
vDummyIsr, /* Int.no. 7 Vrtc (at F1CE) Unassigned */
vDummyIsr, /* Int.no. 8 Vsci2tx (at F1D0) Unassigned */
vDummyIsr, /* Int.no. 9 Vsci2rx (at F1D2) Unassigned */
vDummyIsr, /* Int.no. 10 Vsci2err (at F1D4) Unassigned */
vDummyIsr, /* Int.no. 11 Vacmpx (at F1D6) Unassigned */
vDummyIsr, /* Int.no. 12 Vadc (at F1D8) Unassigned */
vDummyIsr, /* Int.no. 13 Vkeyboard (at F1DA) Unassigned */
vDummyIsr, /* Int.no. 14 Viic (at F1DC) Unassigned */
vDummyIsr, /* Int.no. 15 Vsci1tx (at F1DE) Unassigned */
vSci1Rx, /* Int.no. 16 Vsci1rx (at F1E0) SCI1RX */
vDummyIsr, /* Int.no. 17 Vsci1err (at F1E2) Unassigned */
vDummyIsr, /* Int.no. 18 Vspi (at F1E4) Unassigned */
vDummyIsr, /* Int.no. 19 VReserved12 (at F1E6) Unassigned */
vDummyIsr, /* Int.no. 20 Vtpm2ovf (at F1E8) Unassigned */
vDummyIsr, /* Int.no. 21 Vtpm2ch2 (at F1EA) Unassigned */
vDummyIsr, /* Int.no. 22 Vtpm2ch1 (at F1EC) Unassigned */
vDummyIsr, /* Int.no. 23 Vtpm2ch0 (at F1EE) Unassigned */
vDummyIsr, /* Int.no. 24 Vtpm1ovf (at F1F0) Unassigned */
vDummyIsr, /* Int.no. 25 Vtpm1ch2 (at F1F2) Unassigned */
vDummyIsr, /* Int.no. 26 Vtpm1ch1 (at F1F4) Unassigned */
vDummyIsr, /* Int.no. 27 Vtpm1ch0 (at F1F6) Unassigned */
vDummyIsr, /* Int.no. 28 Vlvd (at F1F8) Unassigned */
© 2010 Digi International, Inc. Page 29
XBee®/XBee‐PRO® SMT ZB RF Modules
vDummyIsr, /* Int.no. 29 Virq (at F1FA) Unassigned */
vDummyIsr, /* Int.no. 30 Vswi (at F1FC) Unassigned */
_Startup /* Int.no. 31 Vreset (at F1FE) Reset vector */
};
void vDummyIsr(void){
for(;;){
if(iWriteToSci1("STUCK IN UNASSIGNED ISR\n\r>"));
}
}
The interrupt routines themselves can be defined in separate files. The "vDummyIsr" function is used in
conjunction with "iWritetoSci1" for debugging purposes.
Bootloader Menu Commands
The bootloader accepts commands from both the local UART and OTA. All OTA commands sent must be Unicast
with only 1 byte in the payload for each command. A response will be returned to the sender. All Broadcast and
multiple byte OTA packets are dropped to help prevent general OTA traffic from being interpreted as a command
to the bootloader while in the menu.
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 local UART/SPI, or Over the Air), the download will proceed via wired or overthe-air respectively.
Adjust Timeout for Update Firmware – “T”
The "T" command changes the timeout before sending a NAK by Base-Time*2^(T). The Base-Time for the local
UART is different than the Base-Time for Over the Air. During a firmware update, the bootloader will automatically
increase the Timeout if repeat packets are received or multiple NAKs for the same packet without success occur.
Application Version String – “A”
The "A" command provides the version of the currently loaded application. If no application is present, "Unkown"
will be returned.
© 2010 Digi International, Inc. Page 30