MaxStream is a well-known manufacturer of components for wireless communication. ZigBee is one of the MaxStream products. There are two versions of ZigBee that are available from MaxStream which are XBee and XBee PRO. Both versions are functionally identical and pin compatible. The only difference is the transmit power, which is 1mW maximum for XBee and 63mW maximum for XBee PRO. ZigBee’s mission is to cut the traditional wires between sensors, wired slaves devices, and the microcontrollers and microprocessors they serve.
ZigBee is available in three difference antenna:-
1. Integrated into the chip. In this case the radiated energy is practically non-directional
2. With an antenna connector for attaching an external antenna.
3. With an integrated vertical (whip) antenna.
ZigBee can be interfaced quite easily via a standard serial port, such is commonly found in the microcontrollers (UART) or the COM port of a PC (RS232), at maximum rate baud of 115, 200. The XBee is powered from a 3.3v supply instead of 5v supply like most digital circuits.
AT command structure. XBee modules recognize such command.
The commands are actually just ASCII codes (character strings). You send commands to the XBee the same way as data, and there is a bit of software that tells the two apart. This works as follows. Before send a command, you have to put the XBee in the ‘wait for command’ state. To do so, you send it a string of three + characters (hex 2B), or literally ‘+++’. After this, the XBee expects to receive a command in Hayes format, which always starts with ‘AT’ (which stands for ‘attention’) in ASCII code, followed immediately by the actual command and any command parameters that may be necessary. The command string is terminated by a Carriage Return (CR) character. Figure above shows an example of all this. The XBee module executes the command and then reports whether the command was processed successfully. If everything went the way it should, the XBee returns ‘OK’, while otherwise you will receive an error string from the module.
Internal block diagram of the XBee
A wireless link is always half-duplex. It can transmit or receive with a single antenna, but not both at the same time. However, your application can transmit and receive at the same time (full-duplex mode) via a serial link to the UART at your end of the interface. Data is presented to the XBee module through its DIN pin, and it must be in the asynchronous serial format, which consists of a start bit, 8 data bits, and a stop bit. Because the input data goes directly into the input of a UART within the XBee module, no bit inversions are necessary within the asynchronous serial data stream. All of the required timing and parity checking is automatically taken care of by the XBee’s UART. This is made possible by two software buffers. The principle is revealed in figure above. As you would expect, the XBee module produces a received data asynchronous serial data stream for the host on its DOUT pin. So, all you need is a simple three wire (DIN, DOUT, and ground) serial connection to put ZigBee to work with the XBee and XBee-Pro modules.
There is a transmit buffer and a receive buffer, and each buffer provides a temporary parking place for 100 bytes. Data can arrive from both directions at the same time – the data to be transmitted coming from the UART, and the data received by the antenna from the RF link. When the antenna is receiving data, it cannot transmit data at the same time. For this reason, the data to be transmitted is parked in the transmit buffer for a while, and the received data is stacked up in the receive buffer. As soon as the data stream from the RF end stops, the XBee module switches the antenna from receive to transmit and empties the transmit buffer by sending its content out on the ether. At the same time, the UART empties the receive buffer by sending the data in it to your application. An application with a large amount of data to send can easily overload the transmit buffer. MaxStream provides a ‘full’ alarm to deal with this problem. As soon as the application has filled all but the last 17 bytes of the transmit buffer (which means 83 bytes are waiting to be transmitted), pin 12 goes high to signal to the system that it has to stop filling the buffer for a while. Pin 12 goes low again after the content of the transmit buffer has been reduced to 66 bytes. This can be regarded as a sort of software hysteresis.
There is a transmit buffer and a receive buffer, and each buffer provides a temporary parking place for 100 bytes. Data can arrive from both directions at the same time – the data to be transmitted coming from the UART, and the data received by the antenna from the RF link. When the antenna is receiving data, it cannot transmit data at the same time. For this reason, the data to be transmitted is parked in the transmit buffer for a while, and the received data is stacked up in the receive buffer. As soon as the data stream from the RF end stops, the XBee module switches the antenna from receive to transmit and empties the transmit buffer by sending its content out on the ether. At the same time, the UART empties the receive buffer by sending the data in it to your application. An application with a large amount of data to send can easily overload the transmit buffer. MaxStream provides a ‘full’ alarm to deal with this problem. As soon as the application has filled all but the last 17 bytes of the transmit buffer (which means 83 bytes are waiting to be transmitted), pin 12 goes high to signal to the system that it has to stop filling the buffer for a while. Pin 12 goes low again after the content of the transmit buffer has been reduced to 66 bytes. This can be regarded as a sort of software hysteresis.
Pin description of the XBee chip.
Figure above shows the internal block diagram of the XBee module, which forms the core of a specific application. The XBee module has 20 leads, which is same with the DIL packages used for digital ICs. But, due to the very compact dimensions of the module, the pins are separated by only 2 millimetres, so they won’t fit in an IC socket. Fortunately for anyone who wants to keep the module replaceable, suitable PCB connectors are available from Radiospares under item number 131.9872 (they are often used in PC mice). For good measure, would like to remind again that the maximum supply voltage is 3.3 V. anything more than this will unavoidably result in the premature death of your treasured module.
The supply voltage must be decoupled by a 100-nF capacitor located as close as possible to pins 1 and 10. Communication is provided by pins 2 and 3, and the direction is indicated by arrows. Some of the pins are marked with an asterisk (*). These pins are reserved for certain functions that are not yet available from the manufacturer. When they are available, it can download from the MaxStream website and upgrade the XBee by flashing the firmware into the module. Up until then, simply leave them unconnected. The same applies to the pins marked NC (‘not connected’). Pin 5 is more important: logic 1 here (3.3 V) enables the module, while logic 0 disables it. A 10-k_ pull-up resistor from pin 5 to pin 1 ensures that the module will be enabled as soon as the supply voltage is applied. You have a choice of several functions for pin 9. An internal parameter determines which of them is active. The most important function is the sleep state. The module remains in deep sleep as long as the internal SM register is not at logic 0. Pin 7 provides a pulse-width modulated (PWM) signal proportional to the most recently received RF signal. It has a period of 8.32 ms, which corresponds to 120 Hz. Fans of LED bars and other light effects can convert it into an analogue signal and use it as a signal strength indicator (all you need is an RC network and an LM3914). This can also be done using software, since the strength of the most recently received signal is stored in the internal DB parameter.
The supply voltage must be decoupled by a 100-nF capacitor located as close as possible to pins 1 and 10. Communication is provided by pins 2 and 3, and the direction is indicated by arrows. Some of the pins are marked with an asterisk (*). These pins are reserved for certain functions that are not yet available from the manufacturer. When they are available, it can download from the MaxStream website and upgrade the XBee by flashing the firmware into the module. Up until then, simply leave them unconnected. The same applies to the pins marked NC (‘not connected’). Pin 5 is more important: logic 1 here (3.3 V) enables the module, while logic 0 disables it. A 10-k_ pull-up resistor from pin 5 to pin 1 ensures that the module will be enabled as soon as the supply voltage is applied. You have a choice of several functions for pin 9. An internal parameter determines which of them is active. The most important function is the sleep state. The module remains in deep sleep as long as the internal SM register is not at logic 0. Pin 7 provides a pulse-width modulated (PWM) signal proportional to the most recently received RF signal. It has a period of 8.32 ms, which corresponds to 120 Hz. Fans of LED bars and other light effects can convert it into an analogue signal and use it as a signal strength indicator (all you need is an RC network and an LM3914). This can also be done using software, since the strength of the most recently received signal is stored in the internal DB parameter.
greetings.
ReplyDeletedear sir/madam
my name is faisal and from malaysia.
can i know more about you project?
i do this project for my final year master..
plz help me and guide me..
your helping is really appreciate.
this is my email and id for Yahoo Massenger
—>al_hazriq@yahoo.com
after i read ur project..my project name is wireless meter reader using zigbee..can ur give me suggestion what must i done first before stat this project?? tq
ReplyDeleteIm so sori because never notice ur comment.. Im from malaysia too.. This is my final year project for degree... first, you have to communicate the two xbee with ur computer using X-CTU software..
ReplyDeleteIm doing this same project and it realy helped...thanks alot!!
ReplyDelete