Serial communications for the XBee/XBee-PRO RF Module
XBee / XBee-PRO RF Modules 802.15.4 Product Manual 19
Figure 5: UART data packet 0x1F (decimal number "31") as transmitted through the RF module
Example Data Format is 8-N-1 (bits - parity - # of stop bits)
Serial communications depend on the two UARTs (the microcontroller's and the RF module's) to be
configured with compatible settings (baud rate, parity, start bits, stop bits, data bits).
The UART baud rate and parity settings on the XBee module can be configured with the BD and NB
commands, respectively. See Command reference tables on page 40 for details.
Transparent operation
By default, XBee / XBee-PRO RF Modules operate in Transparent Mode. When operating in this mode,
the modules act as a serial line replacement - all UART data received through the DI pin is queued up
for RF transmission. When RF data is received, the data is sent out the DO pin.
Serial-to-RF packetization
Data is buffered in the DI buffer until one of the following causes the data to be packetized and
transmitted:
1. No serial characters are received for the amount of time determined by the RO (Packetization
Timeout) parameter. If RO = 0, packetization begins when a character is received.
2. The maximum number of characters that will fit in an RF packet (100) is received.
3. The Command Mode Sequence (GT + CC + GT) is received. Any character buffered in the DI buffer
before the sequence is transmitted.
If the module cannot immediately transmit (for instance, if it is already receiving RF data), the serial
data is stored in the DI Buffer. The data is packetized and sent at any RO timeout or when 100 bytes
(maximum packet size) are received.
If the DI buffer becomes full, hardware or software flow control must be implemented in order to
prevent overflow (loss of data between the host and module).
API operation
API (Application Programming Interface) Operation is an alternative to the default Transparent
Operation. The frame-based API extends the level to which a host application can interact with the
networking capabilities of the module.
When in API mode, all data entering and leaving the module is contained in frames that define
operations or events within the module.
Transmit data frames (received through the DI pin (pin 3)) include:
• RF Transmit data frame
• Command frame (equivalent to AT commands)
Receive Data frames (sent out the DO pin (pin 2)) include: