User Manual
Table Of Contents
- 1. Overview
- 2. RF Module Operation
- 3. XBee ZigBee Networks
- Introduction to ZigBee
- ZigBee Stack Layers
- Networking Concepts
- ZigBee Application Layers: In Depth
- Coordinator Operation
- Router Operation
- End Device Operation
- Channel Scanning
- 4. Transmission, Addressing, and Routing
- 5. Security
- 6. Network Commissioning and Diagnostics
- 7. Managing End Devices
- 8. XBee Analog and Digital IO Lines
- 9. API Operation
- API Frame Specifications
- API UART Exchanges
- Supporting the API
- API Frames
- AT Command
- AT Command - Queue Parameter Value
- ZigBee Transmit Request
- Explicit Addressing ZigBee Command Frame
- Remote AT Command Request
- Create Source Route
- AT Command Response
- Modem Status
- ZigBee Transmit Status
- ZigBee Receive Packet
- ZigBee Explicit Rx Indicator
- ZigBee IO Data Sample Rx Indicator
- XBee Sensor Read Indicator
- Node Identification Indicator
- Remote Command Response
- Over-the-Air Firmware Update Status
- Route Record Indicator
- Many-to-One Route Request Indicator
- Sending ZigBee Device Objects (ZDO) Commands with the API
- Sending ZigBee Cluster Library (ZCL) Commands with the API
- Sending Public Profile Commands with the API
- 10. XBee Command Reference Tables
- 11. Module Support
- Appendix A: Definitions
- Appendix B: Agency Certifications
- Appendix C: Migrating from ZNet 2.5 to XBee ZB
- Appendix D: Additional Information
XBee®/XBee‐PRO®ZBRFModules
©2011DigiInternational,Inc. 141
Enabling GPIO 1 and 2
Most of the remaining sections in this chapter describe how to configure GPIO 1 and 2 to function correctly in
custom applications that run on the XBee and XBee-PRO modules. In order for GPIO pins 1 and 2 to be
configurable, the application must set the GPIO_CFG register to enable GPIO 1 and 2. Bits 4 - 7 in the
GPIO_CFG register control the functionality of various GPIO lines. The following table lists values for these bits
that enable GPIO 1 and 2. Other functionality is affected by these settings. See the EM250 datasheet from
Ember for a complete listing of functionality.
Example 1
The following code enables GPIO 0, 1, 2, 3, 9, 10, 11, and 12 and maintains all other GPIO_CFG bits.
int16u x;
x = GPIO_CFG;
x &= (0xFF0F); // Clear bits 4 - 7
GPIO_CFG = x;
Example 2
The following code enables GPIO 0, 1, 2, 3, and 12 and maintains all other GPIO_CFG bits.
int16u x;
x = GPIO_CFG;
x &= (0xFF0F); // Clear bits 4 - 7
x |= 0x0070; // Set bits 4 - 7 to 0111 as shown in the table above.
GPIO_CFG = x;
Detecting XBee vs. XBee-PRO
For some applications, it may be necessary to determine if the code is running on an XBee or an XBee-PRO
device. The GPIO1 pin on the EM250 is used to identify the module type (see table 1-03 in chapter 1). GPIO1 is
connected to ground on the XBee module. The following code could be used to determine if a module is an XBee
or XBee-PRO:
GPIO_DIRCLRL = GPIO(1);// Set GPIO1 as an input
GPIO_PUL |= GPIO(1);// Enable GPIO1 pullup resistor
ModuleIsXBeePro = (GPIO_INL & GPIO(1));//ModuleIsXBeePro > 0 if XBee-PRO, =0 if non-PRO.
Ensuring Optimal Output Power
XBee modules manufactured before February 2008 had an incorrect configuration setting that caused the
default output power mode to be set incorrectly. Digi's ZB and ZNet firmware compensate for this by setting the
output power mode in the application firmware.
Custom applications should call the emberSetTxPowerMode() function to set the output power mode as shown
below:
XBee Applications
emberSetTxPowerMode(EMBER_TX_POWER_MODE_DEFAULT); or
emberSetTxPowerMode(EMBER_TX_POWER_MODE_BOOST);
GPIO_CFG[7:4]Enabled Functionality Enabled Functionality
0000 GPIO 0, 1, 2, 3, 9, 10, 11, 12
0111 0111GPIO 0, 1, 2, 3, 12
1010 GPIO 0, 1, 2, 3
1101 GPIO 0, 1, 2, 3, 11, 12










