
Module support
Writing custom firmware
XBee/XBee-PRO® S2C ZigBee® RF Module
263
XBee-PRO devices 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 so the device 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.
This section describes how to configure GPIOs to function correctly in custom applications that run on
the XBee modules.
Enable GPIO 1 and 2
For GPIO pins to be configurable, the application must set the GPIO_PxCFG registers to enable the
appropriate GPIO. The following table lists values for configuring the GPIO pins. Other functionality is
affected by these settings. See the EM357 datasheet from Ember for a complete listing of
functionality.
GPIO mode
GPIO_
PxCFGH/L Description
Analog
0x0
Analog input or output. When in analog mode, the digital input
(GPIO_PxIN) always reads 1.
Input (floating)
0x4
Digital input without an internal pull-up or pull-down. Output is
disabled.
Input
(pull-up or pull-down)
0x8
Digital input with an internal pull-up or pull-down. A set bit in
GPIO_PxOUT selects pull-up and a cleared bit selects pull-down.
Output is disabled.
Output (push-pull)
0x1
Push-pull output. GPIO_PxOUT controls the output.
Output (open-drain)
0x5
Open-drain output. GPIO_PxOUT controls the output. If a pull-up
is required, it must be external.
Alternate Output
(push-pull)
0x9
Push-pull output. An on-board peripheral controls the output.
Alternate Output
(open-drain)
0xD
Open-drain output. An on-board peripheral controls the output.
If a pull-up is required, it must be external.
For more information on configuring and setting GPIOs, consult the EM357 specification.
Detect XBee versus XBee-PRO
For some applications, you may need to determine if the code is running on an XBee or an XBee-PRO
device.
1. Use the PC7 pin on the EM357 to identify the device type.
2. Connect PC7 to ground on the XBee module.
3. Use the following code to determine if a device is an XBee or an XBee-PRO:
GPIO_PCSET = 0x80; // Enable pullup resistor
GPIO_PCCFGH &= 0x0fff; // Clear PC7 config
GPIO_PCCFGH |= 0x8000;// Set PC7 as input with pullup/pulldown
if (GPIO_PCIN & 0x80) {