Specifications
XBee®/XBee‐PRO®SERFModules
©2009DigiInternational,Inc. 116
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 SE, 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);
XBee-PRO Applications:
emberSetTxPowerMode(EMBER_TX_POWER_MODE_ALTERNATE); or
emberSetTxPowerMode(EMBER_TX_POWER_MODE_BOOST_AND_ALTERNATE);
XBee-PRO modules must also set a couple of IO lines to enable output power compensation. This
is shown below. Once the IO lines are initialized (after powerup), the XBee will enable the power
amplifier and LNA as needed.
On Powerup:
/* GPIO 2 should be set low for at least 10 milliseconds when coming up from power cycle. */
GPIO_DIRSETL = GPIO(2);// Set GPIO 2 as an output
GPIO_CLRL = GPIO(2);// Drive GPIO 2 low
/* After at least 10ms, GPIO 2 should be set high to power the output power compensation
circuitry.
At the same time GPIO 1 should be configured as an output and set low to enable the output
power compensation circuitry. */
GPIO_DIRSETL = GPIO(1) | GPIO(2);// Set GPIO 1,2 as outputs
GPIO_CLRL = GPIO(1);// Drive GPIO 1 low
GPIO_SETL = GPIO(2);// Drive GPIO 2 high
Improving Low Power Current Consumption
To improve low power current consumption, the XBee should set a couple of unused IO lines as
output low. This can be done during application initialization as shown below.