Monday, September 6, 2010

XBee - A Brief Primer

The physical aspects of the Xbee chips are introduced in the hardware section (below).  Here, we will discuss the software aspects of the configuration. 
There are two different modes of operations that Xbees can run in.  They are: 
1.       Transparent mode
2.       API mode
In transparent mode, the Xbees essentially act as a dumb serial line replacement.  In other words, each Xbee simply forwards everything that comes in through its antenna to its Din port, and sends everything that comes in through its Dout port through its antenna and into the air.  This is functionally equivalent to simply having a serial line connected between the two Xbee chips.
In API mode, Xbee operation is not nearly as simple.  API stands for Application Programming Interface, and in this mode you can send commands to and from the Xbees to perform various tasks.  Further, it is in this mode that the Zigbee protocol is used for Xbee Series 2 chips.  In other words, whereas transparent mode acts as a dumb serial line replacement, API mode unleashes the full power of the Xbees and allows us to construct a real wireless network consisting of our two devices.
When in API mode, there are three more modes that each Xbee chip – or any chip on a Zigbee network – can operate in.  These modes are:
1.       Coordinator mode
2.       Router mode
3.       End Device mode
These modes are essentially listed in order of decreasing functionality.  Coordinators are the most powerful nodes in Zigbee networks, and can coordinate activity within one network while also interacting with the outside world.  Other nodes in the network “report to” the coordinator.  Router nodes have the capability of forwarding packets from one node to another (acting as an intermediary in the network, or a router).  End device nodes cannot act as routers but can communicate with routers or the network coordinator.  On series 2 Xbee chips (which we used), it is necessary to change the firmware on the chips to change between API and transparent mode and also between Coordinator, Router, and End Device mode.
In our application, we used the Xbee connected to the PC as a coordinator, and the remote Xbee as an end device.  This allowed us to use the Xbee connected to the PC to send commands to a remote Xbee, and also to set up automatic I/O sampling on the remote Xbee.  Xbees that are within the network of a certain coordinator are said to be “associated” with that coordinator node.
To configure Xbees, you can use Digi’s own X-CTU software, which was created specifically for configuring Xbee and similar chips offered by Digi, or you can simply connect to the Xbee chips via a serial terminal (such as Hyperterminal) and send them a series of commands.  You can also use a network coordinator to send commands to be executed on a remote Xbee within that coordinators network.  The Xbee chips have various registers that store different parameters.  For example, the parameter AP is what determines whether the Xbee is in transparent or API mode.  When AP=0, transparent mode is enabled.  When AP=2, API mode is enabled (AP = 1 also enables API mode, but with slight differences that we won’t discuss here).

No comments:

Post a Comment