Module operation Serial communications
XBee/XBee-PRO ZigBee RF Modules User Guide 27
2 If the module is transmitting an RF data packet, the module may need to discover the destination address or
establish a route to the destination. After transmitting the data, the module may need to retransmit the data
if an acknowledgment is not received, or if the transmission is a broadcast. These issues could delay the
processing of data in the serial receive buffer.
Serial transmit buffer
When RF data is received, the data is moved into the serial transmit buffer and sent out the UART. If the serial
transmit buffer becomes full enough such that all data in a received RF packet will not fit in the serial transmit
buffer, the entire RF data packet is dropped.
Cases in which the serial transmit buffer may become full resulting in dropped RF packets
1 If the RF data rate is set higher than the interface data rate of the module, the module could receive data
faster than it can send the data to the host.
2 If the host does not allow the module to transmit data out from the serial transmit buffer because of being
held off by hardware flow control.
Serial flow control
The RTS and CTS module pins can be used to provide RTS and/or CTS flow control. CTS flow control provides an
indication to the host to stop sending serial data to the module. RTS flow control allows the host to signal the
module to not send data in the serial transmit buffer out the UART. RTS
and CTS flow control are enabled using
the D6 and D7 commands.
CTS flow control
If CTS flow control is enabled (D7 command), when the serial receive buffer is 17 bytes away from being full, the
module de-asserts CTS
(sets it high) to signal to the host device to stop sending serial data. CTS is re-asserted
after the serial receive buffer has 34 bytes of space.
RTS flow control
If RTS flow control is enabled (D6 command), data in the serial transmit buffer will not be sent out the DOUT pin
as long as RTS
is de-asserted (set high). The host device should not de-assert RTS for long periods of time to avoid
filling the serial transmit buffer. If an RF data packet is received, and the serial transmit buffer does not have
enough space for all of the data bytes, the entire RF data packet will be discarded.
Note If the XBee is sending data out the UART when RTS is de-asserted (set high), the XBee could send up to 5
characters out the UART after RTS is de-asserted.
Serial interface protocols
The XBee modules support both transparent and Application Programming Interface (API) serial interfaces.
Transparent operation
When operating in transparent mode, the modules act as a serial line replacement. All UART data received
through the DIN pin is queued up for RF transmission. When RF data is received, the data is sent out through the
DOUT pin. The module configuration parameters are configured using the AT command mode interface.
Data is buffered in the serial receive buffer until one of the following causes the data to be packetized and
transmitted: