Setting up an XBee Serial 2 module as an AT Co-Ordinator - Part 1

Above: XBee Serial 2 module on Sparkfun XBee Explorer board
Programming a module as an AT Co-Ordinator is explained in the steps below. Each mesh radio network created using XBee modules needs one module configured with Co-Ordinator firmware settings. One or more modules in the radio network will be configured in "AT End Device" mode. The End Devices typically host sensors or actuators while the co-ordinator manages the network, and typically bridges network traffic to the Internet. The Co-Ordinator module may be mains powered, and in Arduino based projects may be sited on an Arduino XBee shield. Each XBee chip is programmed with firmware updates using X-CTU (available as a download from the Digi website). The "AT" in the name refers to the fact that once installed, the module can be switched from normal transmit/receive mode into command mode by sending it a modem AT command if AT command set firmware has been loaded into the module, which is useful for debugging purposes and running diagnostics.
The module is programmed by seating it on an XBee Explorer board connected by a USB cable to a PC with X-CTU and the FTDI driver software for the USB port installed.
Note that changing the firmware settings for a module to program it in Co-Ordinator mode may change its behaviour when connected to a host Windows PC running X-CTU depending on whether you pick the right versions of the module and firmware required using the user interface before you upload code to the module - it took several attempts for me to select the correct firmware versions despite this seemingly being an easy thing to do, you need to check settings carefully.
Incidentally, if you find that somehow you've got a firmware upgrade failure as a result of using X-CTU, and that you can't talk to your module any more, there's an excellent chance of recovering the situation by powering the module up with the reset pin connected to the GND pin on the XBee Explorer board using a breadboard jumper wire, then using X-CTU to write the default firmware settings back to the board. This is explained in a video linked to from the Digi support forum with the topic "recovering from a bad configuration"; there's a more XBee Explorer focused video from Robert Jacobs here, which explains the procedure if you don't already have a reset button to press. Once I had seen this, it all fell into place for me.

The screenshot above shows the first of two property sheet settings needed to configure an XBee 1mW Module in AT Co-Ordinator mode - see below though before copying the settings blindly.
Note the following settings (each numbered item corresponds to a red box over the group of settings in the screenshot above):
- The XBee module appears as a high-numbered serial port on the PC when connected; you will need to start X-CTU after connecting the XBee Explorer to your PC by the USB cable, allowing a moment or two for the device to be enabled. Each XBee Explorer seems to get allocated a different serial port number.
- Hardware settings are 9600-NONE-8-NONE-1
- The "Enable API" should not be checked; it is erroneously checked in this screenshot because I selected "API Co-Ordinator" firmware instead of "AT Co-Ordinator" firmware the first couple of times I tried to set the module up, and any "API" firmware prevents the modem from understanding AT commands, meaning that this box has to be checked in order to get the modem to respond to any X-CTU commands until the module has been reset.
- You have to choose the module type, be sure to select XB24-B if your module matches the image at the top of this post.
- Once XB24-B has been selected, you can choose the correct function set - make sure you choose ZIGBEE COORDINATOR AT (should be firmware version 1020).
- Select "Show Defaults" to load the default settings from your PC hard drive for this firmware combination. This sets all fields on the module to the correct values, very important (if you forget this step, you may inherit some values from a previous firmware upload when the module had a different function, which causes strange behaviour). Once the defaults have been loaded, pick a number for the PAN ID - here I've chosen 234; this has to be noted because it will be shared between modules in the mesh network as a common identifier. All other settings can be left as the defaults.
If you see these messages, you've successfully configured your AT Co-Ordinator.