Wireless communication with XBee

XBee modules enable wireless, serial communication among devices.

To connect an XBee module to a DE2-115 board, use an XBee module on a serial base unit and connect it to the DE2-115's serial port via a male-male, null-modem serial cable. You'll also need to connect a 5-16V power adapter to the serial base unit.

To connect an XBee module to a computer, use an XBee module on a USB base unit and connect it to the computer's USB port.

To configure an XBee module, first connect it to a Windows computer. You may need to add a USB-serial adapter if your computer lacks a serial port and the XBee module is on a serial base unit. Then install and run the X-CTU program from Digi (look under Diagnostics, Utilities and MIBs). Under the PC Settings tab, select the COM port that is attached to your XBee module.

In order for X-CTU to communicate with the XBee module, both will need to use the same baud rate. When you start using a particular XBee module, you may need to try a few different baud rates to figure out what it has been set to. Configure the baud rate used by X-CTU under the PC Settings tab (the other settings should be no flow control, 8 data bits, no parity, 1 stop bit), then click Test/Query to see if X-CTU can communicate with the XBee module. The most common baud rates are 9600 and 115200.

Next, restore the XBee module to its default settings. Under the Modem Configuration tab, click Restore. The default baud rate is 9600, so you'll need to configure X-CTU's baud rate to 9600 to match.

After you've restored the XBee module to its default settings, you can configure its parameters (under the Modem Configuration tab). First, click Read to read the current configuration. Then set the following parameters:

With these settings, all data sent from one XBee module will be broadcast to all other XBee modules that are using your PAN ID. If you don't want to broadcast to all other XBee modules, there are three strategies for sending data to one particular XBee module.

  1. The first strategy is to use X-CTU to configure the XBee module to send to specific destinations. Under Networking & Security, set Destination Address High and Destination Address Low to the 64-bit serial number of the XBee module you want to send data to. This strategy is very easy, but it only allows you to change the destination addresses while you're running X-CTU.
  2. The second strategy is to use the communicating program itself (e.g., the E100 program) to change the destination address while the system is running. The program can do this by sending AT commands to the XBee module:
  3. The third strategy is to add a header field to each message and specify the intended destination in the header field. All XBee modules will receive the message and examine the header field. Only the intended recipient will process the message; other nodes will ignore the message.
See the XBee documentation for full details on how to use XBee modules.