XBee® Wi-Fi RF Modules
© 2013 Digi International, Inc. 30
UART Flow Control
The nRTS and nCTS 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.
nCTS Flow Control
The FT command allows the user to specify how many bytes of data can be queued up in
the serial transmit buffer before the module asserts CTS low. The serial receive buffer
can hold up the 2100 bytes, but FT cannot be set any larger than 2083 bytes, leaving 17
bytes that can be sent by the host before the data is dropped.
By default, FT is 2035 (0x7F3), which allows the host to send 65 bytes to the module
after the module asserts CTS before the data is dropped.
In either case, CTS will not be re-asserted until the serial receive buffer has FT-17 or less
bytes in use.
nRTS 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 nRTS is de-asserted (set high). The host device
should not de-assert nRTS 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 RTS flow control is enabled and the XBee is sending data out the UART when
nRTS is de-asserted (set high), the XBee could send up to 4 characters out the UART to
clear its FIFO after nRTS is de-asserted. This implies that the user needs to de-assert
nRTS by the time its receive capacity is within 4 bytes of full.